1using System.Collections.Generic;
16 return EditorGUI.GetPropertyHeight( property ) * 2;
25 public override void OnGUI( Rect position, SerializedProperty property, GUIContent label )
27 EditorGUI.BeginProperty( position, label, property );
29 if( property.propertyType == SerializedPropertyType.Integer )
32 EditorGUI.BeginChangeCheck();
35 var newValue = EditorGUI.IntField(
new Rect( position.x, position.y, position.width, position.height / 2 ), label, property.intValue );
38 EditorGUI.LabelField(
new Rect( position.x, position.y + position.height / 2, position.width, position.height / 2 ),
"Item Description",
GetItemDescription( property.intValue ) );
41 if( EditorGUI.EndChangeCheck() )
43 property.intValue = newValue;
47 EditorGUI.EndProperty();
59 soItemList = AssetDatabase.LoadAssetAtPath(
"Assets/Scriptable Objects Assets/Item/soItemList.asset", typeof(
SOItemList ) ) as
SOItemList;
63 ItemDetails itemDetail = itemDetailsList.Find( x=>x.m_ItemCode == itemCode );
65 if( itemDetail !=
null )
No values need to be held for the item code description attribute Therefore, the class can be empty.
override float GetPropertyHeight(SerializedProperty property, GUIContent label)
Changed the return property height to be double to cater for the additional item code description tha...
string GetItemDescription(int itemCode)
Get the description of the item.
override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
Using BeginProperty / EndProperty on the parent property means that prefab ovrride logic works on the...
This class holds information of items.
List< ItemDetails > m_ItemDetails