コード例 #1
0
        protected static void AddVariable(object obj)
        {
            System.Type t = obj as System.Type;
            if (t == null)
            {
                return;
            }

            Undo.RecordObject(curFlowchart, "Add Variable");
            Variable newVariable = curFlowchart.gameObject.AddComponent(t) as Variable;

            newVariable.Key = curFlowchart.GetUniqueVariableKey("");
            curFlowchart.Variables.Add(newVariable);

            // Because this is an async call, we need to force prefab instances to record changes
            PrefabUtility.RecordPrefabInstancePropertyModifications(curFlowchart);
        }