コード例 #1
0
 public void DayTimeChange(DayEnums newDay, TimeEnums newTime)
 {
     this.transform.position = schedule[newDay][newTime].pos.position;
     AddToDayTimeChange(newDay, newTime);
     if (newTime == TimeEnums.Morning && doMajorConvos)
     {
         Invoke("CheckConversation", 0.5f);
     }
 }
コード例 #2
0
 public void ResetSavedVars()
 {
     FadeToBlack();
     DeleteSaveData();
     currentTime         = TimeEnums.Morning;
     currentDay          = DayEnums.Monday;
     daysTillPerformance = 14;
     daysSoFar           = 0;
     majorActionDone     = false;
     Invoke("FadeOutBlack", 1f);
 }
コード例 #3
0
 public virtual bool LoadSaveData()
 {
     if (File.Exists(Application.persistentDataPath + savefile))
     {
         BinaryFormatter format = new BinaryFormatter();
         FileStream      fs     = File.Open(Application.persistentDataPath + savefile, FileMode.Open);
         LifeSimSaveData save   = (LifeSimSaveData)format.Deserialize(fs);
         fs.Close();
         currentDay      = save.day;
         currentTime     = save.time;
         majorActionDone = save.majorActionDone;
         daysSoFar       = save.days;
         duoTutorial     = save.duoTutorial;
         Debug.Log("Game loaded");
         return(true);
     }
     return(false);
 }
コード例 #4
0
 private void Awake()
 {
     if (instance == null)
     {
         instance         = this;
         interactableDict = new Dictionary <Transform, IInteractable>();
         buttonDict       = new Dictionary <Transform, IButton>();
     }
     else
     {
         Destroy(this.gameObject);
     }
     if (!LoadSaveData())
     {
         currentDay      = DayEnums.Monday;
         currentTime     = TimeEnums.Morning;
         majorActionDone = false;
         daysSoFar       = 1;
     }
     dayTimeChangeListeners = new List <IDayTimeChangeListener>();
 }
コード例 #5
0
 public abstract void AddToDayTimeChange(DayEnums newDay, TimeEnums newTime);
コード例 #6
0
    public void IncrementDay()
    {
        FadeToBlack();
        switch (currentDay)
        {
        case DayEnums.Monday:
            currentDay = DayEnums.Tuesday;
            break;

        case DayEnums.Tuesday:
            currentDay = DayEnums.Wednesday;
            break;

        case DayEnums.Wednesday:
            currentDay = DayEnums.Thursday;
            break;

        case DayEnums.Thursday:
            currentDay = DayEnums.Friday;
            break;

        case DayEnums.Friday:
            currentDay = DayEnums.Saturday;
            break;

        case DayEnums.Saturday:
            currentDay = DayEnums.Sunday;
            break;

        case DayEnums.Sunday:
            currentDay = DayEnums.Monday;
            break;
        }
        currentTime     = TimeEnums.Morning;
        majorActionDone = false;
        daysSoFar++;
        if (daysTillPerformance == 0)
        {
            daysTillPerformance = 1;
        }
        dayCountdown.text = "Days until performance: " + (daysTillPerformance - (daysSoFar % daysTillPerformance));
        if (daysSoFar % daysTillPerformance == 0)
        {
            gradedPerformance = true;
            if (playerAvatar.GetComponent <PlayerManager>().trustDonna >= targetTrustLevel)
            {
                duoTrapeze = true;
            }
            foreach (IDayTimeChangeListener listener in dayTimeChangeListeners)
            {
                listener.PerformanceDay();
            }
        }
        else
        {
            foreach (IDayTimeChangeListener listener in dayTimeChangeListeners)
            {
                listener.DayTimeChange(currentDay, currentTime);
            }
        }
        TextboxManager.GetInstance().UpdateDateTime();

        Invoke("FadeOutBlack", 0.5f);
    }
コード例 #7
0
 public override void AddToDayTimeChange(DayEnums newDay, TimeEnums newTime)
 {
     yarnVars.SetValue("$DonnaInvitable", schedule[newDay][newTime].invitable);
 }