private void Init() { Cache(); triangleController.Init(); circleController.Init(); bulletController.Init(); barrierController.Init(); uiController.Init(); }
public void Start() { actionLock = new ActionLockController(); barrierController = GetComponent <BarrierController>(); fearController = GetComponent <FearController>(); keyBindings = GetComponent <KeyBindingsController>(); cameraController = GetComponent <CameraController>(); motorController = GetComponent <KinimaticMotorController>(); houseController = GetComponent <HouseController>(); hauntController = GetComponent <HauntController>(); pathController = GetComponent <NodePathController>(); barrierController.Init(actionLock); fearController.Init(); keyBindings.Init(); cameraController.Init(actionLock); motorController.Init(); hauntController.Init(actionLock); houseController.Init(motorController, pathController, hauntController, barrierController); ui = GameObject.Instantiate(uiPrefab, transform); ui.OnEndOfNight += HandleEndOfNight; ui.Init(fearController, fearTarget, actionLock); houseController.Generate(); var invShuffle = new ShuffleSet <GameObject>(investigatorModels); var roomShuffle = new ShuffleSet <Vector2Int>(houseController.GetNonStartingRooms()); var rotationIncrement = 360.0f / investigatorCount; for (int i = 0; i < investigatorCount; i++) { var rotation = i * rotationIncrement; var offset = Quaternion.Euler(0, rotation, 0) * (Vector3.right * offsetDistance); SpawnInvestigator(invShuffle, offset); } SpawnPlayer(); }