Exemplo n.º 1
0
 protected void InitMove()
 {
     m_cMove                  = new PointMove();
     m_cMove.OnMoveStart     += OnStartMove;
     m_cMove.OnMove          += OnMove;
     m_cMove.OnMoveStop      += OnStopMove;
     m_cMove.OnWillMove      += OnWillMove;
     m_cRotate                = new ForwardRotate();
     m_cRotate.OnStartRotate += OnStartRotate;
     m_cRotate.OnRotate      += OnRotate;
     m_cRotate.OnStopRotate  += OnStopRotate;
     m_cLerpMoveView          = this.gameObject.AddComponentOnce <LerpMoveView>();
     m_cLerpMoveView.Init();
 }
Exemplo n.º 2
0
        public void Init(uint id, int configId, int campId, TSVector position, TSVector forward, uint targetAgentId, AgentObjectType targetAgentType, TSVector targetPosition, TSVector targetForward)
        {
            m_nId                = id;
            m_nConfigId          = configId;
            m_nCampId            = campId;
            this.gameObject.name = "remote_" + m_nId + "_" + m_nConfigId;
            m_cRemoteTree        = RemoteTreePool.Instance.GetRemoteTree(m_nConfigId);
            m_cRemoteData        = m_cRemoteTree.data as RemoteData;
            m_cAgentObj          = new AgentRemote(this);
            SetPosition(position);
            SetViewPosition(position);
            m_sLastPosition = position;
            SetForward(forward);
            SetViewForward(forward);
            m_sLastForward = forward;
            if (m_cBlackBoard == null)
            {
                m_cBlackBoard = new RemoteBlackBoard(this);
            }

            m_cTarget         = AgentObject.GetAgentObject(targetAgentId, targetAgentType);
            m_sTargetPosition = targetPosition;
            m_sTargetForward  = targetForward;
            m_cView           = SceneEffectPool.Instance.CreateEffect(m_cRemoteData.remotePath, false, this.transform);
            m_cLerpView       = gameObject.AddComponentOnce <LerpMoveView>();
            m_cLerpView.Init();
            m_cLerpView.StopMove();

            m_cHangPoint = gameObject.AddComponentOnce <HangPoint>();
            string remoteFullPath = PathTool.GetSceneEffectPath(m_cRemoteData.remotePath);

            m_cHangPoint.Init(remoteFullPath);
            //暂时不支持表现挂点(特效上挂特效)
            m_cHangPoint.InitHangView(null);

            m_cCollider = ObjectPool <GameCollider> .Instance.GetObject();

            m_cCollider.Init(remoteFullPath);
            m_cCollider.Update(curPosition, curForward);
        }