Ejemplo n.º 1
0
    public void PlayerStateChanged(E_AvatarBehavior behaviorState)
    {
        AvatarBehavior = behaviorState;

        if (!_artAnimatorManager)
        {
            return;
        }
        if (behaviorState == E_AvatarBehavior.B_SHOOT)
        {
            if (AvatarMotion == E_AvatarMotionState.AM_MOVE)
            {
                int direction = 1;
                if (JoystickAngle >= 100 && JoystickAngle <= 250)
                {
                    direction = 3;
                }
                else if (JoystickAngle > 280 || JoystickAngle < 80)
                {
                    direction = 4;
                }
                else if (JoystickAngle >= 260 && JoystickAngle <= 280)
                {
                    direction = 2;
                }
                _artAnimatorManager.Shoot(true, direction);
            }
            else
            {
                _artAnimatorManager.Shoot(true);
            }
        }
        else if (behaviorState == E_AvatarBehavior.B_GRENADE)
        {
            _artAnimatorManager.Grenade(true);
        }
        else
        {
            _artAnimatorManager.Shoot(false);
        }
        // SendEvent();
    }
Ejemplo n.º 2
0
    public void Init()
    {
        AvatarState       = E_AvatarState.AS_ALIVE;
        AvatarMotion      = E_AvatarMotionState.AM_IDLE;
        AvatarForm        = E_AvatarForm.PERSON_STATE;
        _beforeAvatarForm = E_AvatarForm.PERSON_STATE;
        AvatarBehavior    = E_AvatarBehavior.B_NONE;

        _motionStateCount = Enum.GetValues(typeof(E_AvatarMotionState)).Length;

        _childObj             = gameObject.transform.Find(PlayerCommonName.ChildName);
        _ufpTransformObj      = transform.GetComponent <U_FPTransform>();
        _ufpTransformChildObj = _childObj.GetComponent <U_FPTransform>();
        _characterMotionObj   = transform.GetComponent <CharacterMotion>();

        _hp = HpMax;
        AutoRenderSplatData(AvatarEntityId);

        Debug.Log("AvatarId::" + AvatarEntityId + "  == > InitInitInitInitInitInitInitInitInitInit!!!");
    }