Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Created By NPSF3000 270711
- // Not intended for general consumption.
- // Use at OWN Risk.
- using UnityEngine;
- using System.Collections;
- public class GO_Blink : MonoBehaviour
- {
- public GameObject go;
- public float onLength = 5;
- public float offLength = 5;
- public float offset = 0;
- // Use this for initialization
- void Start () {
- if (go == null)
- Debug.LogWarning("GO_Blink needs a GO assinged");
- else
- StartCoroutine(Blink());
- }
- IEnumerator Blink()
- {
- yield return new WaitForSeconds(offset);
- while (true)
- {
- yield return new WaitForSeconds(onLength);
- go.active = false;
- yield return new WaitForSeconds(offLength);
- go.active = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement