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); } } }
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); } } }