Ejemplo n.º 1
0
 public void OnInventoryHotkey(InputValue value)
 {
     if (!GameManager.isPaused)
     {
         InventoryPrefab.SetActive(true);
         GameManager.Pause();
     }
 }
Ejemplo n.º 2
0
    public void OnRepairScreenHotkey(InputAction.CallbackContext context)
    {
        if (LastPressedTime + AntiSpamDelay > Time.unscaledTime)
        {
            return;                                                      //anti spam
        }
        LastPressedTime = Time.unscaledTime;

        //Debug.LogError("Pressed");
        if (canOpen && !GameManager.isPaused)
        {
            RepairableComponent satComponent = currentSat.GetComponentInParent <RepairableComponent>();
            //Debug.LogWarning("Can Open");
            //EVAN - menu open sound
            if (satComponent != null)
            {
                StationRepairScreen.OpenScreen(satComponent);
                GameManager.Pause();
                Debug.Log("Paused");
            }
            else
            {
                var repairedComponent = currentSat.GetComponentInParent <RepairedInfo>();
                if (repairedComponent != null)
                {
                    StationRepairScreen.OpenScreen(repairedComponent.GetRepairedComponent());;
                }
                else
                {
                    Debug.LogError("Did not find Repairable Component on passed collision");
                }
            }
        }
    }
Ejemplo n.º 3
0
    public void OnCraftHotkey(InputAction.CallbackContext context)
    {
        if (LastPressedTime + AntiSpamDelay > Time.unscaledTime)
        {
            return;                                                     //anti spam
        }
        LastPressedTime = Time.unscaledTime;
        Collider target;

        canCraft = Player.StationInRange(out target);

        if (canCraft == false || GameManager.isPaused)
        {
            return;
        }
        else
        {
            ResourceInventory foundComp = null;
            if (foundComp == null)
            {
                foundComp = target.GetComponent <ResourceInventory>();
            }
            if (foundComp == null)
            {
                foundComp = target.GetComponentInParent <ResourceInventory>();
            }
            if (foundComp == null)
            {
                foundComp = target.GetComponentInChildren <ResourceInventory>();
            }
            Debug.Log(foundComp);
            //EVAN - craft menu open sound
            Player.GetComponent <InventoryController>().OffloadSalvage(foundComp);
            CraftingPrefab.GetComponent <ShipStorageHUD>().SetStorageOwner(foundComp);
            CraftingPrefab.GetComponent <Crafting>().SetShipInventory(foundComp);
            CraftingPrefab.gameObject.SetActive(true);
            GameManager.Pause();
            Debug.Log("Paused");
        }
    }
Ejemplo n.º 4
0
 public void OnEsc(InputValue value)
 {
     Time.timeScale = 1;
     pauseScreen.gameObject.SetActive(true);
     GameManager.Pause();
 }