public ICombo GetState(StateToSet stateset) { if (stateset == StateToSet.attackA) { _state = stateset; return(state_comboA); } if (stateset == StateToSet.attackB) { _state = stateset; return(state_comboB); } if (stateset == StateToSet.waitroom) { _state = stateset; return(state_waitingroom); } if (stateset == StateToSet.comboEnd) { _state = stateset; return(state_comboEnd); } _state = StateToSet.waitroom; return(state_waitingroom); }
public void _update() { if (CurrentState != _state) { PreviousState = CurrentState; State.Reset(); } CurrentState = _state; State.UpdateState(); }
private void Awake() { animationcontroller_ = GameObject.Find("Player").GetComponent <AnimationController>(); Attack_A_listner = GameObject.Find("attack_A_box").GetComponent <Attack_Listner>(); Attack_B_listner = GameObject.Find("attack_b_box").GetComponent <Attack_Listner>(); Attack_C_listner = GameObject.Find("attack_c_box").GetComponent <Attack_Listner>(); state_comboA = new State_AttackA(this); state_comboB = new State_AttackB(this); state_comboEnd = new State_ComboDone(this); state_waitingroom = new State_ComboReady(this); Collider_Attack = GetComponent <Collider2D>(); State = state_waitingroom; _state = StateToSet.waitroom; CurrentState = _state; Hitinterval = 0; MaxhitInterval = 1; }