示例#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 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);
 }
示例#3
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);
 }
 public void SpawnCrystal(Vector3 position, Vector3 rotation)
 {
     for (int i = 0; i < crystals.Length; i++)
     {
         if (!crystals[i].hasCrystal)
         {
             LogCore.LogD("Spawning Imp Sorcerer Crystal");
             GameObject crystalFollower = Instantiate(crystalPrefab, position, Quaternion.Euler(rotation + new Vector3(90f, 0f)));
             crystalFollower.GetComponent <CrystalMotionManager>().referenceObject = crystals[i].crystalObject;
             NetworkServer.Spawn(crystalFollower);
             crystals[i].hasCrystal = true;
         }
     }
 }