Ejemplo n.º 1
0
    private void AddItemClickHandler(object selectedType)
    {
        Type conditionType = selectedType as Type;

        if (conditionType != null)
        {
            Condition newCondition = ScriptableObjectUtility.CreateAssetInSubfolder(selectedFeatureNames[selectedFeatureID] + "_Conditions", conditionType, feature.FeatureConditions.Count) as Condition;

            if (newCondition != null)
            {
                int id = reorderableConditionList.list.Add(newCondition);
                reorderableConditionList.index = id;
                EditorUtility.SetDirty(feature);
                AssetDatabase.SaveAssets();
                AssetDatabase.Refresh();
            }
        }
    }
    private void AddItemClickHandler(object selectedType)
    {
        Type conditionType = selectedType as Type;

        if (conditionType != null)
        {
            string    conditionPath = AssetDatabase.GetAssetPath(this);
            Condition newCondition  = ScriptableObjectUtility.CreateAssetInSubfolder(conditionPath + "_Conditions", conditionType, orCondition.ConditionsToCheck.Count) as Condition;

            if (newCondition != null)
            {
                int id = reorderableConditionList.list.Add(newCondition);
                reorderableConditionList.index = id;
                EditorUtility.SetDirty(orCondition);
                AssetDatabase.SaveAssets();
                AssetDatabase.Refresh();
            }
        }
    }