예제 #1
0
        public TemplateSettingStatus(SerializedObject targetSerializedObject)
        {
            TargetSerializedObject = targetSerializedObject;
            TargetTemplateSetting  = targetSerializedObject.targetObject as TemplateSetting;

            var names = Enum.GetNames(typeof(Property));

            _properties = new SerializedProperty[names.Length];
            for (int i = 0; i < _properties.Length; ++i)
            {
                _properties[i] = targetSerializedObject.FindProperty(names[i]);
            }

            ChainReorderableList = new ReorderableList(targetSerializedObject, GetProperty(Property.Chain))
            {
                drawElementCallback = DrawChainListElement,
                drawHeaderCallback  = (rect) => { EditorGUI.LabelField(rect, "List"); },
            };
        }
예제 #2
0
        public static void AddTempCreatePrefabSetting(TemplateSetting setting, string scriptPath)
        {
            // Add Setting Id
            var prefabSettings = SessionState.GetIntArray(TempCreatePrefabSettingIdsKey, null);

            if (prefabSettings == null)
            {
                prefabSettings = new int[] { setting.GetInstanceID() };
            }
            else
            {
                var length      = prefabSettings.Length;
                var newSettings = new int[length + 1];
                prefabSettings.CopyTo(newSettings, 0);
                newSettings[length] = setting.GetInstanceID();

                prefabSettings = newSettings;
            }

            SessionState.SetIntArray(TempCreatePrefabSettingIdsKey, prefabSettings);

            // Set Script Path
            SessionState.SetString(string.Format(TempCreateScriptPathKeyFormat, setting.GetInstanceID()), scriptPath);
        }
 public ProcessMetadata(TemplateSetting setting)
 {
     this.setting = setting;
 }