Esempio n. 1
0
    // Use this for initialization
    void Awake()
    {
        playerStats           = FindObjectOfType <PlayerStats>();
        pauseMenuScript       = FindObjectOfType <PauseMenu>();
        playerHealthScript    = FindObjectOfType <PlayerHealthManager>();
        playerStaminaScript   = FindObjectOfType <PlayerStaminaManager>();
        itemSlotManagerScript = FindObjectOfType <ItemSlotManager>();

        VitalityButton     = GameObject.Find("VitalityButton");
        StrengthButton     = GameObject.Find("StrengthButton");
        DexterityButton    = GameObject.Find("DexterityButton");
        IntelligenceButton = GameObject.Find("IntelligenceButton");

        ItemSlot0AButton = GameObject.Find("ItemSlot0AButton");
        ItemSlot0BButton = GameObject.Find("ItemSlot0BButton");
        ItemSlot0CButton = GameObject.Find("ItemSlot0CButton");
        ItemSlot0DButton = GameObject.Find("ItemSlot0DButton");
        ItemSlot0EButton = GameObject.Find("ItemSlot0EButton");
        ItemSlot1AButton = GameObject.Find("ItemSlot1AButton");
        ItemSlot1BButton = GameObject.Find("ItemSlot1BButton");
        ItemSlot1CButton = GameObject.Find("ItemSlot1CButton");
        ItemSlot1DButton = GameObject.Find("ItemSlot1DButton");
        ItemSlot1EButton = GameObject.Find("ItemSlot1EButton");
        ItemSlot2AButton = GameObject.Find("ItemSlot2AButton");
        ItemSlot2BButton = GameObject.Find("ItemSlot2BButton");
        ItemSlot2CButton = GameObject.Find("ItemSlot2CButton");
        ItemSlot2DButton = GameObject.Find("ItemSlot2DButton");
        ItemSlot2EButton = GameObject.Find("ItemSlot2EButton");
        ItemSlot3AButton = GameObject.Find("ItemSlot3AButton");
        ItemSlot3BButton = GameObject.Find("ItemSlot3BButton");
        ItemSlot3CButton = GameObject.Find("ItemSlot3CButton");
        ItemSlot3DButton = GameObject.Find("ItemSlot3DButton");
        ItemSlot3EButton = GameObject.Find("ItemSlot3EButton");

        HeadSlotButton  = GameObject.Find("HeadButton");
        BodyArmorButton = GameObject.Find("BodyArmorButton");
        GlovesButton    = GameObject.Find("GlovesButton");
        BootsButton     = GameObject.Find("BootsButton");
        RingOneButton   = GameObject.Find("RingOneButton");
        RingTwoButton   = GameObject.Find("RingTwoButton");
        RingThreeButton = GameObject.Find("RingThreeButton");
        RingFourButton  = GameObject.Find("RingFourButton");

        descriptionText = GameObject.Find("DescriptionText").GetComponent <Text>();

        justSwitched = true;
    }
Esempio n. 2
0
        private void Start()
        {
            Physics2D.IgnoreLayerCollision(LayerMask.NameToLayer("ItemInWorld"), LayerMask.NameToLayer("Entity"));

            var canvas      = GameObject.FindGameObjectWithTag("Canvas");
            var inventoryUI = canvas.transform.Find("InventoryUI");

            itemSlotManager = inventoryUI.Find("Items").GetComponent <ItemSlotManager>();

            audioSource = GetComponent <AudioSource>();
            sound       = Resources.Load <AudioClip>(@"Sounds/geo_small_collect_1");
            var     rb        = GetComponent <Rigidbody2D>();
            float   rand      = UnityEngine.Random.Range(-0.6f, 0.6f);
            float   thrust    = UnityEngine.Random.Range(200f, 300f);
            Vector2 direction = new Vector2(rand, 1);

            rb.AddForce(direction * thrust, ForceMode2D.Impulse);
        }
    void Start()
    {
        thePlayer         = FindObjectOfType <PlayerController>();
        loadNewAreaScript = FindObjectOfType <LoadNewArea>();

        theDM = FindObjectOfType <DialogueManager>();

        playerObject          = GameObject.Find("Player");
        itemSlotManagerScript = FindObjectOfType <ItemSlotManager>();

        playerHealth = playerObject.GetComponent <PlayerHealthManager>();
        globalData   = FindObjectOfType <GlobalDataScript>();

        if (!reloadExists)
        {
            reloadExists = true;
        }
    }
 private void Start()
 {
     _itemSlotManager = transform.parent.GetComponent <ItemSlotManager>();
 }
Esempio n. 5
0
 // Use this for initialization
 void Awake()
 {
     itemSlotManagerScript = FindObjectOfType <ItemSlotManager>();
     playerStatsScript     = FindObjectOfType <PlayerStats>();
 }
 private void Start()
 {
     m_ism = FindObjectOfType <ItemSlotManager>();
 }
 public void TestCalculateCooldownLevel()
 {
     Assert.AreEqual(ItemSlotManager.CalculateCooldownLevel(0.5f), 4);
     Assert.AreEqual(ItemSlotManager.CalculateCooldownLevel(1), 8);
     Assert.AreEqual(ItemSlotManager.CalculateCooldownLevel(0), 0);
 }
Esempio n. 8
0
 public void SetItemSlotManager(ItemSlotManager newSlotManager)
 {
     _itemSlotManager = newSlotManager;
 }