using System.Collections; using System.Collections.Generic; using UnityEngine; using AX.MessageSystem; public class GuanChaShaoCtrl : BaseGCS_SSRYCtrl { private GameObject GuanChaDianSetWin; private int timecut;//观察哨切换观测点的时间间隔 private float time; private int MaxTime = 10;//最慢切换时,10秒切换一次 // Use this for initialization void Start () { GuanChaDianSetWin = GameObject.Find("Canvas").transform.Find("Gcs_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 = PosList[index]; 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("BANGDINGGCS", gameObject); } }