public Bullet2 Initialize() { rb = GetComponent<Rigidbody>(); pb = new PhysicsBehaviour(This); //pb.setGravityFactor(1.2F); pb.setGravityFactor(1.4F); this.spawnTime = Time.time; return this; }
public Bullet Initialize() { rb = GetComponent<Rigidbody> (); pb = new PhysicsBehaviour (go); pb.setGravityFactor (1.2F); this.lifeSpan = 1.0F; this.spawnTime = Time.time; return this; }
void Awake() { this.damageText = GameObject.Find("Player" + id + "_text/damage" + id).GetComponent<TextMesh> (); this.liveText = GameObject.Find ("Player" + id + "_text/lives" + id).GetComponent<TextMesh> (); weapon = GetComponent<Weapon2> (); weapon.setOwner (spine); currentWeapons = new WeaponType[2]; game = FindObjectOfType<Game> (); rb = spine.GetComponent<Rigidbody> (); pb = new PhysicsBehaviour (spine); this.rb.mass = 5.0F; nextFire = new float[2]; nextFire [0] = Time.time; nextFire [1] = Time.time; weaponFireSources = spine.GetComponents<AudioSource> (); weaponFireSources [0].clip = audioClips [0]; weaponFireSources [1].clip = audioClips [1]; //weaponFireSources [0].volume = 0.065F; //weaponFireSources [1].volume = 0.065F; weaponFireSources [0].volume = 0.007F; weaponFireSources [1].volume = 0.007F; currentWeapons [0] = WeaponType.MACHINEGUN; currentWeapons [1] = WeaponType.SHOTGUN; upperLeftArm = spine.transform.Find ("chest/shoulder.L/upper_arm.L").gameObject; upperRightArm = spine.transform.Find ("chest/shoulder.R/upper_arm.R").gameObject; leftHand = upperLeftArm.transform.Find ("forearm.L/hand.L").gameObject; rightHand = upperRightArm.transform.Find ("forearm.R/hand.R").gameObject; }