Пример #1
0
 // Called when the node enters the scene tree for the first time.
 public override void _Ready()
 {
     Game        = GetTree().Root.GetNode("Game") as Game;
     MainMenu    = GetNode("MainMenu") as MainMenu;
     OptionsMenu = GetNode("OptionsMenu") as OptionsMenu;
     Console     = GetNode("Console") as Console;
     Lobby       = GetNode("Console") as Lobby;
     TeamMenu    = GetNode("TeamMenu") as TeamMenu;
     ClassMenu   = GetNode("ClassMenu") as ClassMenu;
 }
    bool active = true; //Tells is the main menu is active or showing a sub window

    void Start()
    {
        menu          = GetComponent <PauseMenuController>();
        teamMenu      = transform.Find("TeamMenu").GetComponent <TeamMenu>();
        bagMenu       = transform.Find("BagMenu").GetComponent <BagMenu>();
        ApiController = gameObject.GetComponent <APIController>();

        usernameText = transform.Find("Username").GetComponent <Text>();
        moneyText    = transform.Find("Money").GetComponent <Text>();
        coredexText  = transform.Find("Coredex").GetComponent <Text>();

        usernameText.text = GameData.saveData.username;
    }
Пример #3
0
    public override void _Ready()
    {
        _network = (Network)GetNode("/root/OpenFortress/Network");

        Player player = AddPlayer(_network.NetworkID);

        PackedScene m  = (PackedScene)ResourceLoader.Load("res://Scenes/TeamMenu.tscn");
        TeamMenu    m2 = (TeamMenu)m.Instance();

        this.AddChild(m2);
        m2.Init(player.GetName());

        spawnsTeam1 = GetTree().GetNodesInGroup("SpawnTeam1");
        spawnsTeam2 = GetTree().GetNodesInGroup("SpawnTeam2");
    }
Пример #4
0
    // Use this for initialization
    void Start()
    {
        menu = FindObjectOfType <TeamMenu>();

        yellowSpawns[0] = yellowSpawn1.position;
        yellowSpawns[1] = yellowSpawn2.position;
        yellowSpawns[2] = yellowSpawn3.position;
        yellowSpawns[3] = yellowSpawn4.position;
        yellowSpawns[4] = yellowSpawn5.position;

        purpleSpawns[0] = purpleSpawn1.position;
        purpleSpawns[1] = purpleSpawn2.position;
        purpleSpawns[2] = purpleSpawn3.position;
        purpleSpawns[3] = purpleSpawn4.position;
        purpleSpawns[4] = purpleSpawn5.position;

        ValuesScrpt.SpawnYellow = yellowSpawns;
        ValuesScrpt.SpawnPurple = purpleSpawns;
    }
Пример #5
0
 // Use this for initialization
 void Start()
 {
     menu = FindObjectOfType <TeamMenu>();
     spawn();
 }