No me acuerdo
This commit is contained in:
parent
aabe5457e2
commit
9ecec372ce
143 changed files with 21409 additions and 2042 deletions
|
@ -1,22 +1,23 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using GometGames.Tools;
|
||||
using MyBox;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
[System.Serializable]
|
||||
public enum OrbTypes {
|
||||
None,
|
||||
Blue,
|
||||
Red,
|
||||
Purple,
|
||||
InvertedControls,
|
||||
HighGravity,
|
||||
LowGravity,
|
||||
InvertedGravity,
|
||||
DarkRoom,
|
||||
HighSpeed,
|
||||
LowSpeed
|
||||
Freeze
|
||||
};
|
||||
|
||||
public class GameManager : MonoBehaviour {
|
||||
|
@ -24,15 +25,25 @@ public class GameManager : MonoBehaviour {
|
|||
[SerializeField] GenericDictionary<OrbTypes, UnityEvent> orbStartEffects;
|
||||
[SerializeField] GenericDictionary<OrbTypes, UnityEvent> orbEndEffects;
|
||||
[SerializeField] OrbTypes currentType = OrbTypes.None;
|
||||
OrbTypes _lastType = OrbTypes.None;
|
||||
|
||||
public static GameManager instance;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
|
||||
void Awake() {
|
||||
instance = this;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
public OrbTypes SelectRandomEffect() {
|
||||
OrbTypes selected;
|
||||
Array values = Enum.GetValues(typeof(OrbTypes));
|
||||
do {
|
||||
selected = (OrbTypes)values.GetValue(Random.Range(1, values.Length));
|
||||
} while (selected == currentType || selected == _lastType);
|
||||
|
||||
Debug.Log(selected);
|
||||
ChangeEventCall(selected);
|
||||
return selected;
|
||||
}
|
||||
|
||||
[Space, SerializeField] OrbTypes forceEventChangeType = OrbTypes.None;
|
||||
|
@ -44,6 +55,7 @@ public class GameManager : MonoBehaviour {
|
|||
|
||||
void ChangeEventCall(OrbTypes type) {
|
||||
if(currentType != OrbTypes.None) orbEndEffects[currentType].Invoke();
|
||||
_lastType = currentType;
|
||||
currentType = type;
|
||||
if(type != OrbTypes.None) orbStartEffects[currentType].Invoke();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue