Exemple #1
0
 void Awake()
 {
     //setup = GetComponent<Player_Setup>();
     cursorLock = GameObject.Find("NetworkManager").GetComponent <LockCursor>();
     manager    = GetComponent <GM_Manager>();
     overlay    = GameObject.Find("Pause Overlay");
     FindButtonContainer();
     Pause(false);
 }
Exemple #2
0
 void Awake()
 {
     //setup = GetComponent<Player_Setup>();
     cursorLock = GameObject.Find("NetworkManager").GetComponent<LockCursor>();
     manager = GetComponent<GM_Manager>();
     overlay = GameObject.Find("Pause Overlay");
     FindButtonContainer();
     Pause(false);
 }
    public void Initialize(GM_Manager.GameMode gameMode)
    {
        manager = GetComponent <GM_Manager>();

        bases     = new GameObject[4];
        particles = new GameObject[4];
        for (int i = 0; i < 4; i++)
        {
            particles [i] = GameObject.Find("ArenaFire" + i);
            bases [i]     = GameObject.Find("Base" + i);
            switch (gameMode)
            {
            case GM_Manager.GameMode.BB:
            {
                bases [i].AddComponent <GM_Base_BB>();
                break;
            }

            case GM_Manager.GameMode.HP:
            {
                // Vorm aanpassen aan volledige gebied speler
                bases [i].AddComponent <GM_Base_HP>();
                break;
            }

            case     GM_Manager.GameMode.CTF:
            {
                bases [i].AddComponent <GM_Base_CTF>();
                break;
            }

            case GM_Manager.GameMode.KOTH:
            {
                if (i == 0)
                {
                    bases [i].AddComponent <GM_Base_KOTH>();
                }
                else
                {
                    bases [i].gameObject.SetActive(false);
                }
                break;
            }

            default:
            {
                break;
            }
            }

            bases [i].GetComponent <GM_GameMode>().isServer = isServer;
        }

        rotationTime = 60;
        timeLeft     = rotationTime;
    }
    public override void OnServerReady(NetworkConnection conn)
    {
        base.OnServerReady(conn);

        manager = GameObject.Find("GameModeManager").GetComponent<GM_Manager>();
        if (numPlayers == 3 && !manager.roundStarted)
        { // Bij 4 spelers "numPlayers == 3"
            //manager.StartRound();
        }
    }
    public override void OnServerReady(NetworkConnection conn)
    {
        base.OnServerReady(conn);

        manager = GameObject.Find("GameModeManager").GetComponent <GM_Manager>();
        if (numPlayers == 3 && !manager.roundStarted)
        { // Bij 4 spelers "numPlayers == 3"
          //manager.StartRound();
        }
    }
    public void Initialize(GM_Manager.GameMode gameMode)
    {
        manager = GetComponent<GM_Manager>();

        bases = new GameObject[4];
        particles = new GameObject[4];
        for (int i  = 0; i < 4; i++)
        {
            particles [i] = GameObject.Find("ArenaFire" + i);
            bases [i] = GameObject.Find("Base" + i);
            switch (gameMode)
            {
                case GM_Manager.GameMode.BB:
                    {
                        bases [i].AddComponent<GM_Base_BB>();
                        break;
                    }
                case GM_Manager.GameMode.HP:
                    {
                        // Vorm aanpassen aan volledige gebied speler
                        bases [i].AddComponent<GM_Base_HP>();
                        break;
                    }
                case     GM_Manager.GameMode.CTF:
                    {
                        bases [i].AddComponent<GM_Base_CTF>();
                        break;
                    }
                case GM_Manager.GameMode.KOTH:
                    {
                        if (i == 0)
                        {
                            bases [i].AddComponent<GM_Base_KOTH>();
                        } else
                        {
                            bases [i].gameObject.SetActive(false);
                        }
                        break;
                    }
                default:
                    {
                        break;
                    }
            }

            bases [i].GetComponent<GM_GameMode>().isServer = isServer;
        }

        rotationTime = 60;
        timeLeft = rotationTime;
    }
Exemple #7
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);

        player = GameObject.Find("Player");
        _size  = spellBar.transform.GetChild(1).transform.GetComponent <RectTransform>().sizeDelta;
    }
Exemple #8
0
    // Use this for initialization
    public void GenerateGrid()
    {
        if (chunks != null)
        {
            return;
        }

        heightMap = Resources.Load <Texture2D>("Images/heightmap");
        colorMap  = Resources.Load <Texture2D>("Images/colormap");

        GM_Manager manager = GameObject.Find("GameModeManager").GetComponent <GM_Manager>();

        if (manager.GM == GM_Manager.GameMode.KOTH)
        {
            heightMap = Resources.Load <Texture2D>("Images/koth_heightmap");
            colorMap  = Resources.Load <Texture2D>("Images/koth_colormap");
        }

        hexagons = new GameObject[length, width];
        for (int x = 0; x < length; x++)
        {
            for (int z = 0; z < width; z++)
            {
                Renderer hex = hexagon.GetComponent <Renderer>();
                //hexYSize = hex.bounds.size.y;

                float   x_pos = transform.position.x + x * hex.bounds.size.x + (z % 2 * (hex.bounds.size.x / 2));
                float   y_pos = GetYPos(x, z);
                float   z_pos = transform.position.z + z * (hex.bounds.size.z / 4 * 3);
                Vector3 pos   = new Vector3(x_pos, y_pos, z_pos);

                GameObject newHex = Instantiate(hexagon, pos, hexagon.transform.rotation) as GameObject;
                newHex.transform.name = "hexagon" + x + z;
                newHex.GetComponent <Renderer>().material.color = colorMap.GetPixel(x, z);
                newHex.GetComponent <Hexagon>().Initialize(x, z, pos);
                hexagons [x, z] = newHex;
            }
        }

        CreateChunks();
    }
Exemple #9
0
 protected virtual void Start()
 {
     manager = GameObject.Find("GameModeManager").GetComponent<GM_Manager>();
     basesManager = GameObject.Find("GameModeManager").GetComponent<GM_Bases_Manager>();
     messageManager = GameObject.Find("GameModeManager").GetComponent<GM_Message>();
 }
Exemple #10
0
 protected virtual void Start()
 {
     manager        = GameObject.Find("GameModeManager").GetComponent <GM_Manager>();
     basesManager   = GameObject.Find("GameModeManager").GetComponent <GM_Bases_Manager>();
     messageManager = GameObject.Find("GameModeManager").GetComponent <GM_Message>();
 }