コード例 #1
0
ファイル: PhaseUI.cs プロジェクト: urgamedev/TurnBasedGame
    //public bool active = false;
    public void pressed()
    {
        if (!Grid.controller.currentAction.equals("neutral")){ //really more simple if the menu is only clickable from neutral.
            return;
        }

        if (list != null){
            //active = false;
            Destroy(list.gameObject);
        }
        else{
            list = Instantiate(Grid.prefabLoader.guiList,new Vector3(transform.position.x - .5f,transform.position.y - GUIlist.SEPERATION - .2f,0),Quaternion.identity) as GUIlist;
            //active = true;
            list.transform.SetParent(transform,true);

            foreach(Phase phase in Grid.turnManager.player.phases){
                if (!phase.activated){
                    list.addAction(phase);
                }
            }
            //foreach(Action spell in spells){
            //	list.addAction(spell);
            //}
            //list.addAction(Grid.turnManager.player.phase);
        }
    }
コード例 #2
0
ファイル: Unit.cs プロジェクト: urgamedev/TurnBasedGame
 /***********************************UI************************************************************/
 //set up the action menu. This will need to be fleshed out more once special actions are added.
 public void makeActionsMenu()
 {
     float scale = Grid.map.transform.localScale.x;
     //activeMenu = Instantiate(Grid.prefabLoader.guiList,new Vector3((tile.x + .6f)*scale,(tile.y*scale + .3f)*scale,0),Quaternion.identity) as GUIlist;
     activeMenu = Instantiate(Grid.prefabLoader.guiList,new Vector3(tile.x,tile.y,0),Quaternion.identity) as GUIlist;
     activeMenu.transform.SetParent(Grid.map.transform);
     activeMenu.transform.position = transform.position;
     activeMenu.transform.position += new Vector3(.3f,.6f,0f);
     //ActionPanel panel = activeMenu.GetComponentInChildren<ActionPanel>();
     //panel.controller = controller;
     //panel.unit = this.GetComponent<Unit>();
     foreach(Action action in actions){
         activeMenu.addAction(action);
     }
 }