示例#1
0
 /// <summary>
 /// Adds a GameObject to the master catalog and returns true
 /// GameObject must be non-null and have a CharacterMaster component
 /// returns false if GameObject is null or is missing the component
 /// </summary>
 /// <param name="master">The master to register to the master catalog.</param>
 /// <returns></returns>
 public static bool RegisterNewMaster(GameObject master)
 {
     if (master && master.HasComponent <CharacterMaster>())
     {
         EnigmaticThunder.Modules.Masters.RegisterMaster(master);
         LogCore.LogD("Registered master " + master.name + " to the master catalog!");
         return(true);
     }
     LogCore.LogF("FATAL ERROR: " + master.name + " failed to register to the master catalog!");
     return(false);
 }
示例#2
0
 /// <summary>
 /// Adds a GameObject to the body catalog and returns true
 /// GameObject must be non-null and have a CharacterBody component
 /// returns false if GameObject is null or is missing the component
 /// </summary>
 /// <param name="bodyObject">The body to register to the body catalog.</param>
 /// <returns></returns>
 public static bool RegisterNewBody(GameObject bodyObject)
 {
     if (bodyObject)
     {
         EnigmaticThunder.Modules.Bodies.RegisterBody(bodyObject);// += list => list.Add(bodyObject);
         LogCore.LogD("Registered body " + bodyObject.name + " to the body catalog!");
         return(true);
     }
     LogCore.LogF("FATAL ERROR:" + bodyObject.name + " failed to register to the body catalog!");
     return(false);
 }
示例#3
0
 /// <summary>
 /// Adds a GameObject to the projectile catalog and returns true
 /// GameObject must be non-null and have a ProjectileController component
 /// returns false if GameObject is null or is missing the component
 /// </summary>
 /// <param name="projectileObject">The projectile to register to the projectile catalog.</param>
 /// <returns></returns>
 public static bool RegisterNewProjectile(GameObject projectileObject)
 {
     if (projectileObject.HasComponent <ProjectileController>())
     {
         EnigmaticThunder.Modules.Projectiles.RegisterProjectile(projectileObject);
         LogCore.LogD("Registered projectile " + projectileObject.name + " to the projectile catalog!");
         return(true);
     }
     LogCore.LogF("FATAL ERROR:" + projectileObject.name + " failed to register to the projectile catalog!");
     return(false);
 }
示例#4
0
 /// <summary>
 /// Destroys generic skill components attached to the survivor object and creates an empty SkillFamily.
 /// </summary>
 /// <param name="survivor"></param>
 public static void CreateEmptySkills(GameObject survivor)
 {
     if (survivor)
     {
         DestroyGenericSkillComponents(survivor);
         CreateEmptySkillFamily(survivor);
     }
     else
     {
         LogCore.LogF("Tried to create empty skills on a null GameObject!");
     }
 }