Пример #1
0
    public override void OnLoopFXLoaded(EffectController vfx)
    {
        // TODO, GetComponentsInChildren 是一个比较慢的操作, 考虑直接放到VFXController里, 做特效的时候直接拖上
        Collider[] colliders = vfx.GetComponentsInChildren <Collider>(true);
        for (int iCollider = 0; iCollider < colliders.Length; iCollider++)
        {
            m_ColliderList.Add(colliders[iCollider]);
            m_Buff.BuffProperty.AddCollider_Runtime(colliders[iCollider]);
            LayerUtil.SetGameObjectToLayer(colliders[iCollider].gameObject, m_Buff.BuffProperty.GetRootTransform().gameObject.layer, false);
        }

        VFXReactiveEffect[] reactiveEffects = vfx.GetComponentsInChildren <VFXReactiveEffect>();
        for (int iEffect = 0; iEffect < reactiveEffects.Length; iEffect++)
        {
            m_ReactiveVFXList.Add(reactiveEffects[iEffect]);
        }
    }