Exemplo n.º 1
0
    public void RoomAdd(string name)
    {
        rooms.Add(GameObject.Find(name));
        Destroy(rooms[rooms.Count - 1].GetComponent <BoxCollider2D>());
        SpawnClient spawn = rooms[rooms.Count - 1].GetComponent <SpawnClient>();

        spawn.flagSpawn = true;
    }
Exemplo n.º 2
0
    private void LoadSpawner()
    {
        if (networkManager.IsServer)
        {
            SpawnServer server = gameObject.AddComponent <SpawnServer>();
        }
        else
        {
            SpawnClient client = gameObject.AddComponent <SpawnClient>();

            GameObject player = Resources.Load("PlayerControlleur") as GameObject;
            ClientScene.RegisterPrefab(player);
        }
    }
Exemplo n.º 3
0
    public void RoomAdd(string name)
    {
        rooms.Add(GameObject.Find(name));
        companyData.rooms.Add(rooms[rooms.Count - 1].GetComponent <Room>().data);
        if (workers[0] == null)
        {
            workers[0] = WorkGameObject.CreateObject(workersPrefab[0], rooms[0].GetComponent <Room>()._tables[0].GetComponent <Position>().positionHuman,
                                                     rooms[0].transform, 84, 87, 1);
            workers[0].transform.Find("Worker").GetComponent <Player>().Table = rooms[0].GetComponent <Room>()._tables[0];
            companyData.CountWorker++;
            player = workers[0].transform.Find("Worker").gameObject;
            head.GetComponent <Head>().player = workers[0].transform.Find("Worker").GetComponent <Player>();
            companyData.rooms[0].worker.Add(player.GetComponent <Player>().data);
        }
        Destroy(rooms[rooms.Count - 1].GetComponent <BoxCollider2D>());
        SpawnClient spawn = rooms[rooms.Count - 1].GetComponent <SpawnClient>();

        spawn.flagSpawn = true;
    }