private void Update() { if (m_instance == null) { m_instance = this; m_renderObjects = new List <IGL>(); } }
private void Awake() { if (m_instance != null) { Debug.LogWarning("Another instance of GLLinesRenderer aleready exist"); } m_instance = this; m_renderObjects = new List <IGL>(); }
private static void OnScriptsReloaded() { if (m_instance == null) { GLRenderer glRenderer = FindObjectOfType <GLRenderer>(); if (glRenderer != null) { glRenderer.m_renderObjects = new List <IGL>(); m_instance = glRenderer; } } }
private void OnDisable() { GLRenderer glRenderer = GLRenderer.Instance; if (glRenderer) { glRenderer.Remove(this); } if (m_collider != null) { Destroy(m_collider); m_collider = null; } }
private void OnEnable() { GLRenderer glRenderer = GLRenderer.Instance; if (glRenderer) { glRenderer.Add(this); } m_collider = GetComponent <SphereCollider>(); if (m_collider == null) { m_collider = gameObject.AddComponent <SphereCollider>(); m_collider.radius = 0.25f; } if (m_collider != null) { if (m_collider.hideFlags == HideFlags.None) { m_collider.hideFlags = HideFlags.HideInInspector; } } }
private void OnDestroy() { m_instance = null; }