Beispiel #1
0
 public void InitializeButton(Equipment _equipment, EquipMenu _equipMenu, Player _player)
 {
     Text             = _equipment.ItemName;
     equipmentToEquip = _equipment;
     equipMenu        = _equipMenu;
     player           = _player;
 }
Beispiel #2
0
    //-------------------------------------------------------------------------------------------------
    // unity methods
    //-------------------------------------------------------------------------------------------------
    protected override void Start()
    {
        base.Start();
        mText            = GetComponentInChildren <Text>();
        mEquipMenuButton = GetComponentInChildren <Button>();
        if (!mEquipMenuButton)
        {
            Debug.LogError("Equipment button not found.");
        }
        //get the equip menu
        if (transform.parent.GetComponentInParent <GameObjectList>())
        {
            return;
        }
        Player player = transform.root.GetComponentInChildren <Player>();

        if (!player)
        {
            Debug.LogError("Player not found, so can't find the equip menu.");
            return;
        }
        mEquipMenu = player.mHud.mEquipMenu;
        if (!mEquipMenu)
        {
            Debug.LogError("EquipMenu not found.");
        }
    }
Beispiel #3
0
    public void SetGUIOnGameStart(Player _player)
    {
        ItemContainer itemContainer = GetNode("Items/ItemContainer") as ItemContainer;
        PlayerInfo    playerInfo    = GetNode("PlayerInfo") as PlayerInfo;
        EquipMenu     equipMenu     = GetTree().GetRoot().GetNode("Game/CanvasLayer/GUI/EquipMenu") as EquipMenu;

        playerInfo.FillLabels(_player);
        itemContainer.InitializeItemAmounts(_player);
        equipMenu.SetPlayer(_player);
    }
Beispiel #4
0
    //-------------------------------------------------------------------------------------------------
    // unity methods
    //-------------------------------------------------------------------------------------------------
    void Awake()
    {
        UI.StoreSelectBoxSkin(mSelectBoxSkin);
        setPlayingArea();
        mSideBar = GetComponentInChildren <SideBar>();
        if (!mSideBar)
        {
            Debug.LogError("Can't find SideBar in HUD");
        }
        mSelectionBox = GetComponentInChildren <SelectionBox>();
        if (!mSelectionBox)
        {
            Debug.Log("Can't find SelectionBox in HUD. I disabled it.");
        }
        mPopMenu = GetComponentInChildren <PopMenu>();
        if (!mPopMenu)
        {
            Debug.LogError("Can't find PopMenu in HUD");
        }
        //mPopMenu.gameObject.SetActive(false);
        mExchangeMenu = GetComponentInChildren <ExchangeMenu>();
        if (!mExchangeMenu)
        {
            Debug.LogError("Can't find ExchangeMenu in HUD");
        }
        mExchangeMenu.gameObject.SetActive(false);
        mEquipMenu = GetComponentInChildren <EquipMenu>();
        if (!mEquipMenu)
        {
            Debug.LogError("Can't find EquipMenu in HUD");
        }
        mEquipMenu.gameObject.SetActive(false);
        //get the canvases
        List <Canvas> clist = new List <Canvas>(GetComponentsInChildren <Canvas>());

        foreach (Canvas c in clist)
        {
            if (c.gameObject.name == "ScreenBarsCanvas")
            {
                mScreenBarsCanvas = c;
            }
            else if (c.gameObject.name == "CameraSpaceCanvas")
            {
                mCameraSpaceCanvas = c;
            }
            else
            {
                Debug.LogWarning("Canvas with name " + c.gameObject.name + " not recognised");
            }
        }
    }
    void Inicialize()
    {
        Instance = this;
        Transform infoT = transform.Find("Info");

        window_mejorar = transform.Find("Window_Mejorar");
        window_vender  = transform.Find("Window_Vender");
        retrato        = infoT.Find("Retrato").GetComponent <Image>();
        skill1_name    = infoT.Find("Skill1").Find("Name").GetComponent <Text>();
        skill2_name    = infoT.Find("Skill2").Find("Name").GetComponent <Text>();
        skill3_name    = infoT.Find("Skill3").Find("Name").GetComponent <Text>();
        skill1_orb     = infoT.Find("Skill1").Find("Orbe").GetComponent <Image>();
        skill2_orb     = infoT.Find("Skill2").Find("Orbe").GetComponent <Image>();
        skill3_orb     = infoT.Find("Skill3").Find("Orbe").GetComponent <Image>();
        skill1_orb2    = infoT.Find("Skill1").Find("Orbe2").GetComponent <Image>();
        skill2_orb2    = infoT.Find("Skill2").Find("Orbe2").GetComponent <Image>();
        skill3_orb2    = infoT.Find("Skill3").Find("Orbe2").GetComponent <Image>();
        rarity_text    = infoT.Find("Rarity_Color").GetComponent <Text>();
        rarity_shadow  = infoT.Find("Rarity_Shadow").GetComponent <Text>();
        value_life     = infoT.Find("Value_Life").GetComponent <Text>();
        value_attack   = infoT.Find("Value_Attack").GetComponent <Text>();
        value_skill    = infoT.Find("Value_Skill").GetComponent <Text>();
        value_luck     = infoT.Find("Value_Luck").GetComponent <Text>();

        Transform inventario = transform.Find("Panel_Inventario").Find("Inventario");

        inventarioT = inventario.Find("Scroll").Find("Botones_Items");
        //buttonPrefab = inventarioT.Find("Button").gameObject;
        storage_ID   = new string[inventarioT.childCount];
        item_image   = new Image[inventarioT.childCount];
        rarity_image = new Image[inventarioT.childCount];
        for (var x = 0; x < inventarioT.childCount; x++)
        {
            Transform t = inventarioT.GetChild(x);
            rarity_image[x]   = t.GetComponent <Image>();
            item_image[x]     = t.Find("Image").GetComponent <Image>();
            t.gameObject.name = x.ToString();
        }
    }
