コード例 #1
0
 void OnGUI()
 {
     GUILayout.BeginArea(new Rect(50, Screen.height - 100, Screen.width - 100, 100));
     GUILayout.BeginHorizontal();
     if (heroHex.unit != null)
     {
         GUILayout.Label(heroHex.unit.name);
         if (hero != null)
         {
             GUILayout.Label("步数" + hero.step + "/" + hero.maxAP);
         }
         if (GUILayout.Button("待机"))
         {
             hexNav.ClearMoveRange();
             heroHex.Select();
         }
         if (GUILayout.Button("回合结束"))
         {
             battleManager.EndHeroRound();
             heroHex.Idle();
             hexNav.ClearAttackRange();
             hexNav.ClearMoveRange();
         }
         if (GUILayout.Button("敌方回合结束"))
         {
             battleManager.EndEnemyRound();
             for (int i = 0; i < 70; i++)
             {
                 GameObject tile    = GameObject.Find(i.ToString());
                 HexTile    hextile = tile.GetComponent <HexTile>();
                 hextile.Start();
             }
         }
     }
     GUILayout.EndHorizontal();
     GUILayout.EndArea();
 }
コード例 #2
0
    public void UnitMoveEnd(GameObject gameUnit)    //运动到目的地执行
    {
        heroMoveEnded = gameUnit;

        unitMoving = false;

        foreach (GameObject line in moveLineList)
        {
            Destroy(line);
        }

        moveLineList.Clear();
        hexNavMapManager.ClearMoveRange();
        hexNavMapManager.selectedTileObject = null;
    }