示例#1
0
    // Use this for initialization
    void Start()
    {
        showCursor = false;

        gameOver        = false;
        menuVisible     = false;
        player          = GameObject.FindGameObjectWithTag("Player");
        health          = player.GetComponent <Health>();
        healthNow       = health.health;
        healthMax       = health.maxHealth;
        healthbarLength = healthNow / healthMax;


        //This and line 39 are the ways you should probably be able to get stuff. gtg lol ebin xD
        GameObject go = GameObject.FindGameObjectWithTag("GameEnv");

        gameEnv = go.GetComponent <GameEnv>();
        lives   = 3;


        quiver = GameObject.FindGameObjectWithTag("Player").GetComponent <AmmoQuiver>();
    }
示例#2
0
    public override void ApplyEffect(GameObject player)
    {
        var slot = GameObject.FindGameObjectWithTag("WeaponSlot");

        if (!slot.transform.IsChildOf(player.transform) || slot.transform.childCount == 0)
        {
            return;
        }

        var weapslot = slot.GetComponent <WeaponSlot>();

        if (weapslot == null)
        {
            return;
        }

        weapslot.SetWeapon(weapon);
        weapslot.addWeaponToInv((int)WeaponNumber, weapon);

        if (WeaponNumber == WeaponSlot.WeaponType.ROCKET_LAUNCHER)
        {
            AmmoQuiver quiver = player.GetComponent <AmmoQuiver>();
            quiver.AddRocketsToQuiver(RocketCountInPickup);
        }

        /*var weap = slot.transform.GetChild(0);
         * var fire = weap.GetComponent<AutoFire>();
         *
         * if (fire == null)
         * {
         *  return;
         * }
         *
         * fire.frequency *= 2;
         * fire.coneAngle *= 5;*/
    }
示例#3
0
 // Use this for initialization
 void Start()
 {
     //quiver = GameObject.FindGameObjectsWithTag("Player")[0].GetComponent(AmmoQuiver);
     quiver = GameObject.FindGameObjectWithTag("Player").GetComponent <AmmoQuiver>();
 }
 // Use this for initialization
 void Start()
 {
     quiver = GameObject.FindGameObjectWithTag("Player").GetComponent <AmmoQuiver>();
 }
    public override void ApplyEffect(GameObject player)
    {
        AmmoQuiver quiver = player.GetComponent <AmmoQuiver>();

        quiver.AddBulletsToQuiver(bulletsInPickup);
    }