public void Init() { if (!_init) { currentRoomX = 0; currentRoomY = 0; _nextRoomPos = Vector2.zero; _player = FindObjectOfType<Player>(); _camera = FindObjectOfType<Camera>(); _camera_behaviour = _camera.GetComponentInChildren<Camera_behaviour>(); _boardManager = FindObjectOfType<GameController>().boardManager; _rooms = new Dictionary<Vector2, Room>(); _init = true; } }
private void Start() { Camera = GameObject.Find("Main Camera"); _camera = Camera.GetComponent <Camera_behaviour>(); PlayerPrefs.SetInt("dust", 5000); }
// Use this for initialization void Start() { //_offset = transform.position; //- player.transform.position; if (instance == null) instance = this; else if (instance != this) Destroy(gameObject); Offset = Vector3.zero; _camera = GetComponent<Camera>(); DontDestroyOnLoad(_camera); }