Muchas cosas

This commit is contained in:
Gerard Gascón 2023-02-27 20:45:11 +01:00
parent b4e11ac33f
commit 9c92dc678e
76 changed files with 15307 additions and 2021 deletions

View file

@ -7,6 +7,7 @@ using UnityEngine.Events;
[System.Serializable]
public enum OrbTypes {
None,
Blue,
Red,
InvertedControls,
@ -20,8 +21,9 @@ public enum OrbTypes {
public class GameManager : MonoBehaviour {
[SerializeField] GenericDictionary<OrbTypes, UnityEvent> orbEffects;
[SerializeField] OrbTypes currentType;
[SerializeField] GenericDictionary<OrbTypes, UnityEvent> orbStartEffects;
[SerializeField] GenericDictionary<OrbTypes, UnityEvent> orbEndEffects;
[SerializeField] OrbTypes currentType = OrbTypes.None;
// Start is called before the first frame update
void Start(){
@ -33,8 +35,16 @@ public class GameManager : MonoBehaviour {
}
[Space, SerializeField] OrbTypes forceEventChangeType = OrbTypes.None;
[ButtonMethod]
void ForceEventChange() {
if (!Application.isPlaying) return;
ChangeEventCall(forceEventChangeType);
}
void ChangeEventCall(OrbTypes type) {
if(currentType != OrbTypes.None) orbEndEffects[currentType].Invoke();
currentType = type;
orbEffects[currentType].Invoke();
if(type != OrbTypes.None) orbStartEffects[currentType].Invoke();
}
}