Beispiel #1
0
    private void BlueAttackComplete()
    {
        CollectLocationUI collectLocationUI = GetComponent <CollectLocationUI>();

        collectLocationUI.enabled = false;
        collectLocationUI.Reset();
        this.uiOverrideFunction(false);
    }
Beispiel #2
0
    public override bool BlueAttack()
    {
        CollectLocationUI collectLocationUI = GetComponent <CollectLocationUI>();

        // enable polling for selected location
        collectLocationUI.enabled = true;
        this.uiOverrideFunction(true);

        var coroutine = DoBlueAttack(collectLocationUI);

        this.attackState = AttackState.create(coroutine, true, BlueAttackComplete);
        StartCoroutine(coroutine);

        return(true);
    }
Beispiel #3
0
    private IEnumerator DoBlueAttack(CollectLocationUI collectLocationUI)
    {
        // give us an extra frame for the substate animation control
        yield return(null);

        while (!collectLocationUI.IsLocationSelected())
        {
            yield return(new WaitForSeconds(0.1f));
        }

        this.uiOverrideFunction(false);
        ActivateCooldown(AttackType.BLUE);

        // now that we've actually selected a location, change to be uninterruptable
        this.attackState = AttackState.create();

        // start the travel animation now that we've selected. wait a frame.
        this.anim.SetTrigger("select");

        this.immobile     = true;
        this.invulnerable = true;

        yield return(new WaitForSeconds(2.0f));

        transform.position = collectLocationUI.GetLocation();
        collectLocationUI.Reset();

        yield return(new WaitForSeconds(2.0f));

        // exit and give a frame for the transition
        this.anim.SetTrigger("exitSubState");
        yield return(null);

        this.immobile             = false;
        this.invulnerable         = false;
        this.attackState.finished = true;
    }