コード例 #1
0
        private void ExecuteActionDoor(ActionDoor action)
        {
            if (gManager.onlineGameInterface.WaitingForExpectedState())
            {
                gManager.onlineGameInterface.ForceEndReplayAction(); return;
            }

            CaseBehavior actionCharacterCell = gManager.getCase(action.y1, action.x1).GetComponent <CaseBehavior>();

            CharacterBehavior c = actionCharacterCell.getNonWoundedCharacter();

            Debug.Assert(c != null);
            CharacterBehaviorIHM character = c.GetComponent <CharacterBehaviorIHM>();

            character.characterSelection();
            if (action.action == ActionType.DESTROYDOOR)
            {
                Debug.Assert(character is CB_GuerrierIHM);
                character.GetComponent <CB_GuerrierIHM>().briserHerse();
            }
            else
            {
                Debug.Assert(character is CB_VoleuseIHM);
                character.GetComponent <CB_VoleuseIHM>().changerEtatHerse();
            }
            gManager.onlineGameInterface.ForceEndReplayAction();
        }