private void Awake()
 {
     stats.Init(this);
     jumpState               = new JumpState(this);
     wallJumpState           = new WalljumpState(this);
     dashState               = new DashState(this);
     freeState               = new FreeState(this);
     expulsedState           = new ExpulsedState(this);
     downDashState           = new DashDownState(this);
     platformistChargedState = new PlatformistChargedState(this);
     restrainedByGhostState  = new RestrainedByGhostState(this);
     frozenState             = new FrozenState(this);
 }
Exemple #2
0
    void OnNotifyGameObjectFreeState(FreeState pMsg)
    {
        UInt64 sGUID;

        sGUID = pMsg.objguid;
        Vector3 mvPos  = this.ConvertPosToVector3(pMsg.pos);
        Vector3 mvDir  = this.ConvertDirToVector3(pMsg.dir);
        Player  entity = null;

        if (PlayersManager.Instance.PlayerDic.TryGetValue(sGUID, out entity))
        {
            Vector3 sLastSyncPos = entity.GOSSI.sServerSyncPos;
            mvPos.y = entity.RealEntity.transform.position.y;
            entity.GOSSI.sServerBeginPos = mvPos;
            entity.GOSSI.sServerSyncPos  = mvPos;
            entity.GOSSI.sServerDir      = mvDir;
            entity.GOSSI.fBeginTime      = Time.realtimeSinceStartup;
            entity.GOSSI.fLastSyncSecond = Time.realtimeSinceStartup;
            entity.isRuning = false;
            entity.EntityChangedata(mvPos, mvDir);
            //调用子类执行状态
            entity.OnFreeState();
        }
    }
    // public int  OnNotifySkillInfo(NotifySkillInfo pMsg){
    //    EventCenter.Broadcast((Int32)GameEventEnum.UserEvent_NotifySkillInfo, pMsg);
    //    return (int)EErrorCode.eNormal;
    //}

    public int OnNotifySGameObjectFreeState(FreeState pMsg)
    {
        EventCenter.Broadcast((Int32)GameEventEnum.UserEvent_NotifyGameObjectFreeState, pMsg);
        return((int)ErrorCodeEnum.Normal);
    }