예제 #1
0
 private void Awake()
 {
     if (m_instance != null && m_instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         m_instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
 }
예제 #2
0
    //--- Unity Methods ---//
    private void Awake()
    {
        // Pull the capacity from the player prefs if this is a chat room
        if (m_roomName >= Room_Name.Chat_1 && m_roomName <= Room_Name.Chat_5)
        {
            // Grab the capacity from the persistence manager
            int roomIdx = m_roomName - Room_Name.Chat_1;
            Persistence_Manager persistence = GameObject.FindObjectOfType <Persistence_Manager>();
            m_maxCapacity = persistence.m_chatRoomSizes[roomIdx];

            // Enable the room if the capacity is 2 or more
            m_isActive = m_maxCapacity >= 2;
        }
    }
예제 #3
0
    //--- Unity Methods ---//
    private void Awake()
    {
        // Init the private variables
        m_persistence  = GameObject.FindObjectOfType <Persistence_Manager>();
        m_selectedRoom = -1;
        m_roomObjs     = new List <Room>();
        foreach (var roomUI in m_roomUIObjs)
        {
            m_roomObjs.Add(roomUI.RoomRef);
        }

        // Set the day and money texts
        m_dayText.text   = "Day " + (m_persistence.m_dayNumber + 1);
        m_moneyText.text = "$" + m_persistence.m_totalMoney;
    }
예제 #4
0
    //--- Unity Methods ---//
    private void Awake()
    {
        // Init the private variables
        m_roomManager  = GameObject.FindObjectOfType <Room_Manager>();
        m_callLogUI    = GameObject.FindObjectOfType <CallerLog_UIManager>();
        m_callList     = new List <Call_Group>();
        totalCash      = GameObject.Find("Txt_Money").GetComponent <TextMeshProUGUI>();
        audioManager   = GameObject.Find("AudioManager").GetComponent <Audio_Manager>();
        persistManager = GameObject.Find("PersistenceManager").GetComponent <Persistence_Manager>();
        m_active       = false;

        // Sample the difficulty curve to determine how quickly calls should spawn throughout this day
        Persistence_Manager persistence = GameObject.FindObjectOfType <Persistence_Manager>();
        Day_Manager         dayManager  = GameObject.FindObjectOfType <Day_Manager>();
        float percentThroughWeek        = (float)persistence.m_dayNumber / (float)(dayManager.maxDayCounter - 1);

        m_timeBetweenCalls  = m_timeBetweenCallsCurve.Evaluate(percentThroughWeek);
        m_timeSinceLastCall = m_timeBetweenCalls;
        Debug.Log("Time Between Calls: " + m_timeBetweenCalls);
    }
    // Start is called before the first frame update
    void Start()
    {
        PManager   = GameObject.Find("PersistenceManager").GetComponent <Persistence_Manager>();
        totalMoney = PManager.m_totalMoney; // make sure to link up with Persistence Manager;

        //get the number of calls missed from the Persistence Manager
        callMissed = PManager.callsMissed;

        //get the total costumer satisfaction from persistence manager
        customerSat = PManager.GetGameSatisfaction();

        //stores the final text to be displayed
        Finaltext = " ";

        if (callMissed <= 5 && customerSat >= 70.0f)
        {
            operatorEVA       = "Fair";
            operatorFinalStat = "Come Back Tommorrow \n You are \nNOT FIRED";
        }
        else if (callMissed <= 10 && customerSat >= 50.0f)
        {
            operatorEVA       = "Average";
            operatorFinalStat = "Come Back Tommorrow \n You are \nALMOST FIRED";
        }
        else
        {
            operatorEVA       = "BAD";
            operatorFinalStat = "Please Pack Your Desk\n You are \nFIRED";
        }


        //compose final text
        Finaltext = "WEEKLY SUMMARY \n ------------------------------ \n Revenue: $" + totalMoney +
                    " \n\n Missed Call Requests: " + callMissed + " \n\n Customer Satisfaction: " + customerSat + "% \n\n ------------------------------ \n Operator Evaluation: \n" +
                    operatorEVA + "\n\n" + operatorFinalStat +
                    "\n\n Press Space to Return to Main Menu."
        ;

        //start coroutine for displaying final text one letter at a time
        StartCoroutine(TypeText());
    }
 // Start is called before the first frame update
 private void Awake()
 {
     persistence  = GameObject.FindObjectOfType <Persistence_Manager>();
     dayCounter   = persistence.m_dayNumber;
     audioManager = GameObject.Find("AudioManager").GetComponent <Audio_Manager>();
 }
예제 #7
0
 // Start is called before the first frame update
 private void Awake()
 {
     persistence = GameObject.FindObjectOfType <Persistence_Manager>();
     totalCash   = persistence.m_totalMoney;
 }