58 lines
1.2 KiB
C#
58 lines
1.2 KiB
C#
![]() |
// ***********************************************************************
|
|||
|
// Assembly : Game
|
|||
|
// Author : Kimch
|
|||
|
// Created : 2021-04-17
|
|||
|
// Description :
|
|||
|
// Last Modified By :
|
|||
|
// Last Modified On :
|
|||
|
// ***********************************************************************
|
|||
|
// <copyright file= "EffectRoot" company="Kunpo"></copyright>
|
|||
|
// <summary></summary>
|
|||
|
// ***********************************************************************
|
|||
|
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace G
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 类功能描述
|
|||
|
/// </summary>
|
|||
|
public class EffectRoot : MonoBehaviour
|
|||
|
{
|
|||
|
#region Field
|
|||
|
|
|||
|
RenderTexture _renderTexture;
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Method
|
|||
|
|
|||
|
public RenderTexture GetTexture()
|
|||
|
{
|
|||
|
return _renderTexture;
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Unity
|
|||
|
|
|||
|
public static EffectRoot Instance;
|
|||
|
|
|||
|
// Use this for initialization
|
|||
|
private void Awake()
|
|||
|
{
|
|||
|
Instance = this;
|
|||
|
DontDestroyOnLoad(this.gameObject);
|
|||
|
transform.position = Vector3.one * -1000f;
|
|||
|
|
|||
|
var camera = GetComponentInChildren<Camera>();
|
|||
|
_renderTexture = RenderTexture.GetTemporary(512, 512);
|
|||
|
camera.targetTexture = _renderTexture;
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|