void Awake() { _FxProxy = gameObject.GetComponent <CFxProxy>(); if (_FxProxy == null) { _FxProxy = gameObject.AddComponent <CFxProxy>(); } if (_FxProxy != null) { _FxProxy.Init(); } }
public void SetFxGameObject(GameObject fx) { _RealFxGameObject = fx; if (_RealFxGameObject != null) { _FxProxy = _RealFxGameObject.GetComponent <CFxProxy>(); if (_FxProxy == null) { _FxProxy = _RealFxGameObject.AddComponent <CFxProxy>(); _FxProxy.Init(); } } else { _FxProxy = null; } }