Beispiel #1
0
    //called from girl controller Update() while this ability is active
    public override void ActiveUpdate()
    {
        if (state == TornadoStates.Casting)
        {
            if (Time.time > nextStateTime)
            {
                state = TornadoStates.PostCast;
                gc.controller.LockY = false;
                nextStateTime = Time.time + 0.15f;

                //spawn projectile
                GameObject go = MonoBehaviour.Instantiate(Resources.Load("TornadoProj", typeof(GameObject))) as GameObject;
                TornadoProjectile t = go.GetComponent<TornadoProjectile>();
                t.Throw(gc.controller.FacingValue, transform);
            }
        }

        else if (state == TornadoStates.PostCast)
        {

            if (Time.time > nextStateTime)
            {
                ExitAction();
            }
        }
    }
Beispiel #2
0
    public override void Execute()
    {
        base.Execute();

        isActive = true;
        nextStateTime = Time.time + 0.4f;
        state = TornadoStates.Casting;

        animator.speed = 1.5f;
        animator.CrossFade(HashLookup.tornadoHash, 0.1f, 0, 0);
    }