45 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| /*
 | |
| 文件名:TileObject.nut
 | |
| 路径:User/Object/Map/TileObject.nut
 | |
| 创建日期:2024-11-28	23:17
 | |
| 文件用途:地板类
 | |
| */
 | |
| class Tile extends CL_SpriteObject {
 | |
| 
 | |
|     m_data = null;
 | |
| 
 | |
|     function InitData(path) {
 | |
|         m_data = ScriptData.GetFileData(path, function(DataTable, Data) {
 | |
|             while (!Data.Eof()) {
 | |
|                 local Pack = Data.Get();
 | |
|                 if (Pack == "[IMAGE]") {
 | |
|                     local PathBuf = Data.Get().tolower();
 | |
|                     if (PathBuf.len() > 0) {
 | |
|                         DataTable.path <- "sprite/" + PathBuf;
 | |
|                         DataTable.idx <- Data.Get();
 | |
|                     }
 | |
|                 } else if (Pack == "[img pos]") {
 | |
|                     DataTable.pos <- Data.Get();
 | |
|                 } else if (Pack == "[pass type]") {
 | |
|                     DataTable.pass_type <- [];
 | |
|                     while (!Data.Eof()) {
 | |
|                         DataTable.pass_type.push(Data.Get());
 | |
|                     }
 | |
|                 }
 | |
|             }
 | |
|         });
 | |
|     }
 | |
| 
 | |
|     constructor(arg) {
 | |
|         if (typeof arg == "integer") {
 | |
| 
 | |
|         } else if (typeof arg == "string") {
 | |
|             InitData(arg);
 | |
|             if ("path" in m_data)
 | |
|                 base.constructor(m_data.path, m_data.idx);
 | |
|             else {
 | |
|                 base.constructor("sprite/character/common/circlecooltime.img", 27);
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| } |