void OnEnable() { if (m_cNavMono == null) { if (target) { m_cNavMono = (NavMonoEditor)target; } else Debug.Log("需要一个脚本对象,必须挂载脚本上面"); } if( m_cParent == null ) { GameObject.DestroyImmediate(GameObject.Find("NavMeshParent")); m_cParent = new GameObject("NavMeshParent"); m_cParent.transform.parent = this.m_cNavMono.transform; } }
void OnEnable() { if (m_cNavMono == null) { if (target) { m_cNavMono = (NavMonoEditor)target; } else { Debug.Log("需要一个脚本对象,必须挂载脚本上面"); } } if (m_cParent == null) { GameObject.DestroyImmediate(GameObject.Find("NavMeshParent")); m_cParent = new GameObject("NavMeshParent"); m_cParent.transform.parent = this.m_cNavMono.transform; } }
void OnDestroy() { this.m_cNavMono = null; }