virtual public void InitTool(RequireListTool type_, int durabilityMax_, int durabilityCost_) { type = type_; durabilityMax = durabilityMax_; durability = durabilityMax; durabilityCost = durabilityCost_; }
public void SetHighLigthActive(RequireListTool toolID) { for (int i = 0; i < toolList.Count; i++) { toolList[i].color = Color.black; } toolList[(int)toolID].color = Color.green; }
public void repairTile(RequireListTool tool) { if (repairList.Count > 0) { if (repairList[0] == tool) { repairList.RemoveAt(0); if (repairList.Count > 0) { parent.tilemap.SetTile((Vector3Int)pos, Resources.Load <TileBase>("Tiles/tool_tiles/Tile_" + repairList[0])); parent.tilemap.RefreshTile((Vector3Int)pos); } else { parent.tilemap.SetTile((Vector3Int)pos, texture); parent.tilemap.RefreshTile((Vector3Int)pos); } switch (tool) { case RequireListTool.Hammer: GameObject go = GameObject.Instantiate(Resources.Load("Prefabs/Spark_Particle"), parent.tilemap.CellToWorld((Vector3Int)pos), Quaternion.identity) as GameObject; GameObject.Destroy(go, 1); break; case RequireListTool.Extincteur: GameObject go1 = GameObject.Instantiate(Resources.Load("Prefabs/Smoke_particle"), parent.tilemap.CellToWorld((Vector3Int)pos), Quaternion.identity) as GameObject; GameObject.Destroy(go1, 1); break; case RequireListTool.Welder: GameObject go2 = GameObject.Instantiate(Resources.Load("Prefabs/Spark_Particle"), parent.tilemap.CellToWorld((Vector3Int)pos), Quaternion.identity) as GameObject; GameObject.Destroy(go2, 1); break; case RequireListTool.Wrench: GameObject go3 = GameObject.Instantiate(Resources.Load("Prefabs/Spark_Particle"), parent.tilemap.CellToWorld((Vector3Int)pos), Quaternion.identity) as GameObject; GameObject.Destroy(go3, 1); break; default: break; } } } checkTile(); }
public void ChangeActiveTools(RequireListTool toolID) { uigame.SetHighLigthActive(toolID); }