Пример #1
0
 //设置agent(武器的持有者实体)
 public virtual void setAgent(BaseEntity entity)
 {
     if (entity != null)
     {
         agent = entity as EntityMainPlayer;
         resetTrans();
     }
 }
Пример #2
0
 //玩家停止移动
 private void onPlayerMovingEnd(Message msg)
 {
     if (player == null)
     {
         player = EntityMgr.Instance.getMainPlayer() as EntityMainPlayer;
     }
     if (player != null)
     {
         player.onPlayerMoveEnd(null);
     }
 }
Пример #3
0
    //玩家移动
    private void onPlayerMoving(Message msg)
    {
        Vector3  dir = (Vector3)msg["dir"];
        MoveData dt  = new MoveData();

        dt.moveDir = dir;
        if (player == null)
        {
            player = EntityMgr.Instance.getMainPlayer() as EntityMainPlayer;
        }
        if (player != null)
        {
            player.onPlayerMove(dt);
        }
    }
Пример #4
0
    //当接受到释放技能请求
    private void onCastSkill(Message msg)
    {
        int skillId = (int)msg["skillId"];

        if (dictSkillData == null)
        {
            initData();
        }
        SkillItemUIData skillData = null;

        if (dictSkillData.ContainsKey(skillId))
        {
            skillData = dictSkillData[skillId];
        }

        EntityMainPlayer role = EntityMgr.Instance.getMainPlayer() as EntityMainPlayer;

        if (role != null)
        {
            if (skillData != null)
            {
                if (skillData.skillModeType == SkillModeType.baseSkill)
                {
                    MessageCenter.Instance.SendMessage(MsgCmd.On_Combo_Release_Success, this);
                    if (role.isCanChangeState(StateType.baseCombo))
                    {
                        FSMArgs args = new FSMArgs();
                        args.comboSkills = getComboSkills();
                        role.onChangeState(StateType.baseCombo, args);
                    }
                }
                else
                {
                    FSMArgs args = new FSMArgs();
                    args.skillData = skillData;
                    role.onReleaseSkill(skillId, args);
                }
            }
        }
    }