Пример #1
0
    private void ResetJoystick()
    {
        m_widget_joystick.alpha = 0.5f;
        m_widget_joystick.gameObject.transform.localPosition        = m_trans_joystickPos.localPosition;
        m_sprite_joystickThumb.transform.localPosition              = Vector3.zero;
        m_sprite_joystickBg.transform.localPosition                 = Vector3.zero;
        m_sprite_joystickThumb.GetComponent <BoxCollider>().enabled = false;

        Client.IControllerSystem controllerSys = Client.ClientGlobal.Instance().GetControllerSystem();
        if (controllerSys != null)
        {
            Client.IController ctrl = controllerSys.GetActiveCtrl();
            if (ctrl != null)
            {
                ctrl.OnMessage(Engine.MessageCode.MessageCode_JoystickEnd);
            }
        }
        Engine.Utility.EventEngine.Instance().DispatchEvent((int)(int)Client.GameEventID.JOYSTICK_UNPRESS, null);
        if (MainPlayerHelper.GetMainPlayer() != null)
        {
            ISkillPart part = MainPlayerHelper.GetMainPlayer().GetPart(EntityPart.Skill) as ISkillPart;
            if (part != null)
            {
                int st = part.GetCurSkillState();
                if (st == (int)SkillState.None || st == (int)SkillState.Prepare)
                {
                    stForbiddenJoystick info = new stForbiddenJoystick();
                    info.playerID  = MainPlayerHelper.GetPlayerUID();
                    info.bFobidden = false;
                    EventEngine.Instance().DispatchEvent((int)GameEventID.SKILL_FORBIDDENJOYSTICK, info);
                }
            }
        }
    }