protected override void Start() { base.Start(); CurrentAction = OverlordAction.Right; //actual first will be mid left switchPhase(); InvokeRepeating("switchPhase", 6.0f, 6.0f); m_HealthScript.onDeathDelegate += onDeath; }
private void switchPhase() { if (m_HealthScript.IsDead()) { return; } OverlordAction nextPhase = getNextPhase(CurrentAction); CurrentAction = nextPhase; GameObject attackOb = getAttackOb(CurrentAction); GameObject newAttack = Instantiate(attackOb, attackOb.GetComponentInParent <Transform>()); newAttack.SetActive(true); }
private GameObject getAttackOb(OverlordAction curAction) { switch (curAction) { case (OverlordAction.Mid): case (OverlordAction.MidR): return(midAttack); case (OverlordAction.Left): return(leftAttack); case (OverlordAction.Right): return(rightAttack); } return(null); }
private OverlordAction getNextPhase(OverlordAction curAction) { switch (curAction) { case (OverlordAction.Mid): return(OverlordAction.Left); case (OverlordAction.Left): return(OverlordAction.MidR); case (OverlordAction.MidR): return(OverlordAction.Right); case (OverlordAction.Right): return(OverlordAction.Mid); } return(OverlordAction.Mid); }