Exemplo n.º 1
0
 private void SetEffectTexture(TVFade effect)
 {
     this.projectionTexture.width       = Mathf.RoundToInt(effect.GetTextureWidth());
     this.projectionTexture.height      = Mathf.RoundToInt(effect.GetTextureHeight());
     this.projectionTexture.mainTexture = effect.GetRenderTexture();
     this.projectionTexture.enabled     = true;
 }
Exemplo n.º 2
0
 private void OnDisable()
 {
     this.projectionTexture.enabled     = false;
     this.projectionTexture.mainTexture = null;
     if (null != this.tvFade)
     {
         UnityEngine.Object.Destroy(this.tvFade.gameObject);
         UnityEngine.Object.Destroy(this.tvFade);
     }
     this.tvFade = null;
     Resources.UnloadUnusedAssets();
 }
Exemplo n.º 3
0
    private void Start()
    {
        this.projectionTexture = base.GetComponent <UITexture>();
        GameObject original   = AssetDataMng.Instance().LoadObject("UICommon/Render2D/TVFadeROOT", null, true) as GameObject;
        GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);

        Resources.UnloadUnusedAssets();
        gameObject.transform.localScale    = Vector3.one;
        gameObject.transform.localPosition = Vector3.zero;
        this.tvFade = gameObject.GetComponent <TVFade>();
        UIPanel uipanel = GUIMain.GetUIPanel();

        this.tvFade.Initialize(uipanel.GetWindowSize());
        this.tvFade.StartAnimation(this.onFinishedAnimation);
        this.SetEffectTexture(this.tvFade);
    }