Exemple #1
0
        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;
        }
Exemple #2
0
        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;
        }
Exemple #3
0
 public GameplayEvents()
 {
     eventDict = new Dictionary <GamePhases.GameplayPhase, Action <object> >();
     AddAllEventsToDict();
     events = this;
 }
Exemple #4
0
 void Start()
 {
     gamplayEvents = GameplayEvents.GetGameplayEvents();
 }
Exemple #5
0
 private void Awake()
 {
     m_ui             = FindObjectOfType <UiController>();
     m_gameplayEvents = GameplayEvents.GetGameplayEvents();
     m_gameplay       = GameplayManager.GetGameplayManager();
 }