public SwordThrowProjectile SpawnThrownSword(bool addToTree = true, Node overrideParent = null) { Node parent = SelectParent(addToTree, overrideParent); SwordThrowProjectile result = ZqfGodotUtils.CreateInstance <SwordThrowProjectile>(Path_ThrownSword, parent); return(result); }
public T Spawn <T>(string path) { T obj = ZqfGodotUtils.CreateInstance <T>(path); _root.AddChild(obj as Node); return(obj); }
public GFXQuick SpawnGFX(string path, bool addToTree = true, Node overrideParent = null) { if (string.IsNullOrEmpty(path)) { path = Path_PointProjectile; } Node parent = SelectParent(addToTree, overrideParent); return(ZqfGodotUtils.CreateInstance <GFXQuick>(path, parent)); }
public EntMob SpawnMob(string mobTypeName = "") { MobDef mobType = GetMobType(mobTypeName); // Pass a null parent as we need to init the mob before adding it to the tree // which will invoke _ready EntMob mob = ZqfGodotUtils.CreateInstance <EntMob>(mobType.prefabPath, null); mob.SetMobType(mobType); _root.AddChild(mob); return(mob); }
public PointProjectile SpawnPointProjectile(bool addToTree = true, Node overrideParent = null) { Node parent = SelectParent(addToTree, overrideParent); return(ZqfGodotUtils.CreateInstance <PointProjectile>(Path_PointProjectile, parent)); }
public EntPlayer SpawnPlayer() { EntPlayer plyr = ZqfGodotUtils.CreateInstance <EntPlayer>(Path_EntPlayer, _root); return(plyr); }