예제 #1
0
        public void FixedUpdate()
        {
            if (CachedTimeOfDay != null && sun.intensity > 0.75f)
            {
                //its light outside, charge the battery!
                if (OverallCharge < MaxCharge)
                {
                    OverallCharge += Time.fixedDeltaTime * RechargeRate * 0.25f;
                    UIManager.Close <DeadBatteryMenu>();
                }
            }
            else
            {
                //its dark outside, dont charge!
                if (OverallCharge > 0)
                {
                    OverallCharge -= Time.fixedDeltaTime * 0.25f;
                }
                else
                {
                    UIManager.Open <DeadBatteryMenu>();
                }
            }

            if ((OverallCharge > MaxCharge * 0.001f && OverallCharge < MaxCharge * 0.1f) ||
                (OverallCharge > MaxCharge * 0.49f && OverallCharge < MaxCharge * 0.51f) ||
                (OverallCharge > MaxCharge * 0.89f && OverallCharge < MaxCharge * 0.91f))
            {
                UIManager.Open <ChargeTrackingMenu>();
            }
            else
            {
                UIManager.GetMenu <ChargeTrackingMenu>().Close();
            }
        }
예제 #2
0
        public override void Interact()
        {
            if (Interactible)
            {
                if (PlayerInventory.GetIngredientAmount(desiredObject) > 0)
                {
                    PlayerInventory.RemoveInventoryItem(desiredObject, 1);

                    foreach (GameObject go in objectsToDeactivate)
                    {
                        go.SetActive(false);
                    }

                    foreach (GameObject go in objectsToActivate)
                    {
                        go.SetActive(true);
                    }

                    silhouetteSeen.SetActive(false);
                    silhouetteInteractible.SetActive(false);

                    hasItem      = true;
                    interactible = false;
                }
                else
                {
                    StopAllCoroutines();
                    MessageMenu messageMenu = UIManager.Open <MessageMenu>();

                    messageMenu.SetText(string.Format(NEGATIVE_STRING, desiredObject.displayName), 1);

                    StartCoroutine(CloseMessage());
                }
            }
        }
예제 #3
0
 public void OpenCrafting(bool b = true)
 {
     if (b)
     {
         if (!IsActive)
         {
             Open();
         }
         CloseAll();
         UIManager.Open <Crafting>();
     }
 }
예제 #4
0
        public void OpenLogs(bool b = true)
        {
            if (b)
            {
                UIManager.Close <SystemMenu>();
                UIManager.Close <Inventory>();
                if (!IsActive)
                {
                    Open();
                }

                UIManager.Open <LogMenu>();
                Open();
            }
        }
예제 #5
0
 private void Transfer()
 {
     Close();
     UIManager.Open <Container>();
 }