Esempio n. 1
0
    // Start is called before the first frame update
    void Awake()
    {
        MainScrollView   = GameObject.Find("Console Scroll View");
        PacketScrollView = GameObject.Find("Packet Scroll View");

        MainScrollRect   = MainScrollView.GetComponent <ScrollRect>();
        PacketScrollRect = PacketScrollView.GetComponent <ScrollRect>();

        MainConsoleContent   = GameObject.Find("MainConsoleContent");
        PacketConsoleContent = GameObject.Find("PacketConsoleContent");

        DeleteChildObject(MainConsoleContent);
        DeleteChildObject(PacketConsoleContent);

        MainConsoleContent.AddComponent <InGameConsole>();
        MainConsole = MainConsoleContent.GetComponent <InGameConsole>();
        MainConsole._new(MainConsoleContent, MainTextPrefab, MainScrollRect);

        PacketConsoleContent.AddComponent <InGameConsole>();
        PacketConsole = PacketConsoleContent.GetComponent <InGameConsole>();
        PacketConsole._new(PacketConsoleContent, PacketTextPrefab, PacketScrollRect);

        gameObject.AddComponent <IGConsole>();
        IGConsole.Instance.Init();
    }
    public void Init()
    {
        MainConsoleContent   = GameObject.Find("MainConsoleContent");
        PacketConsoleContent = GameObject.Find("PacketConsoleContent");

        Main   = MainConsoleContent.GetComponent <InGameConsole>();
        Packet = PacketConsoleContent.GetComponent <InGameConsole>();
    }
    void Awake()
    {
#if !PUBLIC_BUILD
        s_instance      = this;
        m_LogTextBuffer = new List <string>();
#else
        Destroy(gameObject);
#endif
    }
 public void Init(InGameConsole MainConsole)
 {
     Main = MainConsole;
 }