Ejemplo n.º 1
0
        void AddLink()
        {
#if UNITY_EDITOR
            if (m_LinkInstance.valid)
            {
                Debug.LogError("Link is already added: " + this);
                return;
            }
#endif

            var link = new NavMeshLinkData();
            link.startPosition = m_StartPoint;
            link.endPosition   = m_EndPoint;
            link.width         = m_Width;
            link.costModifier  = m_CostModifier;
            link.bidirectional = m_Bidirectional;
            link.area          = m_Area;
            link.agentTypeID   = m_AgentTypeID;
            m_LinkInstance     = NavMesh.AddLink(link, transform.position, transform.rotation);
            if (m_LinkInstance.valid)
            {
                m_LinkInstance.owner = this;
            }

            m_LastPosition = transform.position;
            m_LastRotation = transform.rotation;
        }
Ejemplo n.º 2
0
        void AddLink()
        {
#if UNITY_EDITOR
            if (_mLinkInstance.valid)
            {
                Debug.LogError($"Link is already added: {this}");
                return;
            }
#endif

            var link = new NavMeshLinkData();
            link.startPosition = mStartPoint;
            link.endPosition   = mEndPoint;
            link.width         = mWidth;
            link.costModifier  = mCostModifier;
            link.bidirectional = mBidirectional;
            link.area          = mArea;
            link.agentTypeID   = mAgentTypeId;
            _mLinkInstance     = NavMesh.AddLink(link, transform.position, transform.rotation);
            if (_mLinkInstance.valid)
            {
                _mLinkInstance.owner = this;
            }

            _mLastPosition = transform.position;
            _mLastRotation = transform.rotation;
        }
Ejemplo n.º 3
0
        private void AddLink()
        {
            NavMeshLinkData navMeshLinkData = (NavMeshLinkData)null;

            ((NavMeshLinkData) ref navMeshLinkData).set_startPosition(this.m_StartPoint);
            ((NavMeshLinkData) ref navMeshLinkData).set_endPosition(this.m_EndPoint);
            ((NavMeshLinkData) ref navMeshLinkData).set_width(this.m_Width);
            ((NavMeshLinkData) ref navMeshLinkData).set_costModifier((float)this.m_CostModifier);
            ((NavMeshLinkData) ref navMeshLinkData).set_bidirectional(this.m_Bidirectional);
            ((NavMeshLinkData) ref navMeshLinkData).set_area(this.m_Area);
            ((NavMeshLinkData) ref navMeshLinkData).set_agentTypeID(this.m_AgentTypeID);
            this.m_LinkInstance = NavMesh.AddLink(navMeshLinkData, ((Component)this).get_transform().get_position(), ((Component)this).get_transform().get_rotation());
            if (((NavMeshLinkInstance) ref this.m_LinkInstance).get_valid())
            {
                ((NavMeshLinkInstance) ref this.m_LinkInstance).set_owner((Object)this);
            }
            this.m_LastPosition = ((Component)this).get_transform().get_position();
            this.m_LastRotation = ((Component)this).get_transform().get_rotation();
        }
Ejemplo n.º 4
0
 private void AddLink()
 {
     this.m_LinkInstance = NavMesh.AddLink(new NavMeshLinkData
     {
         startPosition = this.m_StartPoint,
         endPosition   = this.m_EndPoint,
         width         = this.m_Width,
         costModifier  = (float)this.m_CostModifier,
         bidirectional = this.m_Bidirectional,
         area          = this.m_Area,
         agentTypeID   = this.m_AgentTypeID
     }, base.transform.position, base.transform.rotation);
     if (this.m_LinkInstance.valid)
     {
         this.m_LinkInstance.owner = this;
     }
     this.m_LastPosition = base.transform.position;
     this.m_LastRotation = base.transform.rotation;
 }