Exemple #1
0
    //Class
    //Equipment
    //Etc
    void Awake()
    {
        if (WeaponRack == null)
            WeaponRack = GameObject.Find("WeaponRack");

        GameObject tempWeapon = (GameObject)Instantiate( WeaponRack.GetComponent<WeaponRack>().AssaultRifle);
        tempWeapon.transform.parent = gameObject.transform;
        MyWeapon = tempWeapon.GetComponent<Weapon>();
        MyWeapon.SetPlayerControl(this);
    }