Beispiel #1
0
    private Project CreateSimpleProject()
    {
        var project = new Project();

        var palette = new Palette();
        project.AddPalette(palette);

        for (int i = 1; i < 16; ++i)
        {
            palette.colors[i] = new Color(Random.value, Random.value, Random.value, 1f);
        }

        var tile = project.CreateDynamicTile();
        tile.minitiles[0].mTexture.SetPixels(autoTileTemplate.GetPixels()
                                                           .Select(color =>
                                                           {
                                                               if (color.a == 0)
                                                               {
                                                                   return (byte) 3;
                                                               }
                                                               else if (color.r == 0)
                                                               {
                                                                   return (byte) 1;
                                                               }
                                                               else
                                                               {
                                                                   return (byte) 2;
                                                               }
                                                           })
                                                           .ToArray());
        tile.minitiles[0].mTexture.Apply();

        for (int i = 0; i < 2; ++i)
        {
            project.CreateDynamicTile(false);
        }

        CreateSimpleScene(project);

        return project;
    }