Пример #1
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            Rect r = position;

            r.height /= 2;
            EditorGUI.BeginProperty(position, label, property);
            var    prop  = property.FindPropertyRelative("_Value");
            string value = prop.stringValue;


            Rect first = r;

            r.height        -= EditorGUIUtility.standardVerticalSpacing;
            value            = EditorGUI.TextField(first, label, value);
            prop.stringValue = value;

            EditorGUI.BeginDisabledGroup(true);
            Rect second = r;

            second.position = new Vector2(r.position.x, r.position.y + r.height);
            EditorGUI.TextField(second, "Hashed Value", HashedString.StringToHash(value).ToString());
            EditorGUI.EndDisabledGroup();

            EditorGUI.EndProperty();
        }
Пример #2
0
        void Start()
        {
            PGISlot slot = GetComponent <PGISlot>();

            if (slot != null)
            {
                slot.OnRemoveItem.AddListener(OnRemove);
                slot.OnStoreItem.AddListener(OnStore);
                slot.OnCanStoreItem.AddListener(CanStore);
            }


            HashedTypes = new List <int>(TypesThatUseMultiSlots.Count);
            for (int i = 0; i < TypesThatUseMultiSlots.Count; i++)
            {
                HashedTypes.Add(HashedString.StringToHash(TypesThatUseMultiSlots[i]));
            }
        }