【发布时间】:2018-02-23 12:29:20
【问题描述】:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneLoader : MonoBehaviour
{
Scene scene;
private void Awake()
{
scene = SceneManager.GetActiveScene();
}
public void LoadScene(string level)
{
if (level == "Game")
{
SceneManager.LoadScene("Game");
}
else
{
UnityEngine.SceneManagement.SceneManager.LoadScene(level);
}
}
}
当它重新加载游戏场景时,对象是静止的,就像场景结束时一样。
【问题讨论】:
-
在LoadScene DestroyObject(GameObject.Find("ObjectsToBeDestroyed"))之后使用这个;