Beispiel #6
0
    void AddSubMenuComponent()
    {
        StatusMenu sm = gameObject.AddComponent <StatusMenu> ();

        sm.enabled = false;

        SkillMenu skm = gameObject.AddComponent <SkillMenu> ();

        skm.enabled = false;

        EquipMenu em = gameObject.AddComponent <EquipMenu> ();

        em.enabled = false;

        ItemMenu im = gameObject.AddComponent <ItemMenu> ();

        im.enabled = false;

        SaveMenu sam = gameObject.AddComponent <SaveMenu> ();

        sam.enabled = false;
    }
    void Inicialize()
    {
        //sub_menu_play = transform.Find("Start_Menu").Find("SubPanel_Versus").gameObject;
        CheckPlayerPrefs();
        start_menu = transform.Find("Start_Menu");
        equipment  = transform.Find("Equipamiento");
        battleIA   = transform.Find("BattleIA");
        treasures  = transform.Find("Treasures");
        goldText   = treasures.Find("Money").Find("Text").GetComponent <Text>();
        gold_VIP   = treasures.Find("Money_VIP").Find("Text").GetComponent <Text>();
        equip_menu = equipment.GetComponent <EquipMenu>();

        Transform statsT = transform.Find("Equipamiento").Find("STATS");

        stats_window.alpha    = statsT.Find("Value_Alpha").GetComponent <Text>();
        stats_window.assassin = statsT.Find("Value_Assassin").GetComponent <Text>();
        stats_window.charming = statsT.Find("Value_Charming").GetComponent <Text>();
        stats_window.pacifist = statsT.Find("Value_Pacifist").GetComponent <Text>();

        stats_window.health   = statsT.Find("Value_Life").GetComponent <Text>();
        stats_window.strenght = statsT.Find("Value_Attack").GetComponent <Text>();
        stats_window.skill    = statsT.Find("Value_Skill").GetComponent <Text>();
        stats_window.luck     = statsT.Find("Value_Luck").GetComponent <Text>();
    }
Beispiel #8
0
 // Start is called before the first frame update
 private void Awake()
 {
     instance = this;
     EquipMenuUISetting();
 }
Beispiel #9
0
 public override void _Ready()
 {
     equipMenu = GetTree().GetRoot().GetNode("Game/CanvasLayer/GUI/EquipMenu") as EquipMenu;
 }