Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        GameObject o   = GameObject.Find("IrcWindow");
        IrcGui     irc = o.GetComponent <IrcGui>();

        irc.enabled    = false;
        irc.showWindow = false;
        o.active       = false;
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        //Networking events
        NetworkHandler h = new NetworkHandler();

        StateMachine sm;

        sm = new StateMachine();

        if (!Directory.Exists(Application.dataPath + "\\GW_Data\\"))
        {
            Directory.CreateDirectory(Application.dataPath + "\\GW_Data\\");
        }

        //Connect to server
        IPHostEntry hostEntry;

        hostEntry = Dns.GetHostEntry("srv.h2x.us");

        // String ServerIP = "192.168.2.109";
        var            ServerIP             = hostEntry.AddressList[0];
        ConnectionInfo serverConnectionInfo = new ConnectionInfo(ServerIP.ToString(), 10000);

        Globals.con = TCPConnection.GetConnection(serverConnectionInfo, true);

        //Login
        doLogin();

        //Show Chat
        GameObject o   = GameObject.Find("IrcWindow");
        IrcGui     irc = o.GetComponent <IrcGui>();

        o.active       = true;
        irc.enabled    = true;
        irc.showWindow = true;

        //Hide World Editor
        GameObject c  = GameObject.Find("Canvas");//GetComponent<Canvas>();
        Canvas     ca = c.GetComponent <Canvas>();

        ca.enabled = false;



        //OnSave handler
        LE_EventInterface.OnSave += LoadSaveWorldData.OnSaveWorldData;

        //Hide Inventory
        Globals._Inventory = GameObject.Find("Inventory");
        Inventory inv = Globals._Inventory.GetComponent <Inventory>();

        //inv.inventory_area_background = (Texture2D)Resources.Load<Texture2D>("BlankPanel-3");

        Globals._Inventory.SetActive(false);

        GameObject dragme = GameObject.Find("DragMe");

        dragme.AddComponent <DragMe>();


        //Start cooldowns thread
        Globals.cooldownThread = new System.Threading.Thread(CooldownThrd);
        Globals.cooldownThread.Start();

        //Request world update
        Globals.con.SendObject("RequestWorldData", true);
    }