Esempio n. 1
0
    /// <summary>
    /// 处理在施放技能中,还能接受用户输入,并改变攻击方向
    /// </summary>
    /// <param name="point"></param>
    public void OnTouch(Vector3 point)
    {
        if (m_actData.m_ani_followtype == 4)
        {
            m_touchPoint = point;

            var heroPos = m_PlayerBehaviour.IsCopy?m_hero.transform.position:m_PlayerBehaviour.ThisTransform.position;

            var newDirect = (m_touchPoint - heroPos).normalized;

            SMsgFightChangeDirect_CS sMsgFightChangeDirect_CS = new SMsgFightChangeDirect_CS();
            sMsgFightChangeDirect_CS.DirX = newDirect.x;
            sMsgFightChangeDirect_CS.DirY = newDirect.z * -1;

            NetServiceManager.Instance.BattleService.SendFightChangeDirectCommand(sMsgFightChangeDirect_CS);

            m_attackDire = newDirect;
        }
    }
Esempio n. 2
0
    void CheckJoyStickInSkillFire()
    {
        if (GameManager.Instance.CurrentGameMode == GameMode.SINGLE_PLAYER)
        {
            if (m_actData.m_ani_followtype == 4)
            {
                if (m_PlayerBehaviour.IsJoyStickPress && m_PlayerBehaviour.JoyStickDir != Vector3.zero)
                {
                    var newDirect = m_PlayerBehaviour.JoyStickDir.normalized;

                    SMsgFightChangeDirect_CS sMsgFightChangeDirect_CS = new SMsgFightChangeDirect_CS();
                    sMsgFightChangeDirect_CS.DirX = newDirect.x;
                    sMsgFightChangeDirect_CS.DirY = newDirect.z * -1;

                    NetServiceManager.Instance.BattleService.SendFightChangeDirectCommand(sMsgFightChangeDirect_CS);

                    m_attackDire = newDirect;
                }
            }
        }
    }
Esempio n. 3
0
 public void SendFightChangeDirectCommand(SMsgFightChangeDirect_CS sMsgFightChangeDirect_CS)
 {
     this.Request(sMsgFightChangeDirect_CS.GeneratePackage(MasterMsgType.NET_ROOT_FIGHT, FightDefineManager.MSG_FIGHT_BATTLE_CHANGE_DIRECT));
 }