コード例 #1
0
ファイル: Tool.cs プロジェクト: Cpt-Leviathan/vectorgamejam
 virtual public void InitTool(RequireListTool type_, int durabilityMax_, int durabilityCost_)
 {
     type           = type_;
     durabilityMax  = durabilityMax_;
     durability     = durabilityMax;
     durabilityCost = durabilityCost_;
 }
コード例 #2
0
ファイル: UIGame.cs プロジェクト: Cpt-Leviathan/vectorgamejam
 public void SetHighLigthActive(RequireListTool toolID)
 {
     for (int i = 0; i < toolList.Count; i++)
     {
         toolList[i].color = Color.black;
     }
     toolList[(int)toolID].color = Color.green;
 }
コード例 #3
0
    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();
    }
コード例 #4
0
 public void ChangeActiveTools(RequireListTool toolID)
 {
     uigame.SetHighLigthActive(toolID);
 }