コード例 #1
0
 public UpdateInWorldAttribute(params WorldTypes[] types)
 {
     Types = 0;
     for (int i = 0; i < types.Length; i++)
     {
         Types |= types[i];
     }
 }
コード例 #2
0
        protected override void OnCreate()
        {
            base.OnCreate();
            //获取世界类型
            worldType = GetSingleton <WorldTypeInfo>().type;
            //创建储存已加载Prefab的实体
            var e = EntityManager.CreateEntity(ComponentType.ReadWrite <PrefabCollection>());

            collection = new PrefabCollection();
            EntityManager.AddComponentObject(e, collection);
            //初始化store
            store = new BlobAssetStore();
        }
コード例 #3
0
        public AnimationBackground3D(string AnimationBackgroundPath, ContentManager Content, GraphicsDevice g)
            : base("3D", AnimationBackgroundPath, Content, g)
        {
            FileStream   FS = new FileStream("Content/Animations/" + AnimationBackgroundPath + ".peab", FileMode.Open, FileAccess.Read);
            BinaryReader BR = new BinaryReader(FS);

            WorldType  = (WorldTypes)BR.ReadByte();
            WorldWidth = BR.ReadInt32();
            WorldDepth = BR.ReadInt32();

            DefaultCameraPosition = new Vector3(BR.ReadSingle(), BR.ReadSingle(), BR.ReadSingle());
            DefaultCameraRotation = new Vector3(BR.ReadSingle(), BR.ReadSingle(), BR.ReadSingle());
            ResetCamera();

            int ListBackgroundObjectSystemCount = BR.ReadInt32();

            for (int B = 0; B < ListBackgroundObjectSystemCount; ++B)
            {
                ListBackground.Add(AnimationBackground3DBase.LoadFromFile(Content, BR, g));
            }

            FS.Close();
            BR.Close();
        }
コード例 #4
0
ファイル: World.cs プロジェクト: Aizen-Barbaros/FLAT-Dreams
    // Generate the world values depending on the world type
    // World values include : the monster model, the number of trees, the tree mode, the sky and the fog
    public void GenerateWorldValues(int wType)
    {
        if (wType == 0)
        {
            worldType = WorldTypes.NORMAL;

            this.monsterModel  = littleMonster;
            this.numberOfTrees = 1200;
            this.treeModel     = this.oakTree;

            RenderSettings.skybox = skyNormal;
            RenderSettings.fog    = false;
        }

        else if (wType == 1)
        {
            worldType = WorldTypes.SNOWY;

            this.monsterModel  = this.snowMan;
            this.numberOfTrees = 1200;
            this.treeModel     = this.pineTree;

            RenderSettings.skybox     = skySnowy;
            RenderSettings.fog        = true;
            RenderSettings.fogMode    = FogMode.ExponentialSquared;
            RenderSettings.fogColor   = Color.white;
            RenderSettings.fogDensity = 0.03f;
        }

        else if (wType == 2)
        {
            worldType = WorldTypes.HELL;

            this.monsterModel  = this.reaper;
            this.numberOfTrees = 300;
            this.treeModel     = this.hellTree;

            RenderSettings.skybox     = skyHell;
            RenderSettings.fog        = true;
            RenderSettings.fogMode    = FogMode.ExponentialSquared;
            RenderSettings.fogColor   = Color.black;
            RenderSettings.fogDensity = 0.05f;
        }

        else if (wType == 3)
        {
            worldType = WorldTypes.DREAMY;

            this.monsterModel  = this.bear;
            this.numberOfTrees = 500;
            this.treeModel     = this.lollipopTree;

            RenderSettings.skybox = skyDreamy;
            RenderSettings.fog    = false;
        }

        else if (wType == 4)
        {
            worldType = WorldTypes.METAL;

            this.monsterModel  = this.ghost;
            this.numberOfTrees = 0;
            this.treeModel     = null;

            RenderSettings.skybox = skyMetal;
            RenderSettings.fog    = false;
        }

        else if (wType == 5)
        {
            worldType = WorldTypes.CHEESE;

            this.monsterModel  = this.gnome;
            this.numberOfTrees = 0;
            this.treeModel     = null;

            RenderSettings.skybox = skyCheese;
            RenderSettings.fog    = false;
        }

        else if (wType == 6)
        {
            worldType = WorldTypes.AUTUMN;

            this.monsterModel  = this.yeti;
            this.numberOfTrees = 1000;
            this.treeModel     = this.autumnTree;

            RenderSettings.skybox = skyAutumn;
            RenderSettings.fog    = false;
        }

        else if (wType == 7)
        {
            worldType = WorldTypes.ROTTING;

            this.monsterModel  = this.zombie;
            this.numberOfTrees = 300;
            this.treeModel     = this.rottingTree;

            RenderSettings.skybox     = skyRotting;
            RenderSettings.fog        = true;
            RenderSettings.fogMode    = FogMode.Exponential;
            RenderSettings.fogColor   = Color.green;
            RenderSettings.fogDensity = 0.1f;
        }

        else if (wType == 8)
        {
            worldType = WorldTypes.TROPICAL;

            this.monsterModel  = this.littleMonster;
            this.numberOfTrees = 500;
            this.treeModel     = this.palmtree;

            RenderSettings.skybox = skyTropical;
            RenderSettings.fog    = false;
        }

        else
        {
            worldType = WorldTypes.MATRIX;

            this.monsterModel  = this.agentSmith;
            this.numberOfTrees = 0;
            this.treeModel     = null;

            RenderSettings.skybox = skyMatrix;
            RenderSettings.fog    = false;
        }
    }
コード例 #5
0
 public UpdateInWorldAttribute(WorldTypes types)
 {
     Types = types;
 }
コード例 #6
0
 public static World.World GenerateWorld(WorldTypes type)
 {
     return(new World.Worlds.FlatWorld());
 }