Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- #pragma downcast
- import System.Collections.Generic;
- static var relics : List<Transform>();
- function ThrowRelic() {
- if (relics.Length > 0) {
- var n = Random.Range(0,relics.Length);
- var relicPrefab = relics[n];
- relics.RemoveAt(n);
- var newRelic : Transform = Instantiate(relicPrefab, transform.position, transform.rotation);
- newRelic.AddComponent(Rigidbody);
- newRelic.rigidbody.AddForce(Vector3.up*15,ForceMode.Impulse);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment