Exemplo n.º 1
0
    public override void OnAwake(Camera sceneCamera)
    {
        EffectRes = AssetBundleManager.GetAssets(AssetType.Asset_Prefab, assetGUID, true);


        if (null == EffectRes)
        {
            return;
        }

        hostNode = EffectRes.InstanceMainRes <Effect.EffectNodeBase>();
        if (!hostNode)
        {
            AssetBundleManager.DeleteAssets(ref EffectRes, true);
            enabled = false;
            return;
        }
        effectGo = hostNode.gameObject;
        effectGo.transform.SetParent(EffectParent);
        effectGo.transform.position   = EffectPosition;
        effectGo.transform.rotation   = EffectRoation;
        effectGo.transform.localScale = EffectScale;
        hostNode.PlayOnAwake          = false;
        hostNode.isStaticEffect       = false;
        hostNode.Init();
        hostNode.StopEffect();
        Effect.EffectNodeBase.ResigterEffectQualityChange(OnEffectQualityChange);
    }
Exemplo n.º 2
0
 public override void OnClear(Camera sceneCamera)
 {
     if (!effectGo)
     {
         return;
     }
     hostNode = null;
     Effect.EffectNodeBase.UnResigterEffectQualityChange(OnEffectQualityChange);
     GameObject.DestroyObject(effectGo);
     AssetBundleManager.DeleteAssets(ref EffectRes, true);
 }