Пример #1
0
 public void OnSelect()
 {
     Debug.Log(building.name);
     buildPanel = GetComponentInParent <BuildPanel>();
     buildPanel.ShowBuildingInfo(building);
     BuildManager.instance.SetBuildingToBuild(building);
 }
Пример #2
0
    // Start is called before the first frame update
    void Start()
    {
        gameState  = GameState.instance;
        controller = GameState.instance.controller;

        SelectedEnemyPanel.SetActive(false);
        SelectedWorkerPanel.SetActive(false);
        SelectedBuildingPanel.SetActive(false);
        PausePanel.SetActive(false);
        BuildDescriptionPanel.SetActive(false);
        BuildPanel.SetActive(true);
        RessourcePanel.SetActive(true);
    }
        private void UserControl1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g2 = NicknamePanel.CreateGraphics();
            g2.DrawRectangle(new Pen(Color.FromArgb(57, 74, 127)), 0, 0, NicknamePanel.Width, NicknamePanel.Height - 1);
            Graphics g3 = NicknamePanel2.CreateGraphics();

            g3.DrawRectangle(new Pen(Color.FromArgb(57, 74, 127)), 0, 0, NicknamePanel2.Width - 1, NicknamePanel2.Height - 1);

            Graphics g5 = BuildPanel.CreateGraphics();
            g5.DrawRectangle(new Pen(Color.FromArgb(57, 74, 127)), 0, 0, NicknamePanel.Width, NicknamePanel.Height - 1);
            Graphics g4 = BuildPanel2.CreateGraphics();
            g4.DrawRectangle(new Pen(Color.FromArgb(57, 74, 127)), 0, 0, NicknamePanel2.Width - 1, NicknamePanel2.Height - 1);
        }
Пример #4
0
    void CmdSetup()
    {
        GameObject playerInputsObj = Instantiate <GameObject> (playerInputsPrefab);

        playerInputs = GetComponent <PlayerInputs> ();
        playerInputs.AddPlayer(playerId);
        NetworkServer.Spawn(playerInputsObj);
        GameObject buildPanelObj = Instantiate <GameObject> (buildPanelPrefab);

        buildPanel = buildPanelObj.GetComponent <BuildPanel> ();
        buildPanel.AddPlayer(playerId, gameObject);
        NetworkServer.SpawnWithClientAuthority(buildPanelObj, gameObject);
        Object.FindObjectOfType <CameraController> ().AddPlayer(gameObject);
        setup = true;
    }
Пример #5
0
    /// <summary>
    /// Start is called on the frame when a script is enabled just before
    /// any of the Update methods is called the first time.
    /// </summary>
    void Start()
    {
        GameObject goldPanel  = canvas.transform.Find("Gold&HealthBanner").gameObject;
        GameObject wavesPanel = canvas.transform.Find("WavesBanner").gameObject;

        //set info banners positions to the left upper corner of the screen
        // RectTransform gameMenuPanel = canvas.transform.Find("GameMenu").GetComponent<RectTransform>();


        goldLabel        = goldPanel.transform.Find("GoldPanel/GoldAmount").GetComponent <Text>();
        buildPanelScript = buildPanel.GetComponent <BuildPanel>();
        activeTowers     = new List <Tower>();

        SetGlobalValuesToInitialState();
    }
Пример #6
0
        public override void OnBegin()
        {
            if (BuildPanel != null)
            {
                BuildPanel.Destroy();
            }
            int w = 600;
            int h = 350;

            BuildPanel = new BuildMenu(PlayState.GUI, PlayState.GUI.RootComponent, Player, BuildType)
            {
                LocalBounds = new Rectangle(PlayState.Game.GraphicsDevice.Viewport.Width / 2 - w / 2, PlayState.Game.GraphicsDevice.Viewport.Height / 2 - h / 2, w, h),
                IsVisible   = true,
                DrawOrder   = 2
            };
            BuildPanel.TweenIn(Drawer2D.Alignment.Right, 0.25f);
        }
Пример #7
0
 public override void OnEnd()
 {
     BuildPanel.TweenOut(Drawer2D.Alignment.Right, 0.25f);
 }
Пример #8
0
 public void UpdateUI()
 {
     BuildPanel.UpdatePanel();
     GameInfoPanel.UpdatePanel();
 }
Пример #9
0
 void Awake()
 {
     Instance = this;
     gc       = GameObject.Find("GameManager").GetComponent <GameControl>();
 }
Пример #10
0
 void Awake()
 {
     instance                 = this;
     rectTransform            = GetComponent <RectTransform>();
     rectTransform.localScale = new Vector3(0, 0, 0);
 }
Пример #11
0
 private void Awake()
 {
     Instance = this;
 }