示例#1
0
        static void BuildMap(WorldInfo worldInfo)
        {
            Dev.Where();

            int index = -1;

            foreach (var s in worldInfo.Scenes)
            {
                index++;

                if (s == null)
                {
                    Dev.LogWarning("WorldInfo index " + index + " is null!");
                    continue;
                }
                if (s.Transitions == null)
                {
                    Dev.LogWarning("Transitions for index " + index + " are null!");
                    continue;
                }

                MapNode node = new MapNode();
                node.scene       = s;
                node.connections = new Dictionary <string, WorldInfo.SceneInfo>();

                foreach (var connection in s.Transitions)
                {
                    var w = worldInfo.Scenes.FirstOrDefault(x => x.SceneName == connection.DestinationSceneName);

                    //invalid connection, skip
                    if (EqualityComparer <WorldInfo.SceneInfo> .Default.Equals(w, default(WorldInfo.SceneInfo)))
                    {
                        Dev.LogWarning("Skipping connection to " + connection.DestinationSceneName + " because it is invalid");
                        continue;
                    }

                    node.connections.Add(connection.DoorName, w);
                }

                //no connections, skip
                if (node.connections.Count <= 0)
                {
                    Dev.LogWarning("Skipping creation of a mapnode for scene " + s.SceneName + " because it has no valid connections");
                    continue;
                }

                map.Add(s.SceneName, node);
            }
        }
示例#2
0
        protected virtual IEnumerator Blow()
        {
            if (audioSnapshot != null)
            {
                audioSnapshot.TransitionTo(1f);
            }

            PlayOneShot(audioClips["Hornet_Fight_Death_01"]);
            PlayOneShot(audioClips["boss_explode_clean"]);

            GameObject objectToDestroy = GameObject.Find(objectToDestroyName);

            if (objectToDestroy != null)
            {
                Destroy(objectToDestroy);
            }
            else
            {
                Dev.LogWarning(objectToDestroy + " is null! Cannot destroy!");
            }

            SpawnRandomObjectsV2Data data0 = spawnRandomObjectsV2Data["ControlBlowSpawnRandomObjectsV2"];

            DoSpawnRandomObjectsV2(body, data0);

            SpawnRandomObjectsV2Data data1 = spawnRandomObjectsV2Data["ControlBlowSpawnRandomObjectsV21"];

            DoSpawnRandomObjectsV2(body, data1);

            GameObject.Instantiate <GameObject>(gameObjects["White Wave"], transform.position, Quaternion.identity);

            DoCameraEffect("AverageShake");

            nextState = Launch;
            yield break;
        }