44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using Cryville.Crtr.Skin.Components;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Cryville.Crtr {
|
|
public static class BuiltinResources {
|
|
public static Dictionary<string, Type> Components
|
|
= new();
|
|
public static Dictionary<string, Shader> Shaders
|
|
= new();
|
|
public static Dictionary<string, Mesh> Meshes
|
|
= new();
|
|
public static Dictionary<string, Material> Materials
|
|
= new();
|
|
|
|
static bool loaded;
|
|
|
|
public static void LoadDefault() {
|
|
if (loaded) return;
|
|
Components.Add("anim", typeof(SkinAnimation));
|
|
Components.Add("image", typeof(SpritePlane));
|
|
Components.Add("linesec", typeof(TrackLine));
|
|
Components.Add("mesh", typeof(MeshBase));
|
|
Components.Add("polysec", typeof(PolygonSGO));
|
|
Components.Add("rect", typeof(SpriteRect));
|
|
Components.Add("scale3", typeof(SpriteScale3));
|
|
Components.Add("sec", typeof(SectionalGameObject));
|
|
Components.Add("sprite", typeof(SpriteBase));
|
|
Components.Add("text", typeof(SpriteText));
|
|
|
|
Meshes.Add("quad", Resources.Load<Mesh>("Meshes/quad"));
|
|
Meshes.Add("quad_scale3h", Resources.Load<Mesh>("Meshes/quad_scale3h"));
|
|
|
|
Materials.Add("-SpriteMat", Resources.Load<Material>("Materials/SpriteMat"));
|
|
|
|
Shaders.Add("default", Shader.Find("Sprites/Default"));
|
|
Shaders.Add("additive", Shader.Find("Sprites/Additive"));
|
|
|
|
loaded = true;
|
|
}
|
|
}
|
|
}
|