45 lines
851 B
C#
45 lines
851 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using TMPro;
|
|
|
|
public class ConsoleItem : MonoBehaviour, IPoolObject<ConsoleItem>
|
|
{
|
|
#region ¶ÔÏó¹ÜÀí
|
|
|
|
public IPool<ConsoleItem> Pool { get; set; }
|
|
|
|
public ConsoleItem Content { get; set; }
|
|
|
|
public void Init(ConsolePanel _pool, ConsoleItem _content)
|
|
{
|
|
Pool = _pool;
|
|
Content = _content;
|
|
}
|
|
|
|
public ConsoleItem(ConsolePanel _pool, ConsoleItem _content)
|
|
{
|
|
Pool = _pool;
|
|
Content = _content;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Pool.Dispose(this);
|
|
}
|
|
|
|
public void Recycle()
|
|
{
|
|
Pool.Recycle(this);
|
|
}
|
|
#endregion
|
|
|
|
public TextMeshProUGUI text_mesh_pro;
|
|
|
|
public ConsoleItem NewConsole(string _message)
|
|
{
|
|
text_mesh_pro.text = _message;
|
|
return this;
|
|
}
|
|
}
|