Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SceneManager: MonoBehaviour
- {
- // Attach prefab via Unity Editor.
- [SerializeField] private GameObject playerPrefab;
- [SerializeField] private Vector3 spawnPoint;
- [SerializeField] private SomeClass otherStuff;
- Awake()
- {
- var playerInstance = Instantiate(playerPrefab, spawnPoint, Quaternion.identity);
- // Send reference to player where it belongs:
- otherStuff.Player = playerInstance;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement