Example #1
0
        protected virtual void Init_Internal()
        {
            Map = new Dictionary <FECgAssetType, Dictionary <string, MCgData> >(new FECgAssetTypeEqualityComparer());

            int count = EMCgAssetType.Get().Count;

            for (int i = 0; i < count; ++i)
            {
                Map.Add(EMCgAssetType.Get().GetEnumAt(i), new Dictionary <string, MCgData>());
            }
        }
Example #2
0
        public virtual void Init()
        {
            AssetType = EMCgAssetType.Get().GetSafeEnum(S_AssetType.Name);

            /*
             * Dictionary<string, FieldInfo> serializedFields = new Dictionary<string, FieldInfo>();
             * Dictionary<string, FieldInfo> nonSerializedFields = new Dictionary<string, FieldInfo>();
             *
             * Type type = this.GetType();
             *
             * FieldInfo[] fieldinfos = type.GetFields();
             *
             * foreach (FieldInfo f in fieldinfos)
             * {
             *  object[] attributes = f.GetCustomAttributes(true);
             *
             *  foreach (object a in attributes)
             *  {
             *      // SerializeField
             *      if (a.GetType() == typeof(SerializeField))
             *          serializedFields.Add(f.Name, f);
             *      // NonSerializedAttribute
             *      else
             *      if (a.GetType() == typeof(NonSerializedAttribute))
             *          nonSerializedFields.Add(f.Name, f);
             *  }
             * }
             *
             * Dictionary<string, FieldInfo>.KeyCollection fieldNames = serializedFields.Keys;
             *
             * foreach (string name in fieldNames)
             * {
             *  // Prefix with S_
             *  if (name.StartsWith("S_"))
             *  {
             *      string ns_name = name.Replace("S_", "");
             *
             *      FieldInfo sf  = serializedFields[name];
             *      FieldInfo nsf = nonSerializedFields[ns_name];
             *  }
             * }
             */
        }