In Game Input Screen

Implemented saving/loading of custom input settings
Incorporated Input Screen in game
Organized UI scripts into folders
Deleted some unused UI scripts
Reimplemented Fog Blur (by copying modified DoF to assets)
This commit is contained in:
Reinier Vens 2021-05-08 07:35:16 +01:00
commit 81acaf2a47
173 changed files with 8236 additions and 7329 deletions

View file

@ -0,0 +1,63 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Ink.Runtime;
using TMPro;
using UniRx;
using UniRx.Triggers;
using UnityEngine;
public class LocalMenu : MonoBehaviour
{
public ObservablePointerClickTrigger ContinueTrigger;
public TextMeshProUGUI Output;
public RectTransform ChoiceParent;
public ChoicePrefab ChoicePrefab;
private Story _currentStory;
private List<GameObject> _choiceInstances = new List<GameObject>();
private void OnEnable()
{
_currentStory = ActionGameManager.Instance.GetStories.First();
Continue();
}
void Start()
{
ContinueTrigger.OnPointerClickAsObservable().Subscribe(pointerEvent =>
{
if (_currentStory == null) return;
if(_currentStory.canContinue) Continue();
});
}
void Continue()
{
Output.text = _currentStory.Continue();
foreach(var instance in _choiceInstances)
Destroy(instance);
_choiceInstances.Clear();
foreach (var choice in _currentStory.currentChoices)
{
var choiceInstance = Instantiate(ChoicePrefab, ChoiceParent);
choiceInstance.Label.text = choice.text;
choiceInstance.Button.onClick.AddListener(() =>
{
_currentStory.ChoosePath(choice.targetPath);
Continue();
});
_choiceInstances.Add(choiceInstance.gameObject);
}
}
// Update is called once per frame
void Update()
{
}
}