示例#1
0
 public void Select()
 {
     if (LastMenu is BattleMenu)
     {
         string[] labels    = { "Use Item" };
         Action[] actionsIn = { () => UseOrSelectCreature() };
         Actions.Populate(labels, actionsIn);
     }
     else if (LastMenu is PartyMenu)
     {
         string[] labels = { "Confirm" };
         //TODO: Code for what param to enter here instead of null
         Action[] actionsIn = { () => NotifySelection(null) };
         Actions.Populate(labels, actionsIn);
     }
     else
     {
         string[] labels    = { "Use Item", "Give Item" };
         Action[] actionsIn = { () => UseOrSelectCreature(), () => SelectCreature(false) };
         Actions.Populate(labels, actionsIn);
     }
 }
示例#2
0
    public void Select(int id)
    {
        for (int i = 0; i < 6; i++)
        {
            canvas.transform.GetChild(i + 1).gameObject.GetComponent <Button>().interactable = false;
        }
        selectedCreature = GameObject.Find("WalkableCharacter").GetComponent <Battle>().Party[id];
        LastSelected     = Selected;

        if (LastMenu is BattleMenu)
        {
            string[] labels    = { "Details", "Send Out" };
            Action[] actionsIn = { () => ShowDetails(), () => SwitchOut() };
            Actions.Populate(labels, actionsIn);
        }
        else if (LastMenu is BagMenu)
        {
            string[] labels    = { "Confirm" };
            Action[] actionsIn = { () => NotifySelection(selectedCreature) };
            Actions.Populate(labels, actionsIn);
        }
        else
        {
            //Todo: implement Creature.HasItem()
            //if(selectedCreature.HasItem()){
            //string[] labels = {"Details", "Switch", "Use Item", "Take Item"};
            //Action[] actionsIn = {() => ShowDetails(), () => SwitchOrder(), () => SelectItem(true), () => TakeItem()};
            //Actions.Populate(labels, actionsIn);
            //}else{
            string[] labels    = { "Details", "Switch", "Use Item", "Give Item" };
            Action[] actionsIn = { () => ShowDetails(), () => SwitchOrder(), () => SelectItem(true), () => SelectItem(false) };
            Actions.Populate(labels, actionsIn);
            //}
        }
        Selected = Actions.transform.GetChild(0).gameObject;
    }