void UpdateShooting() { if (GameManager.isPaused) { return; } if (ActionsInterface.GetActionDown(shootAction)) { if (hitActor != null) { hitActor.AddModifiers(damageModifiers, "Shoot", true, GameManager.playerActor.gameObject, hitActor.gameObject); GameValue npcHealth = hitActor.GetGameValueObject(healthBarGameValueName); if (npcHealth.GetValueComponent(GameValue.GameValueComponent.BaseValue) <= 0) { npcHealth.ReInitialize(); GameManager.playerActor.AddModifiers(onKillModifiers, "On Kill", true, hitActor.gameObject, GameManager.playerActor.gameObject); } } clip--; if (clip <= 0) { clip = maxClip; ammo -= maxClip; ammoHud.allTexts[1].SetText("| " + ammo.ToString()); } ammoHud.allTexts[0].SetText(clip.ToString() + " "); } }
void Update() { UpdateWeaponsDemo(); UpdateShooting(); UpdateInteractableHint(); UpdateScope(); UpdateAwarenessUI(); if (ActionsInterface.GetActionDown(mainMenuAction, false, -1, true)) { // if (UIManager.instance.mainMenu.isOpen) { // UIManager.instance.mainMenu.CloseMenu(); // } // else { // UIManager.instance.mainMenu.OpenMenu(null); // } ManualMenu.mainMenu.ToggleMenu(null); } if (ActionsInterface.GetActionDown(quickInventoryAction, false, -1, true)) { ManualMenu.ToggleMenu(quickInventoryMenuName, new Actor[] { GameManager.playerActor }); } }
public static void MarkActionsOccupied(List <int> actions) { for (int i = 0; i < actions.Count; i++) { ActionsInterface.MarkActionOccupied(actions[i], usingController); } }
public static void MarkActionsUnoccupied(List <int> actions) { for (int i = 0; i < actions.Count; i++) { ActionsInterface.MarkActionUnoccupied(actions[i]); } }
public static Vector2Int GetUIActions(List <int> actions) { bool usesAnyController = usingController < 0; for (int i = 0; i < actions.Count; i++) { int action = actions[i]; if (usesAnyController) { for (int controller = 0; controller < ActionsInterface.maxControllers; controller++) { if (ActionsInterface.GetActionDown(action, false, controller, false)) { Debug.Log("GOT ACTION " + action); return(new Vector2Int(action, controller)); } } } else { if (ActionsInterface.GetActionDown(action, false, usingController, false)) { return(new Vector2Int(action, usingController)); } } } return(new Vector2Int(-1, usingController)); }
public static void LinkActionCallback(Object stateInfo) { Message m = (Message)stateInfo; ConnectionHelper ch = Program.toMihf; ushort transactionID = m.MIHHeader.TransactionID; Payload.TLVIterator it = m.Payload.GetTLVIterator(); ID srcID = new ID(new OctetString(it.Next().Value)); ID dstID = new ID(new OctetString(it.Next().Value)); Link_Action_Request lar = new Link_Action_Request(MIHDeserializer.DeserializeLinkAction(it.Next()), MIHDeserializer.DeserializeTimeInterval(it.Next()), MIHDeserializer.DeserializePoA(it.Next())); Link_Action_Response laresp = new Link_Action_Response(); laresp.Status = STATUS.UNSPECIFIED_FAILURE; laresp.Result = Link_Ac_Result.INCAPABLE; NativeWifi.WlanClient.WlanInterface iface = null; try { iface = Information.GenericInfo.WlanInterfaceInstance; } catch (Exception e) { /*nothing*/ } switch (lar.LinkAction.LinkAcType) { case Link_Ac_Type.LINK_DISCONNECT: ActionsInterface.Action_Disconnect(ref laresp, ref iface); break; case Link_Ac_Type.NONE: Console.WriteLine("No action performed."); laresp.Status = STATUS.SUCCESS; laresp.Result = Link_Ac_Result.SUCCESS; break; case Link_Ac_Type.LINK_POWER_DOWN: ActionsInterface.Action_Power_Down(ref laresp, ref iface); break; case Link_Ac_Type.LINK_POWER_UP: ActionsInterface.Action_Power_Up(ref laresp, ref iface); break; default: throw new InvalidOperationException("Unsupported Operation"); } laresp.ScanResults = new List <Link_Scan_Rsp>(); if (lar.LinkAction.LinkAcAttr.Link_Scan) { ActionsInterface.Action_Scan(laresp, iface, m);//Message is sent inside this branch, after the scan is complete. } else { ch.Send(ResponseBuilders.Link_Action_Response_Builder(srcID, dstID, transactionID, laresp).ByteValue); } }
public static void MarkAllSelectionAxesUnoccupied() { for (int i = 0; i < settings.horizontalAxes.Length; i++) { ActionsInterface.MarkAxisUnoccupied(settings.horizontalAxes[i]); } for (int i = 0; i < settings.verticalAxes.Length; i++) { ActionsInterface.MarkAxisUnoccupied(settings.verticalAxes[i]); } }
void Update() { // rayHitPoint = referenceTransform.position; if (findInteractables) { FindInteractables(); } else { SetInteractable(null); // hoverLocked = false; usingRay = false; } if (interactable != null) { interactable.OnInspectedUpdate(this, baseInteractor.interactionMode); if (onInspectUpdate != null) { onInspectUpdate(this, interactable); } if (interactable.useType != Interactable.UseType.Scripted) { for (int i = 0; i < currentActionOptions.Count; i++) { int action = currentActionOptions[i]; if (ActionsInterface.GetActionDown(action, controller: associatedController)) { interactable.BroadcastActionChange(this, baseInteractor.interactionMode, action, StateChange.Start); } if (ActionsInterface.GetAction(action, controller: associatedController)) { interactable.BroadcastActionChange(this, baseInteractor.interactionMode, action, StateChange.Update); } if (ActionsInterface.GetActionUp(action, controller: associatedController)) { interactable.BroadcastActionChange(this, baseInteractor.interactionMode, action, StateChange.End); } } } } }
void UpdateScope() { if (GameManager.isPaused) { return; } if (ActionsInterface.GetActionDown(scopeAction)) { UIManager.ShowScopeOverlay(scopeSprites.GetRandom(null), .1f); UIManager.EnableCrosshair(-1); } if (ActionsInterface.GetActionUp(scopeAction)) { // Debug.Log("DISABLING"); UIManager.DisableScopeOverlay(.1f); UIManager.EnableCrosshair(Random.Range(0, maxCrosshairs)); } }
public static void MarkAllBaseUIInputsUnoccupied() { MarkAllSelectionAxesUnoccupied(); ActionsInterface.MarkActionUnoccupied(settings.cancelAction); }
public static void MarkAllBaseUIInputsOccupied() { MarkAllSelectionAxesOccupied(); ActionsInterface.MarkActionOccupied(settings.cancelAction, usingController); }
public static float GetAxis(int axisIndex) { return(ActionsInterface.GetAxis(axisIndex, usingController, false)); }
public static bool GetAction(int action, bool checkingAxis) { return(ActionsInterface.GetAction(action, checkingAxis, usingController, false)); }
public static bool GetMouseButton(int button) { return(ActionsInterface.GetMouseButton(button, usingController, false)); }