using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class EventSystem : MonoBehaviour { public void EventID(int ID,float maxLenght,ref float lenght,ref float speed,ref float moveTime,ref float points,ref float pointsRatio) { var data = JsonTab.Instance.tables.Eventtype.Get(ID); switch (data.Eventtype) { case 9: lenght = maxLenght; break; case 1: speed += data.Event1; break; case 2: moveTime += data.Event1; break; case 3: points += data.Event1; break; case 4: var intSpeed0 = (float)speed * (((float)data.Event1) / 100); speed -= (int)intSpeed0; pointsRatio += data.Event2; break; case 5: var intSpeed1 = (float)speed * (((float)data.Event1) / 100); speed -= (int)intSpeed1; points += data.Event2; break; case 6: moveTime -= data.Event1; pointsRatio += data.Event2; break; case 7: moveTime -= data.Event1; points += data.Event2; break; } } }