该项目的目的是同时测试和演示来自 Unity DOTS 技术堆栈的多个新包。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

36 行
766 B

using System.Collections;
using System.Collections.Generic;
using Unity.Sample.Core;
using UnityEngine;
[RequireComponent(typeof(Camera))]
public class GameCamera : MonoBehaviour
{
Camera m_Camera;
private void Awake()
{
m_Camera = GetComponent<Camera>();
}
private bool pushed = false;
private void Update()
{
if (Game.game == null)
return;
if (!pushed)
{
pushed = true;
GameApp.CameraStack.PushCamera(m_Camera);
}
}
private void OnDisable()
{
if (Game.game)
GameApp.CameraStack.PopCamera(m_Camera);
else
GameDebug.LogWarning("Unable to pop GameCamera " + gameObject.name + ". No Game.game");
}
}