[RCC(12)]
static GameObject OnCreate (GameObject prefab, Vector3 pos, Quaternion rot, Items unitName)
{
GameObject go = Instantiate(prefab, pos, rot) as GameObject;
ItemPickup cat = go.transform.GetChild (0).GetComponent<ItemPickup>();
cat._thisItem = unitName;
return go;
}
static public void Create (GameObject prefab, Vector3 pos, Quaternion rot, Items unitName, bool persistent = true)
{
TNManager.CreateEx(12, persistent, prefab, pos, rot, unitName);
}
[RCC(13)]
static GameObject OnCreateWeapon (GameObject prefab, Vector3 pos, Quaternion rot, Weapons unitName)
{
GameObject go = Instantiate(prefab, pos, rot) as GameObject;
ItemPickup cat = go.transform.GetChild (0).GetComponent<ItemPickup>();
cat._thisWeapon = unitName;
return go;
}
static public void CreateWeapon (GameObject prefab, Vector3 pos, Quaternion rot, Weapons unitName, bool persistent = true)
{
TNManager.CreateEx(13, persistent, prefab, pos, rot, unitName);
}
public void DropItems() {
if (weaponsToDrop.Count > 0) {
int loop = 0;
for (loop = 0; loop < weaponsToDrop.Count; loop++ ) {
temp = (Resources.Load ("DropItems/" + weaponsToDrop[loop].Name)) as GameObject;
CreateWeapon (temp, itemDropTransformLocation.position, itemDropTransformLocation.rotation, weaponsToDrop[loop], false);
temp.rigidbody.AddForce (itemDropTransformLocation.forward * 200);
temp.rigidbody.AddForce (Vector3.up * 200);
}
weaponsToDrop.Clear ();
}
if (itemsToDrop.Count > 0) {
int loop2 = 0;
for (loop2 = 0; loop2 < itemsToDrop.Count; loop2++ ) {
temp = (Resources.Load ("DropItems/" + weaponsToDrop[loop2].Name)) as GameObject;
Create (temp, itemDropTransformLocation.position, itemDropTransformLocation.rotation, itemsToDrop[loop2], false);
temp.rigidbody.AddForce (itemDropTransformLocation.forward * 200);
temp.rigidbody.AddForce (Vector3.up * 200);
}
itemsToDrop.Clear ();
}
}