// Start is called before the first frame update void Start() { CameraController = CameraUtils.FetchCameraController(); HighLightUi = Instantiate(highLightUiModel, this.transform.position, this.transform.rotation); HighLightUi.SetActive(false); currentTargetSelectionIndex = DEFAULT_SELECTION_INDEX; }
public void EnableSelection(Vector3 initialPosition, List <GameObject> targetSelectionList, Action <GameObject, GameObject> actionForSelection = null, GameObject actionUser = null) { HighLightUi.transform.position = initialPosition; TargetList = targetSelectionList; HighLightUi.SetActive(true); GameObject targetSelection = TargetList[currentTargetSelectionIndex]; CameraController.FocusOnPlayer(targetSelection.transform); IsActivated = true; if (actionForSelection != null) { this.actionSelection = actionForSelection; } if (actionUser != null) { this.actionUser = actionUser; } }
public void DisableSelection() { HighLightUi.SetActive(false); IsActivated = false; currentTargetSelectionIndex = DEFAULT_SELECTION_INDEX; }