Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- //main manager for data persistnece between scenes
- public class MainManager : MonoBehaviour
- {
- public static MainManager Instance;
- //variable for picking the colour of vehicles in the lesson
- public Color TeamColor;
- private void Awake()
- {
- //this is to destroy the second main manager which appears after returning to the original scene
- if (Instance != null)
- {
- Destroy(gameObject);
- return; //i forgot to add this line and only saw the mistake after reviewing for the next project
- }
- Instance = this;
- DontDestroyOnLoad(gameObject);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement