void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(this.gameObject); } else if (instance != this) { Destroy(this.gameObject); } }
// Update is called once per frame void Update() { if (Input.GetKeyDown("p")) { StartCoroutine(LaserSingleton.MasterSpark(start1, goal1, MastaSpalku)); LaserSingleton.raycastBegin = true; } if (Input.GetKeyDown("o")) { StartCoroutine(LaserSingleton.MasterSpark(start2, goal2, MastaSpalku)); LaserSingleton.raycastBegin = true; } if (Input.GetKeyDown("i")) { StartCoroutine(LaserSingleton.MasterSpark(start3, goal3, MastaSpalku)); LaserSingleton.raycastBegin = true; } }