public void AssignActionToMainControllerPrompt(string action, string commandText) { if (mainPrompt != null) { DisableMainControllerPrompt(); } mainPrompt = UserInterface.Instance.InstantiatePrefab(controllerPromptPrefab, overlay: true).GetComponent <ControllerPrompt>(); mainPrompt.AtomicActions = PlayerActionsMap.GetAtomicActions(action); mainPrompt.CompositeActionText = commandText; PositionMainControllerPrompt(); }
public void OnEnterEvent(EntityState playerState) { string[] availableActions = FilterKnownAvailableActions( playerState.GetAvailableActions(), KnownActions); //TODO add crosses to previous actions if length == 0 if (availableActions.Length > 0) { controllerPromptPool.DestroyAllObjects(); activePrompts = new ControllerPrompt[availableActions.Length]; for (int i = 0; i < availableActions.Length; i++) { activePrompts[i] = controllerPromptPool.NewObject().GetComponent <ControllerPrompt>(); activePrompts[i].GetComponent <RectTransform>().localScale = sidePromptScaleMultiplier * Vector3.one; activePrompts[i].transform.SetParent(UserInterface.Instance.Get(UIElemType.CONTROLLER_PROMPT_PANEL).transform); activePrompts[i].AtomicActions = PlayerActionsMap.GetAtomicActions(availableActions[i]); activePrompts[i].CompositeActionText = availableActions[i]; } } }