Example #1
0
 /// <summary>
 /// Initialize the notification system.
 /// Restores the notifications if a savegame is present.
 /// </summary>
 public void Awake()
 {
     time = GameTime.GameTime.Instance;
     if (GameSettings.NewGame)
     {
         Initialize();
     }
     else
     {
         LoadState();
     }
 }
Example #2
0
 public EmployeeFactory()
 {
     contentHub      = ContentHub.Instance;
     teamManager     = TeamManager.Instance;
     missionManager  = MissionManager.Instance;
     gameTime        = GameTime.GameTime.Instance;
     employeeManager = EmployeeManager.Instance;
     names           = contentHub.GetNameLists();
     skills          = contentHub.GetSkillSet().keys;
     allPurpSkillDef = ContentHub.Instance.GeneralPurposeSkill;
     empMaterial     = contentHub.DefaultEmpMaterial;
     empUiMaterial   = contentHub.DefaultEmpUiMaterial;
     InitColorSwapTex();
     spriteColors            = new Color[colorSwapTex.width];
     specialEmployeesToSpawn = new List <EmployeeDefinition>();
     EmployeeSpecials.AddRange(ModHolder.Instance.GetCustomSpecials());
 }
        public void SetUp()
        {
            EditorSceneManager.OpenScene("Assets/Scenes/MainGame.unity");
            manager = new NotificationManager();
            NetObjectEvent evt = new NetObjectEvent();

            act = Substitute.For <UnityAction <object> >();
            manager.NewNotification = evt;
            evt.AddListener(act);
            time = Substitute.ForPartsOf <GameTime.GameTime>();
            time.GetData().Returns(new GameTimeData()
            {
                Date = new GameDate()
                {
                    DateTime = new DateTime(1, 1, 1)
                }
            });
            manager.Initialize();
            manager.time = time;
        }