Example #1
0
    void Awake()
    {
        _FxProxy = gameObject.GetComponent <CFxProxy>();
        if (_FxProxy == null)
        {
            _FxProxy = gameObject.AddComponent <CFxProxy>();
        }

        if (_FxProxy != null)
        {
            _FxProxy.Init();
        }
    }
Example #2
0
    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;
        }
    }