Esempio n. 1
0
        private static GameObject CreateGoal(Vector3 position)
        {
            GameObject ret = TileCreator.CreateCube(position, Vector3.One, Quaternion.Identity,
                                                    TextureLoader.ColorToTexture(Color.Red), DefaultFilepaths.DefaultLitShader,
                                                    TextureLoader.ColorToTexture(Color.White));

            ret.AddComponent(new MapEndTrigger());
            return(ret);
        }
Esempio n. 2
0
        private GameObject CreateGround(Bitmap mapLayout, Vector3 scale, Size size)
        {
            Texture tex  = TextureLoader.BitmapToTexture(new Bitmap(mapLayout, 512, 512), "GroundTexture");
            Texture texS = TextureLoader.BitmapToTexture(new Bitmap(mapLayout, 512, 512), "GroundSpecular");


            TextureGenerator.CreateGroundTexture(tex, texS);
            GameObject ret = TileCreator.CreateCube(Vector3.Zero, scale, Quaternion.Identity,
                                                    tex, DefaultFilepaths.DefaultLitShader, new Vector2(size.Height, size.Width), Vector2.Zero, texS);

            ret.Name = "Ground";
            Collider groundColl = ret.GetComponent <Collider>();

            groundColl.PhysicsCollider.Material = new Material(10, 10, 0);
            return(ret);
        }