void Init() { //Debug. if (ConcertTarget.ModelList.Count == 0) { ConcertTarget.ModelList.AddRange(HontPostProcessingUtility.InstancesFromBaseClass <HontPostProcessingModelBase>()); } mModelEditorList = new List <HontPostProcessingModelEditorBase>(); var allModelEditorList = HontPostProcessingUtility.InstancesFromBaseClass <HontPostProcessingModelEditorBase>(); for (int i = 0, iMax = ConcertTarget.ModelList.Count; i < iMax; i++) { var model = ConcertTarget.ModelList[i]; var targetModelEditor = allModelEditorList.Find(m => IsAttributeMatchedModel(model, m.GetType().GetCustomAttributes(false))); if (targetModelEditor != null) { targetModelEditor.Init(model); mModelEditorList.Add(targetModelEditor); } } mIsInitialized = true; }
void ISerializationCallbackReceiver.OnAfterDeserialize() { try { var extraTypes = HontPostProcessingUtility.GetChildrenClasses <HontPostProcessingModelBase>(); mModelList = XmlSerializationHelper.DeSerializationFromString <List <HontPostProcessingModelBase> >(modelSerializeData, extraTypes); } catch { } }
public void Init(Camera camera) { mContext = new HontPostProcessingContext() { Camera = camera }; mComponentList = HontPostProcessingUtility.InstancesFromBaseClass <HontPostProcessingComponentBase>(); for (int i = 0, iMax = mComponentList.Count; i < iMax; i++) { var item = mComponentList[i]; var matchModel = mModelList.Find(m => m.Name == item.Name); item.Init(mContext, matchModel); } }
void ISerializationCallbackReceiver.OnBeforeSerialize() { var extraTypes = HontPostProcessingUtility.GetChildrenClasses <HontPostProcessingModelBase>(); modelSerializeData = XmlSerializationHelper.SerializationToString(mModelList, extraTypes); }