Esempio n. 1
0
    /// 
    /// 
    /// 
    // Use this for initialization
    void Start()
    {
        WeaponManager wm = this.GetComponent<WeaponManager>();
        Debug.Log("WeaponHand");
        wm.setUpForPlay();
        wm.loadUnlockedWeapons(ref equips);

        currentEquippedWeapon = equips[0];
        fired = false;

        player = GameObject.FindWithTag("Player");
        rightHand = GameObject.Find("Beta/Beta:Hips/Beta:Spine/Beta:Spine1/Beta:Spine2/Beta:RightShoulder/Beta:RightArm/Beta:RightForeArm/Beta:RightHand");

        // Draw the initial weapons mat and mes
        renderer.material = currentEquippedWeapon.getMaterial();
        this.GetComponent<MeshFilter>().mesh  = currentEquippedWeapon.getMesh();
        this.transform.localEulerAngles = currentEquippedWeapon.getRotation();
        currentEquippedWeapon.setTransform(this.transform);
        // Load List of available weapons from InventoryManager

        //Debug.Log(reloadTime);
        // For rigidBody Ammo
        // Default is grenade launcher, this code will be changed once we have a filesystem or database to load from
        reloadTime = currentEquippedWeapon.getReloadTime();
        currentEquippedWeapon.setReloadTimer(reloadTime+1.0f);
        reloadTimer = currentEquippedWeapon.getReloadTimer();
        currentEquippedWeapon.setReloadTime(0.5f);
        //equips[0].setShotPower(1000);
        currentEquippedWeapon.setShotOffset(2);
        currentEquippedWeapon.setShotPower(900);

        /*************************************/
        // Add Weapons to equips
        // equips[i] = new Laser();
    }