Example #1
0
    public void SetState(eState rState)
    {
        switch (rState)
        {
        case eState.Idle:

            break;

        case eState.Hit:
            PlayAim("Hit");
            break;

        case eState.Atk:
            curAtkState = eAtkState.Atk;
            if (moveDir != Vector3.zero)
            {
                gameObject.transform.rotation = Quaternion.LookRotation(moveDir);
            }
            break;

        case eState.Air:
            collisonStayEvent += CheckIsGround;
            PlayAim("Jump_Short");
            mAim.SetBool("isAir", true);
            break;
        }

        curState = rState;
    }
Example #2
0
    public void SetAtkState(eAtkType rType, float rActiveTriggerTime, List <string> rActiveTriggerIndex, float rSwichAtkTime, float crossTime)
    {
        SetAllColUnActive();
        SetState(eState.Atk);


        curAtkKey = Time.time;
        float tempKey = curAtkKey;

        float aimTime = PlayAim(rType.ToString(), crossTime);

        Util.DelayCall(rActiveTriggerTime, () =>
        {
            if (tempKey != curAtkKey)
            {
                return;
            }
            for (int i = 0; i < rActiveTriggerIndex.Count; i++)
            {
                SetColActiveOrUn(rActiveTriggerIndex[i], true);
            }
        });

        Util.DelayCall(rSwichAtkTime, () =>
        {
            if (tempKey != curAtkKey)
            {
                return;
            }

            OnHitEvent = null;
            SetAllColUnActive();
            curAtkState = eAtkState.AtkWait;
        });

        Util.DelayCall(aimTime, () =>
        {
            if (tempKey != curAtkKey)
            {
                return;
            }

            curAtkState = eAtkState.None;
            curAtkType  = eAtkType.None;
        });

        curAtkType = rType;
    }