Example #1
0
        protected virtual void DrawCollection(IReadOnlyCurrencyCollection <ICurrency, double> collection, int priority)
        {
            EditorGUILayout.LabelField("Name: ", collection?.ToString());
            EditorGUILayout.LabelField("Priority: ", priority + " (general)");

            EditorGUILayout.LabelField("Currencies: ", UnityEditor.EditorStyles.boldLabel);
            EditorGUI.indentLevel++;
            foreach (var dec in collection?.ToDecorators() ?? new CurrencyDecorator <double> [0])
            {
                EditorGUILayout.LabelField(dec.currency.ToString(), dec.amount.ToString());
            }
            EditorGUI.indentLevel--;
        }
        protected override void DrawCollection(IReadOnlyCurrencyCollection <ICurrency, double> collection, int priority)
        {
            base.DrawCollection(collection, priority);

            var unetCol = collection as IUNetCollection;

            if (unetCol != null)
            {
                var t        = (InventoryPlayer)target;
                var identity = t.GetComponent <NetworkIdentity>();
                if (identity != null)
                {
                    var permission = UNetPermissionsRegistry.collections.GetPermission(unetCol, identity);
                    EditorGUILayout.LabelField("Permission: ", permission.ToString());
                }

//                if (GUILayout.Button("Inspect collection", "minibutton"))
//                {
//                    CollectionInspectorEditor.collectionNameOrGuid = unetCol.collectionGuid.ToString();
//                    CollectionInspectorEditor.ShowWindow();
//                }
            }
        }