Esempio n. 1
0
    public void ChangeWeapon(GameObject P_Weapon_Name)
    {
        string remove   = "(Clone)";
        string Original = P_Weapon_Name.name;
        string result   = Original.Replace(remove, "");
        //----------------------------------------------------------
        GameObject PlayerGunSprite = GameObject.Find(result + "_Weapon");

        Debug.Log(PlayerGunSprite.name);
        //PlayerGunSprite.GetComponent<CurrentGunSprite>().ChangeGun(GunNum);
        //-----------------------------------------------------------

        GameObject PlayerGun    = GameObject.Find(result + "_Gun");
        GameObject PlayerObject = GameObject.Find(P_Weapon_Name.name);
        //Debug.Log(PlayerObject.name);
        RigidWeapon P_Gun = PlayerGun.GetComponent <RigidWeapon>();//Butt lady throws error here

        //Ammo Section-------------------------------------------------
        PlayerObject.GetComponent <PlayerAmmo>().AddClip();
        P_Gun.Ammo = 22;
        //Gun Properties Section---------------------------------------
        P_Gun.TypeOfBullet = Weapon;
        P_Gun.burstSize    = BurstSize;
        P_Gun.ReloadSpeed  = reload_speed;
        P_Gun.ShotGunMode  = ShotGunMode;
        if (ShotGunMode == true)
        {
            P_Gun.ShotGunBullets = 4;
        }
        P_Gun.Gunsound = GunsoundObject.GetComponent <AudioSource>();;
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        MainCanvas    = GameObject.Find("Main_Canvas");
        CurrentHealth = PlayerHP;
        Deathsound    = GameObject.Find(DeathSoundName).GetComponent <AudioSource>();

        Player = PlayerAnimation; //GameObject.Find("_ButtLady_Anim");
        Weapon = PlayerWeapon;    // GameObject.Find("_ButtLady_Weapon");
        Gun    = PlayerGun;       // GameObject.Find("_ButtLady_Gun");
        RigidWeapon thigny = Gun.GetComponent <RigidWeapon>();

        thigny.enabled = false;



        anim = Player.GetComponent <Animator>();
    }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     Bullet = WeaponFirepoint.GetComponent <RigidWeapon>();
 }