WXGame/box1/Assets/Script/UI/EventSystem.cs

47 lines
1.4 KiB
C#
Raw Normal View History

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