Пример #1
0
        private void OnValidate()
        {
            if (_outlineEffect == null)
            {
                _outlineEffect = GetComponent <OutlineEffect>();
            }

            if (_outlineEffect.OutlineLayers.Count > 0)
            {
                _outlineLayer = _outlineEffect.OutlineLayers[0];
            }
            else
            {
                _outlineLayer = new OutlineLayer();
                _outlineEffect.OutlineLayers.Add(_outlineLayer);
            }

            foreach (var go in _outlineGos)
            {
                if (go)
                {
                    _outlineLayer.Add(go);
                }
            }
        }
Пример #2
0
        private void Awake()
        {
            if (_outlineEffect == null)
            {
                _outlineEffect = GetComponent <OutlineEffect>();
            }

            if (_outlineLayer == null)
            {
                if (_outlineEffect.OutlineLayers.Count > 0)
                {
                    _outlineLayer = _outlineEffect.OutlineLayers[0];
                }
                else
                {
                    _outlineLayer = new OutlineLayer();
                    _outlineEffect.OutlineLayers.Add(_outlineLayer);
                }
            }
        }