using UnityEngine;
using System.Collections;
public class colliderCnt : MonoBehaviour {
// Use this for initialization
Collider[] collider;
void Start () {
collider = GetComponents<Collider >();
//Debug.Log (collider.Length);
Debug.Log (transform.childCount);
//Invoke ("f");
//Debug.Log ("One");
StartCoroutine ("f");
Destroy (gameObject,8);
//Destroy (gameObject);
//GetComponent<colliderCnt> ().enabled = false;
}
IEnumerator f()
{
//Debug.Log ("Two");
while (true) {
yield return new WaitForSeconds(2);
Debug.Log("On");
f ();
//StartCoroutine(f());// create a new coroutine !!
}
}
// Update is called once per frame
void Update () {
}
}
using System.Collections;
public class colliderCnt : MonoBehaviour {
// Use this for initialization
Collider[] collider;
void Start () {
collider = GetComponents<Collider >();
//Debug.Log (collider.Length);
Debug.Log (transform.childCount);
//Invoke ("f");
//Debug.Log ("One");
StartCoroutine ("f");
Destroy (gameObject,8);
//Destroy (gameObject);
//GetComponent<colliderCnt> ().enabled = false;
}
IEnumerator f()
{
//Debug.Log ("Two");
while (true) {
yield return new WaitForSeconds(2);
Debug.Log("On");
f ();
//StartCoroutine(f());// create a new coroutine !!
}
}
// Update is called once per frame
void Update () {
}
}