예제 #1
0
        protected virtual void OnEnable()
        {
            EmissionsManager.AddEmissions(Settings.Emissions);
            string renderer = UnitRenderer.GetRenderer(Settings.Symbol);

            if (renderer != "")
            {
                unitRenderer = ObjectPool.Instantiate(renderer) as UnitRenderer;
                unitRenderer.transform.SetParent(MyTransform);
                unitRenderer.transform.localPosition = unitRenderer.Offset;
            }
        }
예제 #2
0
        protected virtual void OnDisable()
        {
            EmissionsManager.RemoveEmissions(Settings.Emissions);
            if (Selected)
            {
                SelectionManager.Unselect();
            }
            string renderer = UnitRenderer.GetRenderer(Settings.Symbol);

            if (renderer != "")
            {
                if (unitRenderer != null)
                {
                    ObjectPool.Destroy(unitRenderer);
                    unitRenderer = null;
                }
            }
        }