Inheritance: UnityEngine.ScriptableObject
        private ConnectionGUI(ConnectionData data, ConnectionPointData output, ConnectionPointData input)
        {
            UnityEngine.Assertions.Assert.IsTrue(output.IsOutput, "Given Output point is not output.");
            UnityEngine.Assertions.Assert.IsTrue(input.IsInput, "Given Input point is not input.");

            m_inspector           = ScriptableObject.CreateInstance <ConnectionGUIInspectorHelper>();
            m_inspector.hideFlags = HideFlags.DontSave;

            this.m_data        = data;
            this.m_outputPoint = output;
            this.m_inputPoint  = input;

            connectionButtonStyle = "sv_label_0";
        }
Beispiel #2
0
        private ConnectionGUI(string label, string connectionId, string startNodeId, ConnectionPoint output, string endNodeId, ConnectionPoint input)
        {
            conInsp           = ScriptableObject.CreateInstance <ConnectionGUIInspectorHelper>();
            conInsp.hideFlags = HideFlags.DontSave;

            this.label        = label;
            this.connectionId = connectionId;

            this.outputNodeId = startNodeId;
            this.outputPoint  = output;
            this.inputNodeId  = endNodeId;
            this.inputPoint   = input;

            connectionButtonStyle = "sv_label_0";
        }
        private ConnectionGUI(string label, string id, ConnectionPointData output, ConnectionPointData input)
        {
            UnityEngine.Assertions.Assert.IsTrue(output.IsOutput, "Given Output point is not output.");
            UnityEngine.Assertions.Assert.IsTrue(input.IsInput, "Given Input point is not input.");

            conInsp           = ScriptableObject.CreateInstance <ConnectionGUIInspectorHelper>();
            conInsp.hideFlags = HideFlags.DontSave;

            this.label = label;
            this.id    = id;

            this.outputPoint = output;
            this.inputPoint  = input;

            connectionButtonStyle = "sv_label_0";
        }
Beispiel #4
0
        public override void OnInspectorGUI()
        {
            ConnectionGUIInspectorHelper helper = target as ConnectionGUIInspectorHelper;

            var con = helper.connectionGUI;

            if (con == null)
            {
                return;
            }

            var foldouts = helper.foldouts;

            var count       = 0;
            var assetGroups = helper.assetGroups;

            if (assetGroups == null)
            {
                return;
            }

            foreach (var assets in assetGroups.Values)
            {
                count += assets.Count;
            }

            EditorGUILayout.LabelField("Total", count.ToString());

            var redColor = new GUIStyle(EditorStyles.label);

            redColor.normal.textColor = Color.gray;

            var index = 0;

            foreach (var groupKey in assetGroups.Keys)
            {
                var assets = assetGroups[groupKey];

                var foldout = foldouts[index];

                foldout = EditorGUILayout.Foldout(foldout, "Group Key:" + groupKey);
                if (foldout)
                {
                    EditorGUI.indentLevel = 1;
                    for (var i = 0; i < assets.Count; i++)
                    {
                        var sourceStr   = assets[i].path;
                        var variantName = assets[i].variantName;

                        if (!string.IsNullOrEmpty(variantName))
                        {
                            EditorGUILayout.LabelField(string.Format("{0}[{1}]", sourceStr, variantName));
                        }
                        else
                        {
                            EditorGUILayout.LabelField(sourceStr);
                        }
                    }
                    EditorGUI.indentLevel = 0;
                }
                foldouts[index] = foldout;

                index++;
            }
        }