예제 #1
0
    void Start()
    {
        GameObject go = GameObject.FindWithTag("SocketIOLogic");
        if (go) {
            socketIO = go.GetComponent<SocketIOLogic> ();
        }

        GameObject trapMaster  = GameObject.FindWithTag("GameMasterTraps");
        if (go) {
            allTraps = trapMaster.GetComponent<TrapMaster> ();
        }
    }
예제 #2
0
    void Start()
    {
        mainCamera = GameObject.FindGameObjectWithTag("MainCamera");
        scroll     = mainCamera.GetComponent <scroll>();

        players        = GameObject.FindGameObjectsWithTag("Player");
        playerMovement = new playerMovement[players.Length];
        for (int i = 0; i < players.Length; i++)
        {
            playerMovement[i] = players[i].GetComponent <playerMovement>();
        }

        trapMaster        = GameObject.FindGameObjectWithTag("TrapMaster");
        trapMasterControl = trapMaster.GetComponent <TrapMaster>();

        countDown     = GameObject.Find("Countdown");
        countDownText = countDown.GetComponent <Countdown>();

        roundOver     = GameObject.Find("RoundOver");
        roundOverText = roundOver.GetComponent <RoundOver>();
    }
예제 #3
0
    public void Start()
    {
        GameObject go = GameObject.FindWithTag("SocketIO");
        if (go) {
            socket = go.GetComponent<SocketIOComponent> ();
        }

        trapsPlaced = 0;
        itemsCollected = 0;

        TM = TrapMaster.GetComponent<TrapMaster> ();

        socket.On("open", TestOpen);
        socket.On("news", TestBoop);
        socket.On("success", TestBoop);
        socket.On("trapPlace", placeTrap);
        socket.On("marco", sayPolo);
        socket.On("boop", TestBoop);
        socket.On("error", TestError);
        socket.On("close", TestClose);

        InvokeRepeating("getPlayerPositions", 0.5f, 0.3f);
        InvokeRepeating("getDashboardStats", 1.0f, 1.0f);
    }