单人骑行
This commit is contained in:
1 parent
326b74bd03
commit
971a6f7e0e
2597 files changed
+427802
-4
No files matched your search
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class BlinkLight : MonoBehaviour {
|
||||
|
||||
float blinkDuration = 2.0f;
|
||||
void Start () {
|
||||
StartCoroutine(BlinkLed());
|
||||
}
|
||||
|
||||
private IEnumerator BlinkLed()
|
||||
{
|
||||
Component halo = gameObject.GetComponent("Halo");
|
||||
while(true)
|
||||
{
|
||||
((Behaviour)halo).enabled = !((Behaviour)halo).enabled;
|
||||
yield return new WaitForSeconds(blinkDuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user