private void DrawRegularTab(OnNetInstanceCacheContainerXml item, Rect areaRect) { GUIKlyteCommons.DoInHorizontal(() => { GUILayout.Label(Locale.Get("K45_WTS_ONNETEDITOR_NAME")); var newName = GUITextField.TextField(f_SaveName, item.SaveName); if (!newName.IsNullOrWhiteSpace() && newName != item.SaveName) { item.SaveName = newName; } }); GUIKlyteCommons.DoInHorizontal(() => { GUILayout.Label(Locale.Get("K45_WTS_BUILDINGEDITOR_MODELLAYOUTSELECT")); GUI.SetNextControlName(f_ModelSelect); if (GUILayout.Button((m_currentModelType != 1 ? item.PropLayoutName : PropIndexes.GetListName(item.SimpleProp)) ?? "<color=#FF00FF>--NULL--</color>")) { m_filterSelectionView = true; m_lastModelFilterText = (m_currentModelType != 1 ? item.PropLayoutName : PropIndexes.GetListName(item.SimpleProp)) ?? ""; m_searchResult.Value = null; RestartLayoutFilterCoroutine(); } }); GUIKlyteCommons.DoInHorizontal(() => { GUI.SetNextControlName(f_InstanceMode); item.SegmentPositionRepeating = GUILayout.Toggle(item.SegmentPositionRepeating, Locale.Get("K45_WTS_POSITIONINGMODE_ISMULTIPLE")); }); if (item.SegmentPositionRepeating) { GUIKlyteCommons.DoInHorizontal(() => { GUILayout.Label(Locale.Get("K45_WTS_ONNETEDITOR_SEGMENTPOSITION_START")); GUILayout.Space(areaRect.width / 3); var rect = GUILayoutUtility.GetLastRect(); item.SegmentPositionStart = GUI.HorizontalSlider(new Rect(rect.x, rect.yMin + 7, rect.width, 15), item.SegmentPositionStart, 0, 1); item.SegmentPositionStart = GUIFloatField.FloatField(f_SegmentPathStart, item.SegmentPositionStart, 0, 1); }); GUIKlyteCommons.DoInHorizontal(() => { GUILayout.Label(Locale.Get("K45_WTS_ONNETEDITOR_SEGMENTPOSITION_END")); GUILayout.Space(areaRect.width / 3); var rect = GUILayoutUtility.GetLastRect(); item.SegmentPositionEnd = GUI.HorizontalSlider(new Rect(rect.x, rect.yMin + 7, rect.width, 15), item.SegmentPositionEnd, 0, 1); item.SegmentPositionEnd = GUIFloatField.FloatField(f_SegmentPathEnd, item.SegmentPositionEnd, 0, 1); }); GUIKlyteCommons.DoInHorizontal(() => { GUILayout.Label(Locale.Get("K45_WTS_ONNETEDITOR_SEGMENTPOSITION_COUNT")); item.SegmentPositionRepeatCount = (ushort)GUIIntField.IntField(f_SegmentRepeatCount, item.SegmentPositionRepeatCount, 1, ushort.MaxValue); }); } else { GUIKlyteCommons.DoInHorizontal(() => { GUILayout.Label(Locale.Get("K45_WTS_ONNETEDITOR_SEGMENTPOSITION")); GUILayout.Space(areaRect.width / 3); var rect = GUILayoutUtility.GetLastRect(); item.SegmentPosition = GUI.HorizontalSlider(new Rect(rect.x, rect.yMin + 7, rect.width, 15), item.SegmentPosition, 0, 1); item.SegmentPosition = GUIFloatField.FloatField(f_SegmentPathSingle, item.SegmentPosition, 0, 1); }); } GUILayout.Space(12); GUIKlyteCommons.DoInHorizontal(() => { item.InvertSign = GUILayout.Toggle(item.InvertSign, Locale.Get("K45_WTS_INVERT_SIGN_SIDE")); }); GUIKlyteCommons.DoInHorizontal(() => GUILayout.Label(Locale.Get("K45_WTS_ONNETEDITOR_LOCATION_SETTINGS"))); GUIKlyteCommons.AddVector3Field(item.PropPosition, "K45_WTS_ONNETEDITOR_POSITIONOFFSET", f_SegmentPositionOffset); GUIKlyteCommons.AddVector3Field(item.PropRotation, "K45_WTS_ONNETEDITOR_ROTATION", f_SegmentRotationOffset); GUIKlyteCommons.AddVector3Field(item.Scale, "K45_WTS_ONNETEDITOR_SCALE", f_SegmentScaleOffset); }
// Draw GUI public override void DrawEditor() { _float = GUIFloatField.FloatField(_float); }