Ejemplo n.º 1
0
 private void Start()
 {
     generation = GameObject.Find("GameManager").GetComponent <Generation>();
     saveGame   = GameObject.Find("GameManager").GetComponent <SaveGame>();
     panels     = gameObject.GetComponent <UIPanels>();
     showStats  = false;
 }
Ejemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     panels = GameObject.Find("Canvas").GetComponent <UIPanels>();
     panels.finishPanel.SetActive(false);
     hasFinished   = false;
     alreadyCalled = false;
 }
Ejemplo n.º 3
0
    //shows the requested panel
    public void ShowPanel(UIPanels panel)
    {
        switch (panel)
        {
        case UIPanels.UIInventoryMenu:
            if (!UIBuyScreen.active)
            {
                UIInventoryMenu.SetActive(true);
                UIInventoryMenu.GetComponent <InventoryPanel>().PopulateInventory();
            }
            break;

        case UIPanels.UIBuyScreen:
            UIBuyScreen.SetActive(true);
            break;

        case UIPanels.UISellScreen:
            UISellScreen.SetActive(true);
            break;

        case UIPanels.UIEquipScreen:
            EquipScreen.SetActive(true);
            break;
        }
    }
Ejemplo n.º 4
0
 public void Init(UIPanels uiPanels, Player player)
 {
     tradingPlayer = player;
     OnPlayerMoneyChanged(GameplayController.instance.session.localPlayer.GetName());
     OnPlayerMoneyChanged(tradingPlayer.GetName());
     FillSender(player);
 }
Ejemplo n.º 5
0
    public void Init(Player player, UIPanels UIPanels)
    {
        this.player    = player;
        this.UIPanels  = UIPanels;
        nickName.text  = player.GetName();
        money.text     = player.Money.ToString();
        nickName.color = money.color = player.MainColor;
        GameplayController gC = GameplayController.instance;

        showBuildingsButton.SetActive(!player.NetworkPlayer.IsLocal);
        tradeButton.SetActive(!player.NetworkPlayer.IsLocal && gC.session.FindPlayer(gC.board.dice.currentPlayer).NetworkPlayer.IsLocal);
    }
Ejemplo n.º 6
0
    public void PreInit(UIPanels controller)
    {
        myListings    = new List <TradeListing>();
        theirListings = new List <TradeListing>();

        myPool    = new BasePool(myContent, template, Keys.Menu.MAX_PLAYERS_COUNT);
        theirPool = new BasePool(theirContent, template, Keys.Menu.MAX_PLAYERS_COUNT);

        myPool.Init();
        theirPool.Init();

        uIPanels = controller;
        gC       = GameplayController.instance;
        lC       = SettingsController.instance.languageController;
    }
Ejemplo n.º 7
0
    //OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        if (player == null)
        {
            player = animator.gameObject.GetComponent <Player>();
        }
        animator.SetBool("running", false);
        animator.SetBool("climbing", false);
        animator.SetFloat("yVelocity", 0);

        GameObject.Find("GameManager").GetComponent <SaveGame>().MissionFailed();
        PlayerPrefs.SetInt("totalMissionsFailed", (PlayerPrefs.GetInt("totalMissionsFailed") + 1));

        panels = GameObject.Find("Canvas").GetComponent <UIPanels>();
        panels.deathPanel.SetActive(true);
        Time.timeScale = 0;
    }
Ejemplo n.º 8
0
    //Hides the requested panel
    public void HidePanel(UIPanels panel)
    {
        switch (panel)
        {
        case UIPanels.UIInventoryMenu:
            UIInventoryMenu.SetActive(false);
            break;

        case UIPanels.UIBuyScreen:
            UIBuyScreen.SetActive(false);
            break;

        case UIPanels.UISellScreen:
            UISellScreen.SetActive(false);
            break;

        case UIPanels.UIEquipScreen:
            EquipScreen.SetActive(false);
            break;
        }
    }
Ejemplo n.º 9
0
    public void Init(Field field, UIPanels UIPanels, bool trade = false)
    {
        this.UIPanels  = UIPanels;
        this.field     = field;
        fieldName.text = field.GetFieldName();
        icon.sprite    = field.FieldImage;
        gc             = GameplayController.instance;
        showOnBoardButton.SetActive(!trade);
        addToTradeButton.SetActive(trade);

        if (trade)
        {
            if (UIPanels.rightPanel.myListings.Find(listing => listing.tradeField == field) == null && UIPanels.rightPanel.theirListings.Find(listing => listing.tradeField == field) == null)
            {
                tradeToggle.isOn = false;
            }
            else
            {
                tradeToggle.isOn = true;
            }
        }
    }
Ejemplo n.º 10
0
 private void Construct(UIPanels uiPanels)
 {
     _uiPanels = uiPanels;
 }
Ejemplo n.º 11
0
 private void Awake()
 {
     Instance = this;
 }
Ejemplo n.º 12
0
 void Awake()
 {
     mInstance = this;
 }
 public void PreInit(UIPanels controller)
 {
     uIPanels = controller;
 }
Ejemplo n.º 14
0
 public void PreInit(UIPanels controller)
 {
     gC       = GameplayController.instance;
     uIPanels = controller;
 }
Ejemplo n.º 15
0
 // Start is called before the first frame update
 void Start()
 {
     panels = GameObject.Find("Canvas").GetComponent <UIPanels>();
     paused = false;
 }