Exemplo n.º 1
0
        public HoursController(ServiceHoursDbContext context, UserManager <User> userManager, SignInManager <User> signInManager)
        {
            this.context       = context;
            this.userManager   = userManager;
            this.signInManager = signInManager;
            hoursManager       = new HoursManager(context, userManager, signInManager);

            int currentSchoolYear = HoursManager.CurrentSchoolYear;

            quarters = new List <DateTime>
            {
                new DateTime(currentSchoolYear, 6, 7),
                new DateTime(currentSchoolYear, 11, 1),
                new DateTime(currentSchoolYear + 1, 1, 18),
                new DateTime(currentSchoolYear + 1, 3, 28),
                new DateTime(currentSchoolYear + 1, 6, 7)
            };
        }
Exemplo n.º 2
0
    // Use this for initialization
    void Awake()
    {
        plr = GetComponentInChildren<Player>();
        plr.Setup(this);

        TUNING = Resources.Load("Scripts/Tuning") as DTTuning;

        Hours = gameObject.AddComponent<HoursManager>();
        Hours.Setup(this);

        remainingDay = TUNING.DaysComingBeforeSaveDay;

        pathDirector = GetComponentInChildren<WaypointDirector>();
        pathDirector.Setup(this);

        Dracu = GetComponentInChildren<Dracula>();
        Dracu.Setup(this);

        Diff = DifficultyState.BeforeLetter;

        PaperSpots = new List<GameObject>();
        GameObject pSpot = FETool.findWithinChildren(gameObject, "Spots/PaperSpot");
        Spot[] papSpot = pSpot.GetComponentsInChildren<Spot>();
        foreach (Spot obj in papSpot)
        {
            obj.spotType = Spot.spotList.Paper;
            PaperSpots.Add(obj.gameObject);
        }

        FoodSpots = new List<GameObject>();
        GameObject fSpot = FETool.findWithinChildren(gameObject, "Spots/FoodSpot");
        Spot[] fooSpot = fSpot.GetComponentsInChildren<Spot>();
        foreach (Spot obj in fooSpot)
        {
            obj.spotType = Spot.spotList.Food;
            FoodSpots.Add(obj.gameObject);
        }

        //		respawnPaper(PaperSpots);
        spawnFood(FoodSpots);
        saveDay = 1000;

        MailmanState = MailManStateList.Away;
        currCam = FETool.findWithinChildren(gameObject, "Camera").GetComponent<Camera>();
        GameUI = currCam.GetComponentInChildren<UI>();
        GameUI.Setup(this);

        GetComponentInChildren<MailManPlace>().Setup(this);
        bedList = GetComponentsInChildren<Bed>();

        Door[] Doors = GetComponentsInChildren<Door>();
        foreach (Door _dr in Doors)
        {
            _dr.Setup(this);
        }

        Waypoint[] Waypo = GetComponentsInChildren<Waypoint>();
        foreach (Waypoint _wp in Waypo)
        {
            wpList.Add(_wp);
        }

        GameEventManager.GameOver += GameOver;
        GameEventManager.Respawn += Respawn;
        GameEventManager.GameStart += GameStart;
        GameEventManager.EndGame += EndGame;

        MasterAudio.PlaySound("ambiance");

        //				GAMESTATE = GameEventManager.GameState.MainMenu;
        //				GameEventManager.TriggerRespawn("Rsp");
        GAMESTATE = GameEventManager.GameState.Live;
        GameEventManager.TriggerGameStart("First Init");
    }
