void Awake() { _rb = GetComponent<Rigidbody>(); _bounceBack = GetComponent<BounceBack>(); _collSound = (AudioSource)gameObject.AddComponent<AudioSource>(); _collSound.clip = (AudioClip)Resources.Load("Audio/coll2"); }
// Use this for initialization void Start() { _bounceBack = GetComponent<BounceBack> (); _rb = GetComponent<Rigidbody> (); _rb.AddForce( transform.right * 500 ); }