Подскажите как можо перенести переменную Transform между уровнями.
когда происходит переход между уровнями переменная меняется на "Missing".
в общем подскажите пожалуйста как это исправить.
Синтаксис:
Используется csharp
using UnityEngine;
using System.Collections;
public class Level : MonoBehaviour {
public Transform Players;
public Transform Start;
public void Awake()
{
DontDestroyOnLoad(transform.gameObject);
}
// Update is called once per frame
public void Spawn () {
Instantiate(Start,Start.position,Start.rotation);
}
}
using System.Collections;
public class Level : MonoBehaviour {
public Transform Players;
public Transform Start;
public void Awake()
{
DontDestroyOnLoad(transform.gameObject);
}
// Update is called once per frame
public void Spawn () {
Instantiate(Start,Start.position,Start.rotation);
}
}