Exemplo n.º 3
0
    public void triggerDayEvent(HoursManager.DayEventList _evt)
    {
        if (LevelManager.GAMESTATE == GameEventManager.GameState.Live)
        {
            switch (_evt)
            {
            case HoursManager.DayEventList.DraculaEntering :
            {
                GameUI.WillBackTxt.makeFadeOut();
                GameUI.discoverCharacter(PopUp.CharList.Dracula);
                MasterAudio.PlaySound("dracula_back");
                GameUI.NotifPop.giveInfos("Dracula is back\n from hunting");
                GameUI.dialogPop.giveInfos("Your blood look so tasty,\n come to me Johnathan.", PopUp.CharList.Dracula);
                new OTTween(GameUI.dialogPop.OutPic, 1f).Tween("alpha", 0f);
                break;
            }
            case HoursManager.DayEventList.DraculaLeaving :
            {
                GameUI.discoverCharacter(PopUp.CharList.Dracula);
                InvokeRepeating("laughPlz", 20f, 60f);
                GameUI.WillBackTxt.makeFadeIn();
                MasterAudio.PlaySound("dacrula_out");
                GameUI.NotifPop.giveInfos("Dracula has left \n the house");
                GameUI.dialogPop.giveInfos("I need some fresh blood...\n but I will be back. !", PopUp.CharList.Dracula);
                new OTTween(GameUI.dialogPop.OutPic, 1f).Tween("alpha", 1f);
                break;
            }
            case HoursManager.DayEventList.FoodMan :
            {
                resplenishFoods();
                GameUI.discoverCharacter(PopUp.CharList.Dracula);
                MasterAudio.PlaySound("eating_bell");
                GameUI.NotifPop.giveInfos("The Carrier has\n resplenished \nfood stocks");
                GameUI.dialogPop.giveInfos("I can now eat in the house's kitchens.\n If I don't eat, I'll die.", PopUp.CharList.Johnathan);
                break;
            }
            case HoursManager.DayEventList.MailManIn :
            {
                plr.displayBubbleInfo("think_post");
                MailmanState = MailManStateList.HasArrived;
                MasterAudio.PlaySound("door_bell");
                GameUI.discoverCharacter(PopUp.CharList.MailMan);
                GameUI.dialogPop.giveInfos("*Knock Knock*\n Hey it's the mail man.\n Is anybody here ?", PopUp.CharList.MailMan);
                GameUI.NotifPop.giveInfos("The mail man\n has arrived");
                break;
            }
            case HoursManager.DayEventList.MailManOut :
            {
                MailmanState = MailManStateList.Away;
                GameUI.discoverCharacter(PopUp.CharList.Dracula);
                GameUI.dialogPop.giveInfos("The mail man is gone now.\n I need to wait the next day for him.", PopUp.CharList.Johnathan);
                GameUI.NotifPop.giveInfos("The mail man\n is leaving");
                break;
            }
            case HoursManager.DayEventList.LetterSent :
            {
                Diff = DifficultyState.WaitingSave;
                saveDay = currD + TUNING.DaysComingBeforeSaveDay;
                GameUI.discoverCharacter(PopUp.CharList.Dracula);
                GameUI.Paper.frameName = "paper_sent";
                MailmanState = MailManStateList.Away;
                plr.haveLetter = Player.letterList.Sent;
                GameUI.dialogPop.giveInfos("I've asked Mina for some rescue \n against Dracula. I think they'll\n arrive within" + (saveDay - currD)  + " days.", PopUp.CharList.Johnathan);
                GameUI.NotifPop.giveInfos("The mail man\n is leaving\n with the letter");
                InvokeRepeating("recallObjective", 30f, 30f);
                break;
            }

            }
        }
    }
Exemplo n.º 4
0
 public void testLights(HoursManager.DayTime _time)
 {
     switch (_time)
     {
         case HoursManager.DayTime.Day :
         {
             InvokeRepeating("laughPlz", 20f, 20f);
             Hours.currentTime = HoursManager.DayTime.Day;
             GameObject[] objLights = GameObject.FindGameObjectsWithTag("Lights");
             foreach (GameObject obj in objLights)
             {
                 obj.GetComponent<Light>().color = new Color(217f, 242f, 255f);
             }
             break;
         }
         case HoursManager.DayTime.Night :
         {
             CancelInvoke("laughPlz");
             Hours.currentTime = HoursManager.DayTime.Night;
             GameObject[] objLights = GameObject.FindGameObjectsWithTag("Lights");
             foreach (GameObject obj in objLights)
             {
                 obj.GetComponent<Light>().color = new Color(40f, 44f, 121f);
             }
             break;
         }
     }
 }