Esempio n. 1
0
        public void AddData()
        {
#if UNITY_EDITOR
            var isInPreviewScene = EditorSceneManager.IsPreviewSceneObject(this);
            var isPrefab         = isInPreviewScene || EditorUtility.IsPersistent(this);
            if (isPrefab)
            {
                //Debug.LogFormat("NavMeshData from {0}.{1} will not be added to the NavMesh world because the gameObject is a prefab.",
                //    gameObject.name, name);
                return;
            }
#endif
            if (m_NavMeshDataInstance.valid)
            {
                return;
            }

            if (m_NavMeshData != null)
            {
                m_NavMeshDataInstance       = NavMesh.AddNavMeshData(m_NavMeshData, transform.position, transform.rotation);
                m_NavMeshDataInstance.owner = this;
            }

            m_LastPosition = transform.position;
            m_LastRotation = transform.rotation;
        }
Esempio n. 2
0
 public void AddData()
 {
     if (this.m_NavMeshDataInstance.valid)
     {
         return;
     }
     if (this.m_NavMeshData != null)
     {
         this.m_NavMeshDataInstance       = NavMesh.AddNavMeshData(this.m_NavMeshData, base.transform.position, base.transform.rotation);
         this.m_NavMeshDataInstance.owner = this;
     }
     this.m_LastPosition = base.transform.position;
     this.m_LastRotation = base.transform.rotation;
 }
Esempio n. 3
0
 public void AddData()
 {
     if (((NavMeshDataInstance) ref this.m_NavMeshDataInstance).get_valid())
     {
         return;
     }
     if (Object.op_Inequality((Object)this.m_NavMeshData, (Object)null))
     {
         this.m_NavMeshDataInstance = NavMesh.AddNavMeshData(this.m_NavMeshData, ((Component)this).get_transform().get_position(), ((Component)this).get_transform().get_rotation());
         ((NavMeshDataInstance) ref this.m_NavMeshDataInstance).set_owner((Object)this);
     }
     this.m_LastPosition = ((Component)this).get_transform().get_position();
     this.m_LastRotation = ((Component)this).get_transform().get_rotation();
 }
Esempio n. 4
0
        public void AddData()
        {
            if (m_NavMeshDataInstance.valid)
            {
                return;
            }

            if (m_NavMeshData != null)
            {
                m_NavMeshDataInstance       = NavMesh.AddNavMeshData(m_NavMeshData, transform.position, transform.rotation);
                m_NavMeshDataInstance.owner = this;
            }

            m_LastPosition = transform.position;
            m_LastRotation = transform.rotation;
        }