예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (fpsController.enabled)
        {
            EquipSystem equipSystem = GetComponent <EquipSystem>();
            if (CrossPlatformInputManager.GetButtonDown("Interact") && itemInView != null)
            {
                //Interacting with objects in the world
                itemInView.GetComponent <InteractableBase>().OnInteract();
            }
            else if (equipSystem && equipSystem.currentEquippedItem)
            {
                Pickupable pickupable = equipSystem.currentEquippedItem.GetComponent <Pickupable>();
                if (pickupable)
                {
                    //Using item that the player has equipped
                    if (CrossPlatformInputManager.GetButtonDown("Fire1"))
                    {
                        pickupable.OnUse();
                        UseItem?.Invoke(pickupable);
                    }
                    else if (CrossPlatformInputManager.GetButtonDown("DropItem"))
                    {
                        equipSystem.DropItem(pickupable.item);
                    }
                }
            }
        }

        if (CrossPlatformInputManager.GetButtonDown("Cancel"))
        {
            CancelAction?.Invoke();
        }
    }
예제 #2
0
        public static void Initialize()
        {
            Page = ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescription.WideSlimList);

            Page.AddLabel("Title", new Action <GameObject>((obj) => { titleObject = obj; }));
            Page.AddLabel("Waiting for key...", new Action <GameObject>((obj) => { textObject = obj; }));

            Page.AddSimpleButton("Clear", new Action(() =>
            {
                selectedKeys.Clear();
            }));

            Page.AddSimpleButton("Accept", new Action(() =>
            {
                AcceptAction?.Invoke(selectedKeys);
                fetchingKeys = false;
                Page.Hide();
            }));

            Page.AddSimpleButton("Cancel", new Action(() =>
            {
                CancelAction?.Invoke();
                fetchingKeys = false;
                Page.Hide();
            }));
        }
예제 #3
0
 private void Cancel()
 {
     StepViewModel.CancelAction?.Invoke();
     CancelAction?.Invoke();
 }
예제 #4
0
 /// <summary>
 /// 取消
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     CancelAction?.Invoke();
 }
예제 #5
0
 /// <summary>
 /// Cancels this instance.
 /// </summary>
 public void Cancel()
 {
     Close();
     CancelAction?.Invoke();
 }
예제 #6
0
 public void Cancel()
 {
     MainViewModel.HidePopup();
     CancelAction.Invoke();
 }
예제 #7
0
 private void Cancel()
 {
     CancelAction?.Invoke();
 }
예제 #8
0
 public void OnTransitionCancel(Transition p0)
 {
     CancelAction?.Invoke();
 }
예제 #9
0
 public void CancelClicked()
 {
     CancelAction?.Invoke();
 }