Exemplo n.º 1
0
    void Start()
    {
        canvas             = GameObject.Find("Canvas").GetComponentInChildren <Canvas>();
        characterInventory = canvas.GetComponentInChildren <CharacterInventoryGUI>();
        terrain            = GameObject.FindWithTag("MainEnvironment").GetComponentInChildren <TerrainScript>();
        inventoryWindow    = characterInventory.GetComponentInChildren <CharacterInventoryPickupWindowGUI>();
        Weapons            = terrain.Player.GetComponentInChildren <WeaponsDatabase>();
        Armors             = terrain.Player.GetComponentInChildren <ArmorDatabase>();
        wepSwitch          = terrain.Player.GetComponentInChildren <WeaponSwitch>();
        armorSwitch        = terrain.Player.GetComponentInChildren <ArmorSwitch>();
        Stats        = terrain.Player.GetComponentInChildren <CharacterStats>();
        mainGUI      = canvas.GetComponent <MainGUI>();
        movement     = terrain.Player.GetComponentInChildren <CharacterMovement>();
        characterGUI = canvas.GetComponentInChildren <CharacterSkillBarGUI>();

        CurrentItemLocationIndex = -1;

        PreviousUpgradedIcon = transform.Find("ParentUpgradeItemPrevious").Find("UpgradeItemPrevious").gameObject;
        AfterUpgradedIcon    = transform.Find("ParentUpgradeItemAfter").Find("UpgradeItemAfter").gameObject;
        transform.Find("Confirm").GetComponent <Button>().onClick.AddListener(() => CreateRarity());

        HoverRectINIT = Instantiate(HoverWindowRectPrefab, transform.position, transform.rotation) as GameObject;
        HoverRectINIT.transform.SetParent(transform);
        HoverRectINIT.transform.localScale = new Vector3(1, 1, 1);
        HoverRectINIT.GetComponentInChildren <Image>().enabled = false;
        HoverRectINIT.transform.Find("Image").GetComponentInChildren <Text>().enabled      = false;
        HoverRectINIT.transform.Find("Image").Find("Level").GetComponent <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rarity").GetComponent <Text>().enabled = false;
        HoverRectINIT.transform.Find("Image").Find("Rate1").GetComponent <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rate2").GetComponent <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rate3").GetComponent <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rate4").GetComponent <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rate5").GetComponent <Text>().enabled  = false;
    }
Exemplo n.º 2
0
    void Start()
    {
        terrain         = GameObject.FindWithTag("MainEnvironment").GetComponentInChildren <TerrainScript>();
        InventoryManage = new List <InventoryManager>();
        Debug.Log("inv spawned");
        DroppedItemList = new List <InventoryManager>();

        EquipWeapon   = terrain.Player.GetComponentInChildren <WeaponsDatabase>();
        EquipArmor    = terrain.Player.GetComponentInChildren <ArmorDatabase>();
        SwitchWeapons = terrain.Player.GetComponentInChildren <WeaponSwitch>();
        SwitchArmor   = terrain.Player.GetComponentInChildren <ArmorSwitch>();
        Stats         = terrain.Player.GetComponentInChildren <CharacterStats>();
        MiscItems     = terrain.Player.GetComponentInChildren <MiscellaneousItemsDatabase>();
        ToolItems     = terrain.Player.GetComponentInChildren <ToolDatabase>();
        RockOre       = terrain.Player.GetComponentInChildren <MineRocks>();
        TreeLog       = terrain.Player.GetComponentInChildren <ChopTrees>();
        Herbs         = terrain.Player.GetComponentInChildren <Herbloring>();
        ItemsPickup   = terrain.Player.GetComponentInChildren <PickupObjects>();
        Potions       = terrain.Player.GetComponentInChildren <PotionDatabase>();
        movement      = terrain.Player.GetComponentInChildren <CharacterMovement>();
        skillbarGUI   = terrain.canvas.GetComponent <MainGUI>().characterSkillsBarGUI;

        Invoke("TestingPurposes", 4);
        InvokeRepeating("CombineStacks", 4, 3);
    }
Exemplo n.º 3
0
    void Start()
    {
        CurrentPointerButtonIndex = -1;
        CurrentUpgradeItemSlot    = -1;
        UpgradeIndex = -1;

        terrain  = GameObject.FindWithTag("MainEnvironment").GetComponentInChildren <TerrainScript>();
        RectINIT = Instantiate(PickUpWindowRectPrefab, transform.position, transform.rotation) as Button;
        RectINIT.GetComponentInChildren <Image>().enabled = false;
        HoverRectINIT = Instantiate(HoverWindowRectPrefab, transform.position, transform.rotation) as GameObject;
        HoverRectINIT.transform.SetParent(transform);
        HoverRectINIT.transform.localScale = new Vector3(1, 1, 1);
        HoverRectINIT.GetComponentInChildren <Image>().enabled = false;
        HoverRectINIT.transform.Find("Image").GetComponentInChildren <Text>().enabled = false;
        HoverRectINIT.transform.Find("Image").Find("Level").GetComponentInChildren <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rarity").GetComponentInChildren <Text>().enabled = false;
        HoverRectINIT.transform.Find("Image").Find("Rate1").GetComponentInChildren <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rate2").GetComponentInChildren <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rate3").GetComponentInChildren <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rate4").GetComponentInChildren <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rate5").GetComponentInChildren <Text>().enabled  = false;

        inventory          = gameObject.transform.root.GetComponentInChildren <Canvas>();
        characterInventory = gameObject.GetComponentInParent <CharacterInventoryGUI>();
        skillbarGUI        = terrain.canvas.GetComponentInChildren <CharacterSkillBarGUI>();
        character          = terrain.Player.GetComponentInChildren <CharacterMovement>();
        MiscItems          = terrain.Player.GetComponentInChildren <MiscellaneousItemsDatabase>();
        Weapons            = terrain.Player.GetComponentInChildren <WeaponsDatabase>();
        WepSwitch          = terrain.Player.GetComponentInChildren <WeaponSwitch>();
        Tools        = terrain.Player.GetComponentInChildren <ToolDatabase>();
        Potions      = terrain.Player.GetComponentInChildren <PotionDatabase>();
        Armors       = terrain.Player.GetComponentInChildren <ArmorDatabase>();
        armorSwitch  = terrain.Player.GetComponentInChildren <ArmorSwitch>();
        Stats        = terrain.Player.GetComponentInChildren <CharacterStats>();
        UpgradeItems = terrain.canvas.GetComponentInChildren <CharacterUpgradeItems>();
    }
Exemplo n.º 4
0
 void Start()
 {
     terrain     = GameObject.FindGameObjectWithTag("MainEnvironment").GetComponent <TerrainScript>();
     armorswitch = terrain.Player.GetComponent <ArmorSwitch>();
 }