/// <summary> /// Pop returns hte ball to its orignal state. /// </summary> public void Pop() { //Restore the Scale Vector3 scale = Vector3.zero; scale.Set(originalScale, originalScale, originalScale); myTransform.localScale = scale; //Handle the physics numbers and stuff. myRigidbody.mass = Mass; myRigidbody.useGravity = true; myRigidbody.drag = originalDrag; myRigidbody.AddForce(PopForce); myRigidbody.AddTorque(PopForce); Active = false; ID = BallSourceID.Netural; shootThrough = false; body.GetComponent <Renderer>().sharedMaterial = originalMaterial; gravityControlled = false; //** Franks Add ** SetBallSourceID(Ball.BallSourceID.Netural); // ** END FRANKS ADD //Stop the trail effect. if (localtrail) { localtrail.Stop(); } if (trail) { trail.enabled = false; } //Send message to GOT GameObjectTracker.instance.BallPop(); }
public void SetBallSourceID(BallSourceID id) { ID = id; }