//////////////////////////////////////////////// //////////////////////////////////////////////// void Awake() { if (_instance != null && _instance != this) { Destroy(gameObject); } else { _instance = this; } }
void Awake() { _gameManager = FindObjectOfType <GameManager>(); if (_gameManager == null) { Debug.LogError("OOPSALA we have an ERROR!"); } _worldBuilder = GetComponentInChildren <WorldBuilder>(); if (_worldBuilder == null) { Debug.LogError("OOPSALA we have an ERROR!"); } _gridBuilder = GetComponentInChildren <GridBuilder> (); if (_gridBuilder == null) { Debug.LogError("OOPSALA we have an ERROR!"); } _mapPieceBuilder = GetComponentInChildren <MapPieceBuilder> (); if (_mapPieceBuilder == null) { Debug.LogError("OOPSALA we have an ERROR!"); } _outerZoneBuilder = GetComponentInChildren <OuterZoneBuilder>(); if (_outerZoneBuilder == null) { Debug.LogError("OOPSALA we have an ERROR!"); } _playerShipBuilder = GetComponentInChildren <PlayerShipBuilder>(); if (_playerShipBuilder == null) { Debug.LogError("OOPSALA we have an ERROR!"); } _cubeConnections = GetComponent <CubeConnections> (); if (_cubeConnections == null) { Debug.LogError("OOPSALA we have an ERROR!"); } _mapSettings = GetComponent <MapSettings> (); if (_mapSettings == null) { Debug.LogError("OOPSALA we have an ERROR!"); } }
void Awake() { _gameManager = FindObjectOfType <GameManager>(); if (_gameManager == null) { Debug.LogError("OOPSALA we have an ERROR!"); } _cubeConnections = GetComponent <CubeConnections>(); if (_cubeConnections == null) { Debug.LogError("OOPSALA we have an ERROR!"); } }
public void AssignCubeNeighbours() { if (!NeighboursSet) { if (CubeMoveable) { CubeConnections.SetCubeNeighbours(this); } else { CubeConnections.SetCubeHalfNeighbours(this); } NeighboursSet = true; } }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Debug.LogError("OOPSALA we have an ERROR! More than one instance bein created"); Destroy(gameObject); } _locationManager = GetComponentInChildren <LocationManager> (); if (_locationManager == null) { Debug.LogError("OOPSALA we have an ERROR!"); } }