Пример #1
0
        //设置光效行为类型
        public void setEffectBehaviourType(EEffectBehaviour eType)
        {
            _eBehavourType = eType;
            if (_effectGameObj == null)
            {
                return;
            }

            EffectDefaultBehaviour pBhScript = null;

            switch (eType)
            {
            case EEffectBehaviour.eLineTrack:
                pBhScript = _effectGameObj.AddComponent <EffectLineBehaviour>();
                break;

            case EEffectBehaviour.eParabolaTrack:
                pBhScript = _effectGameObj.AddComponent <EffectDefaultBehaviour>();
                break;

            default:
                pBhScript = _effectGameObj.AddComponent <EffectDefaultBehaviour>();
                break;
            }
        }
Пример #2
0
        //设置目标
        public void setTarget(Transform tf)
        {
            _tfTarget = tf;
            if (_effectGameObj == null)
            {
                return;
            }

            EffectDefaultBehaviour pBhScript = _effectGameObj.GetComponent <EffectDefaultBehaviour>();

            if (pBhScript != null)
            {
                pBhScript.setTarget(tf);
            }
        }