Exemplo n.º 1
0
        public override void OnExport(ExportErrors err)
        {
            // Set the collider's size
            var collider = GetComponent <BoxCollider>();
            var size     = GetComponent <RectTransform>().sizeDelta;

            collider.size = new Vector3(size.x, size.y, 1);
        }
Exemplo n.º 2
0
        public override void Validate(Scene scene, CustomScene root, ExportErrors err)
        {
            // Let the base validate
            base.Validate(scene, root, err);

            // Check for a spawn
            RequiredComponents <Spawn>(1, 1);
        }
Exemplo n.º 3
0
        public override void Validate(Scene scene, CustomScene root, ExportErrors err)
        {
            // Let base validate
            base.Validate(scene, root, err);

            RequiredComponents <ShoothouseManager>(1, 1);
            RequiredComponents <ShoothouseStage>(1, int.MaxValue);
            //RequiredComponents<ShoothouseScoreboard>(1, 1);
        }
Exemplo n.º 4
0
        public override void OnExport(ExportErrors err)
        {
            // Make sure the nav blockers are disabled
            NavBlockers.SetActive(false);

            // Make sure we have at least 9 defense points
            if (SpawnPoints_Sosigs_Defense.AsEnumerable().Count() < 9)
            {
                err.AddError("Holds must have at least 9 Sosig Defense Spawn Points.", this);
            }
        }
Exemplo n.º 5
0
        public override void Validate(Scene scene, CustomScene root, ExportErrors err)
        {
            // Base validate
            base.Validate(scene, root, err);

            // Check for all required components
            RequiredComponents <Scoreboard>(1, 1);
            RequiredComponents <Respawn>(1, 1);
            RequiredComponents <TNH_HoldPoint>(2);
            RequiredComponents <TNH_SupplyPoint>(3);
            RequiredComponents <ForcedSpawn>(0, 1);
        }
Exemplo n.º 6
0
 public override void OnExport(ExportErrors err)
 {
     if (SosigTypes.Length == 0)
     {
         err.AddError("Sosig Spawner has no types to spawn!", this);
     }
     if (SpawnDelay < 0)
     {
         err.AddError("Sosig Spawner cannot have a spawn delay of less than zero", this);
     }
     if (SpawnInterval < 0)
     {
         err.AddError("Sosig Spawner cannot have a spawn interval of less than zero", this);
     }
     if (SpawnCount < 0)
     {
         err.AddError("Sosig Spawner cannot have a spawn count of less than zero", this);
     }
 }
Exemplo n.º 7
0
        /// <summary>
        /// This is called to validate the scene and ensure it can be exported.
        /// <strong>If you override this, make sure to call <code>base.Validate(scene, root, err)</code>! (Preferably before your code)</strong>
        /// Also, do NOT return early from this method unless absolutely necessary. Validate as many thing as you can.
        /// </summary>
        /// <param name="scene">The scene to export</param>
        /// <param name="root">The root game object</param>
        /// <param name="err">An object used to inform the exporter what's happened</param>
        public virtual void Validate(Scene scene, CustomScene root, ExportErrors err)
        {
            // Save these for later.
            _scene = scene;
            _root  = root;
            _err   = err;

            // Check for NavMesh and Occlusion data
            // These aren't *required* so they will only be warnings
            if (!File.Exists(Path.GetDirectoryName(scene.path) + "/" + scene.name + "/NavMesh.asset"))
            {
                err.AddWarning("Scene is missing NavMesh data!");
            }
            if (!File.Exists(Path.GetDirectoryName(scene.path) + "/" + scene.name + "/OcclusionCullingData.asset"))
            {
                err.AddWarning("Scene is missing Occlusion Culling Data!");
            }

            // Let the proxied components know we're about to export
            foreach (var proxy in scene.GetRootGameObjects().SelectMany(x => x.GetComponentsInChildren <ComponentProxy>()))
            {
                proxy.OnExport(err);
            }
        }
Exemplo n.º 8
0
 public override void OnExport(ExportErrors err)
 {
     Skybox = RenderSettings.skybox;
 }
Exemplo n.º 9
0
 public override void OnExport(ExportErrors err)
 {
     // We needs this to be a trigger on the ColOnlyHead layer.
     GetComponent <Collider>().isTrigger = true;
     gameObject.layer = LayerMask.NameToLayer("ColOnlyHead");
 }
Exemplo n.º 10
0
 public override void OnExport(ExportErrors err)
 {
     // This needs to be a trigger on the interactable layer
     GetComponent <Collider>().isTrigger = true;
     gameObject.layer = LayerMask.NameToLayer("Interactable");
 }
Exemplo n.º 11
0
 /// <summary>
 ///     This is called before the map is exported. Put one-time calculations and component validations here.
 /// </summary>
 public virtual void OnExport(ExportErrors err)
 {
 }