Пример #1
0
 public override void OnLoad()
 {
     foreach (var kv in typeDic)
     {
         kv.Value.ClassID = YAMLClassID.ClassID(kv.Key);
     }
 }
Пример #2
0
        //取得
        int ClassID(Type type)
        {
            if (type.IsSubclassOf(type_mono))
            {
                return(115); //特殊的
            }
            if (type.IsSubclassOf(type_ScriptableObject))
            {
                return(115); //特殊的
            }
            Type b = type.BaseType;

            while (b != null)
            {
                //基类必须在UnityEngine
                if (b.Module.ToString() == "UnityEngine.dll")
                {
                    int ClassID = YAMLClassID.ClassID(b.Name);
                    return(ClassID);
                }
                b = b.BaseType;
            }
            ;
            return(0);
        }