下面是代码。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RadarScanning : MonoBehaviour {
int speed = 3;
int count = 0;
GameObject P1;
GameObject P2;
GameObject P3;
GameObject P4;
// Use this for initialization
void Start () {
P1 = GameObject.Find("spot1");
P2 = GameObject.Find("spot2");
P3 = GameObject.Find("spot3");
P4 = GameObject.Find("spot4");
P1.SetActive(false);
P2.SetActive(false);
P3.SetActive(false);
P4.SetActive(false);
}
// Update is called once per frame
void Update () {
if (count == 5)
P1.SetActive(true);
if (count == 200)
P2.SetActive(true);
if (count == 500)
P3.SetActive(true);
if (count == 1000)
P4.SetActive(true);
count++;
gameObject.transform.Rotate(Vector3.back*speed);
}
}