/* Static Methods */ // Create a new bullet instance public static Bullet create(GameObject bullet, Entity source, Entity.Faction faction = Entity.Faction.neutral) { GameObject inst = (GameObject)Instantiate(bullet, source.transform.position, source.transform.rotation); Bullet b = inst.GetComponent <Bullet> (); b.faction = faction; b.source = source; return(b); }
public static Bullet create(string prefabName, Entity source, Entity.Faction faction = Entity.Faction.neutral) { GameObject go = Resources.Load <GameObject> ("Prefabs/Bullets/" + prefabName); return(create(go, source, faction)); }