using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour {
private Transform randomSet;
public Transform aktifSetler, pasifSetler;
// Use this for initialization
void Start () {
StartCoroutine(CheckForVisibility());
}
// Update is called once per frame
void Update () {
}
void Recycle()
{
randomSet = pasifSetler.GetChild(Random.Range(0, pasifSetler.childCount));
randomSet.parent = aktifSetler;
randomSet.localPosition = aktifSetler.GetChild (aktifSetler.childCount - 2).localPosition + new Vector3 (0, 0, 0);
randomSet = aktifSetler.GetChild (0);
randomSet.parent = pasifSetler;
randomSet.localPosition = pasifSetler.GetChild (0).localPosition;
}
IEnumerator CheckForVisibility()
{
while(true)
{
yield return new WaitForEndOfFrame();
if (aktifSetler.GetChild (0).GetChild (1).GetComponent<SpriteRenderer>().isVisible == false)
{
Recycle ();
}
}
}
}
yes this is exacly what i need ^^. and i want your help if you are the time^^
– Nehaliel_AGS