void Awake() { if (_instance != null && _instance != this) { Destroy(gameObject); return; } else { _instance = this; } SetupPlayerCounter(); events = new GameplayEvents(); buildingsGenerator = new BuildingsGenerator(); buildingConfigurator = new BuildingConfigurator(); truckManager = new TruckManager(); players = new PlayerController[playersCount]; catastrophiesManager = new CatastrophiesManager(); var camera = Camera.main; multiTargetCamera = camera.GetComponent <CameraMultiTarget>(); cameraTargets.Clear(); NewItemInTruck += GainPointsForItem; }
private void Attach() { gameplayEvents = GameplayEvents.GetGameplayEvents(); gameplayEvents.AttachToEvent(GamePhases.GameplayPhase.BadEventStart, SetActionMusic); gameplayEvents.AttachToEvent(GamePhases.GameplayPhase.BadEventStart, ReactionFadeIn); gameplayEvents.AttachToEvent(GamePhases.GameplayPhase.FadeIn, ReactionFadeIn); gameplayEvents.AttachToEvent(GamePhases.GameplayPhase.Summary, ShowWinText); gameplayEvents.AttachToEvent(GamePhases.GameplayPhase.FloorEvacuationBreakPoint, ReactionBreakPoint); gameplayEvents.AttachToEvent(GamePhases.GameplayPhase.FloorEvacuationStart, ReactionStart); gameplayEvents.AttachToEvent(GamePhases.GameplayPhase.FloorEvacuationEnd, ReactionEvacuationEnd); gameplayEvents.AttachToEvent(GamePhases.GameplayPhase.GameOver, ReactionFadeOut); gameplayEvents.AttachToEvent(GamePhases.GameplayPhase.GameOver, ShowGameOverText); gameplayEvents.AttachToEvent(GamePhases.GameplayPhase.TruckStart, ReactionTruckStart); gameplayEvents.AttachToEvent(GamePhases.GameplayPhase.DeEvacuation, ReactionDeEvacuation); gameplayEvents.AttachToEvent(GamePhases.GameplayPhase.ManyMonthsLater, ReactionFewDaysLater); GameplayManager.GetGameplayManager().PointsCollectedUpdate += UpdatePointsOnItemAdd; }
public GameplayEvents() { eventDict = new Dictionary <GamePhases.GameplayPhase, Action <object> >(); AddAllEventsToDict(); events = this; }
void Start() { gamplayEvents = GameplayEvents.GetGameplayEvents(); }
private void Awake() { m_ui = FindObjectOfType <UiController>(); m_gameplayEvents = GameplayEvents.GetGameplayEvents(); m_gameplay = GameplayManager.GetGameplayManager(); }