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);
        }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     gui = GetComponent <TextGUI>();
 }