示例#1
0
    private void OnTriggerStay(Collider other)
    {
        if (other.gameObject.tag == "Wand" && Input.GetKeyDown(KeyCode.Joystick1Button0))
        {
            print("Step 1 works");
            if (other.gameObject.GetComponent <WandStats>().pickUp)
            {
                print("Step 2 works");
                WandStats newWand = other.gameObject.GetComponent <WandStats>();
                AddNewWand(other.gameObject);
                other.gameObject.SetActive(false);
            }
        }


        if (other.gameObject.tag == "Bullet" && invinceFrames == 0)
        {
            CurrentHealth--;
        }

        if (other.gameObject.tag == "Wand")
        {
            print("WandHere");
        }

        if (other.gameObject.tag == "Enemy" && invinceFrames != 0)
        {
            if (other.gameObject.GetComponent <BaseAIScript>().Health < other.gameObject.GetComponent <BaseAIScript>().maxHealth / 10)
            {
                Destroy(other.gameObject);
                manaPool++;
            }
        }

        if (other.gameObject.tag == "Chest" && manaPool == 5 && Input.GetKeyDown(KeyCode.Joystick1Button0))
        {
            other.gameObject.GetComponent <ChestScript>().OpenChest();
        }
    }
示例#2
0
 private void equipNewWand()
 {
     equippedWandStats = equippedWand.GetComponent <WandStats>();
     Wand = equippedWand;
     Wand.transform.SetParent(HandLocation);
 }