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.
59 lines
1.6 KiB
59 lines
1.6 KiB
3 years ago
|
using AX.MessageSystem;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class ShuSanRYCtrl : BaseGCS_SSRYCtrl {
|
||
|
|
||
|
private GameObject ShuSanDianSetWin;
|
||
|
|
||
|
private int timecut;//疏散人员切换疏散点的时间间隔
|
||
|
private float time;
|
||
|
private int MaxTime = 10;//最慢切换时,10秒切换一次
|
||
|
// Use this for initialization
|
||
|
void Start () {
|
||
|
ShuSanDianSetWin = GameObject.Find("Canvas").transform.Find("Ssry_UI").gameObject;
|
||
|
}
|
||
|
|
||
|
// Update is called once per frame
|
||
|
void Update () {
|
||
|
if (flag)
|
||
|
{
|
||
|
if (PosList.Count < 1)
|
||
|
return;
|
||
|
SetTimeCut(value);
|
||
|
|
||
|
time += Time.deltaTime;
|
||
|
if (time >= timecut)
|
||
|
{
|
||
|
time = 0.0f;
|
||
|
|
||
|
//transform.position = ShuSanDians[index];
|
||
|
//变动原因:因为模型中心点在腰上,不在脚底
|
||
|
transform.position = new Vector3(PosList[index].x, PosList[index].y + 1f, PosList[index].z);
|
||
|
|
||
|
if (index < PosList.Count - 1)
|
||
|
{
|
||
|
index++;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
index = 0;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private int SetTimeCut(int value)
|
||
|
{
|
||
|
timecut = MaxTime / value;
|
||
|
return timecut;
|
||
|
}
|
||
|
|
||
|
private void OnMouseDown()
|
||
|
{
|
||
|
//MessageDispatcher.SendMessage("OPEN", (object)GuanChaDianSetWin.name,"CUBE");
|
||
|
MessageDispatcher.SendMessage("BANGDINGSSRY", gameObject);
|
||
|
}
|
||
|
}
|