public static ShowModelUIManager GetSingleton() { if (instance == null) { GameObject go = new GameObject("ShowModelUIManager"); instance = go.AddComponent <ShowModelUIManager>(); } return(instance); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); if (GUILayout.Button("Play")) { ShowModelUIManager.GetSingleton().WatchModle(ShowModelUIManager.GetSingleton().mGameObject); } }
//实例化的时候调用; private void Awake() { instance = this; //跳场景不删除; DontDestroyOnLoad(this); //获取临时渲染纹理; mRenderTexture = RenderTexture.GetTemporary(Screen.width, Screen.height, 16); CreateCamera(mRenderTexture); }