Example #1
0
 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;
 }
Example #2
0
    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);
    }
Example #3
0
    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);
    }
Example #4
0
    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);
    }