WXGame/box1/Assets/Script/UI/EventSystem.cs
2024-12-21 14:11:17 +08:00

52 lines
1.6 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using TTSDK;
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;
TT.ReportAnalytics<string>("a10129");
DotData.ins.SendEvent("a10129","");
break;
case 1:
speed += data.Event1;
break;
case 2:
moveTime += data.Event1;
TT.ReportAnalytics<string>("a10130");
DotData.ins.SendEvent("a10130","");
break;
case 3:
pointsRatio += 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;
}
}
}