protected void DestroyMesh() { if (this.m_spriteMesh != null) { this.m_spriteMesh.sprite = null; } this.m_spriteMesh = null; if (base.renderer != null) { if (Application.isPlaying) { UnityEngine.Object.Destroy(base.renderer); } else { UnityEngine.Object.DestroyImmediate(base.renderer); } } UnityEngine.Object component = base.gameObject.GetComponent(typeof(MeshFilter)); if (component != null) { if (Application.isPlaying) { UnityEngine.Object.Destroy(component); } else { UnityEngine.Object.DestroyImmediate(component); } } }
protected void DestroyMesh() { if (m_spriteMesh != null) { m_spriteMesh.sprite = null; } m_spriteMesh = null; // Destroy our unneeded components: if (renderer != null) { GameObject.DestroyImmediate(renderer); } Object filter = gameObject.GetComponent(typeof(MeshFilter)); if (filter != null) { GameObject.DestroyImmediate(filter); } }
protected void AddMesh() { this.m_spriteMesh = new SpriteMesh(); this.m_spriteMesh.sprite = this; }
protected void AddMesh() { m_spriteMesh = new SpriteMesh(); m_spriteMesh.control = this; }