Пример #1
0
 public static void registerDevkitObject(LevelObject levelObject, out byte x, out byte y)
 {
     if (Regions.tryGetCoordinate(levelObject.transform.position, out x, out y))
     {
         LevelObjects.objects[(int)x, (int)y].Add(levelObject);
         if (LevelObjects.regions[(int)x, (int)y])
         {
             levelObject.enableCollision();
             if (!levelObject.isSpeciallyCulled)
             {
                 levelObject.enableVisual();
             }
             levelObject.disableSkybox();
         }
         else
         {
             levelObject.disableCollision();
             if (!levelObject.isSpeciallyCulled)
             {
                 levelObject.disableVisual();
             }
             if (levelObject.isLandmarkQualityMet)
             {
                 levelObject.enableSkybox();
             }
         }
     }
     else
     {
         levelObject.enableCollision();
         if (!levelObject.isSpeciallyCulled)
         {
             levelObject.enableVisual();
         }
         levelObject.disableSkybox();
     }
 }
Пример #2
0
        public static Transform addObject(Vector3 position, Quaternion rotation, Vector3 scale, ushort id, string name, Guid GUID, ELevelObjectPlacementOrigin placementOrigin)
        {
            byte b;
            byte b2;

            if (Regions.tryGetCoordinate(position, out b, out b2))
            {
                LevelObject levelObject = new LevelObject(position, rotation, scale, id, name, GUID, placementOrigin, LevelObjects.generateUniqueInstanceID());
                levelObject.enableCollision();
                levelObject.enableVisual();
                levelObject.disableSkybox();
                LevelObjects.objects[(int)b, (int)b2].Add(levelObject);
                LevelObjects._total++;
                return(levelObject.transform);
            }
            return(null);
        }