using ShadowStudio.Model; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace ShadowStudio.Model { /// /// Unity组件,例如Cube,Sphere,Cylinder等基本几何体 /// public class UnityBaseHandler : ArtInstanceHandler { public override UnityEngine.Object LoadArt() { if (!LoadCache && Info != null) { int type; if (int.TryParse(Info.Url, out type)) { var obj = GameObject.CreatePrimitive((PrimitiveType)type); if (obj) { obj.SetActive(false); } LoadCache = obj; } } return LoadCache; } public override void LoadArtAsyn(string path, Action process, Action loaded) { process?.Invoke(1); loaded?.Invoke(LoadArt()); } } }