public TextGUI Create(Vector3 locate, string text) { TextGUI obj = pool.Rent(); obj.SetText(text); obj.transform.SetParent(transform); TranslateBehaviour trans = obj.GetComponent <TranslateBehaviour>(); trans.SetStartPosition(locate); trans.OnDispose?.Where(x => x).Subscribe(_ => { pool.Return(obj); Debug.Log("return"); }); return(obj); }
// Use this for initialization void Start() { gui = GetComponent <TextGUI>(); }