You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
2.0 KiB
55 lines
2.0 KiB
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using System; |
|
using AX.MessageSystem; |
|
using AX.TrackRecord; |
|
public class DetecteMoveFloor : MonoBehaviour { |
|
DateTime t1, t2; |
|
void Update() |
|
{ |
|
if (Input.GetMouseButtonDown(0)) |
|
{ |
|
t2 = DateTime.Now; |
|
|
|
if (t2 - t1 < new TimeSpan(0, 0, 0, 0, 400)) |
|
{ |
|
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); |
|
RaycastHit hitinfo; |
|
if (Physics.Raycast(ray, out hitinfo, Mathf.Infinity, LayerMask.GetMask("shineiFloor"))) |
|
{ |
|
if (hitinfo.collider.GetComponent<CengID>() == false) return; |
|
int cengId = hitinfo.collider.GetComponent<CengID>().cengID; |
|
|
|
if (UPAndDownAttack.Instance.cengList.Contains(cengId)) |
|
{ |
|
if (UPAndDownAttack.Instance.ChangFloorFlag == false) |
|
{ |
|
MessageDispatcher.SendMessage("MoveUpFloor", (object)cengId); |
|
|
|
if (RecordManager.Instance.IsRecording) |
|
{ |
|
Debug.Log("记录了MoveUpFloor"); |
|
TrackRecordHelpClass.RecordTriggerEvent("MoveUpFloor"+"-"+cengId); |
|
} |
|
|
|
} |
|
else |
|
{ |
|
MessageDispatcher.SendMessage("MoveDownFloor", (object)""); |
|
if (RecordManager.Instance.IsRecording) |
|
{ |
|
Debug.Log("记录了MoveDownFloor"); |
|
|
|
TrackRecordHelpClass.RecordTriggerEvent("MoveDownFloor"); |
|
} |
|
} |
|
|
|
UPAndDownAttack.Instance.ChangFloorFlag = !UPAndDownAttack.Instance.ChangFloorFlag; |
|
} |
|
} |
|
} |
|
t1 = t2; |
|
} |
|
} |
|
}
|
|
|