public void OnDisable()
 {
     Instances.Remove(this);
     SetCookingPot(null);
     if (displayText != null)
     {
         displayText.HideDisplayTexts();
     }
 }
Example #2
0
        public void Update()
        {
            Int32 unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;

            if (unixTimestamp < stopShowTextOn)
            {
                textManager.ShowText(textToShow);
                textShown = true;
            }
            else if (textShown)
            {
                textShown = false;
                textManager.HideDisplayTexts();
            }
            if (GameManager.GameMode != GameMode.None)
            {
                if (Input.GetKeyDown(KeyCode.B))
                {
                    GameManager.UseCheats = !GameManager.UseCheats;
                    stopShowTextOn        = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds + 5;
                    if (GameManager.UseCheats)
                    {
                        textToShow = "Cheatmode enabled";
                    }
                    else
                    {
                        textToShow = "Cheatmode disabled";
                    }

                    GameManager gm    = FindObjectOfType <GameManager>();
                    Cheat       cheat = gm.GetPrivateField <Cheat>("cheat");

                    if (!cheatsInited)
                    {
                        cheat.Initialize();
                        cheatsInited = true;
                    }

                    //if(cheatsActivated)
                    //{
                    //    GameManager.UseCheats = true;
                    //    cheatsActivated = false;
                    //}
                    //else
                    //{
                    //    GameManager.UseCheats = true;
                    //    cheatsActivated = true;
                    //}
                }
            }
        }