public static int GetTypeIndex(InstructionVariable variable) { if (variable.IsReference) { var index = VariableReferenceDrawer.GetLocationIndex(variable.Reference); return(index + _locationOffset); } else { return(VariableValueDrawer.GetTypeIndex(variable.Value)); } }
public int GetTypeIndex(SerializedProperty property) { var isReferenceProperty = property.FindPropertyRelative("IsReference"); if (isReferenceProperty.boolValue) { var referenceProperty = property.FindPropertyRelative("Reference"); var index = VariableReferenceDrawer.GetLocationIndex(referenceProperty); return(index + _locationOffset); } else { var valueProperty = property.FindPropertyRelative("Value"); return(VariableValueDrawer.GetTypeIndex(valueProperty)); } }