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); }
// Update is called once per frame void Update() { ICharactor c = target.GetComponent <ICharactorable>().Charactor(); gui.SetText(c.ToString()); }