private void ChangeComp(SmartComponent component, int Choise) { int NextAct = 0; string Selected = "SourceSelector" + Choise.ToString(); if (component.IOSignals[Selected].Value.Equals(1)) { //Record if we want to turn this one ON NextAct = Choise; } else { //We want to turn it OFF, and select the next highest for (int i = 6; i >= 0; i--) { Selected = "SourceSelector" + i.ToString(); if (NextAct == 0) { if (component.IOSignals[Selected].Value.Equals(1)) { NextAct = i; } } } } component.Properties["SourceSelectNumber"].Value = NextAct; Selected = "Component" + NextAct.ToString(); component.Properties["ResultingComponent"].Value = component.Properties[Selected].Value; }
//選択したコマンドをセットする private void SetSelectCommand(GameObject allyCharacterInBattle, Skill skill, GameObject targetChara = null, Item item = null) { CharacterStatus allyCharacterStatus = allyCharacterInBattle.GetComponent <CharacterBattleScript>().GetCharacterStatus(); NextAct nextAct = new NextAct(); nextAct.skill = skill; nextAct.targetChara = targetChara; nextAct.item = item; nextActs[allyCharacterStatus.GetCharacterName()] = nextAct; battleStatusScript.UpdateSelect(allyCharacterStatus, skill.GetKanjiName(), AllySelectCommand, allyCharacterInBattle); commandPanel.gameObject.SetActive(false); magicOrItemPanel.gameObject.SetActive(false); ResetCharacterPanel(); //キャンセルボタンを使用不可能に cancelButton.interactable = false; //攻撃ボタンを使用可能に attackButton.interactable = true; //逃げるボタンを使用可能に getAwayButton.interactable = true; }