Ejemplo n.º 1
0
    /* 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);
    }
Ejemplo n.º 2
0
    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));
    }