Beispiel #1
0
 void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(gameObject);
     }
     Instance = this;
     // Furthermore we make sure that we don't destroy between scenes (this is optional)
     DontDestroyOnLoad(gameObject);
 }
	void Awake()
	{
		if (Instance != null && Instance != this)
		{
			Destroy(gameObject);
		}
		Instance = this;
		// Furthermore we make sure that we don't destroy between scenes (this is optional)
		DontDestroyOnLoad(gameObject);
	}
	private void GetAllComponents()
	{
		PuzzleBoardController = GetComponentInChildren<PuzzleBoardController>() as PuzzleBoardController;
		if (PuzzleBoardController == null)
		{
			throw new UnityException("PuzzleGameController must have a PuzzleBoardController component as a child.");
		}
		PuzzlePresentationController = GetComponentInChildren<PuzzlePresentationController>() as PuzzlePresentationController;
		if (PuzzlePresentationController == null)
		{
			throw new UnityException("PuzzleGameController must have a PuzzlePresentationController component as a child.");
		}
		GemSwapper = GetComponentInChildren<GemSwapper>() as GemSwapper;
		if (GemSwapper == null)
		{
			throw new UnityException("PuzzleGameController must have a GemSwapper component as a child.");
		}
	}
Beispiel #4
0
 private void GetAllComponents()
 {
     PuzzleBoardController = GetComponentInChildren <PuzzleBoardController>() as PuzzleBoardController;
     if (PuzzleBoardController == null)
     {
         throw new UnityException("PuzzleGameController must have a PuzzleBoardController component as a child.");
     }
     PuzzlePresentationController = GetComponentInChildren <PuzzlePresentationController>() as PuzzlePresentationController;
     if (PuzzlePresentationController == null)
     {
         throw new UnityException("PuzzleGameController must have a PuzzlePresentationController component as a child.");
     }
     GemSwapper = GetComponentInChildren <GemSwapper>() as GemSwapper;
     if (GemSwapper == null)
     {
         throw new UnityException("PuzzleGameController must have a GemSwapper component as a child.");
     }
 }