Skip to content

Commit

Permalink
edits to mobile label editor and fixes for label size controller
Browse files Browse the repository at this point in the history
  • Loading branch information
robhillman97 committed Aug 4, 2023
1 parent 7e0deb5 commit 6b3241a
Show file tree
Hide file tree
Showing 4 changed files with 559 additions and 227 deletions.
31 changes: 26 additions & 5 deletions Assets/MirageXR/Player/Resources/Prefabs/UI/TextLabel.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ GameObject:
- component: {fileID: 8633458975003311425}
- component: {fileID: 2787875468456744329}
- component: {fileID: 5326666486237950587}
- component: {fileID: 4293528012230011186}
m_Layer: 5
m_Name: TriggerIcon
m_TagString: Untagged
Expand All @@ -191,16 +192,16 @@ RectTransform:
m_GameObject: {fileID: 3769834793294868150}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.17, y: 0.1, z: 0.0009999999}
m_LocalScale: {x: 1, y: 1, z: 0.0009999999}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3099847827736403681}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 179, y: 30}
m_SizeDelta: {x: 50, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2787875468456744329
CanvasRenderer:
Expand Down Expand Up @@ -240,6 +241,26 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &4293528012230011186
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3769834793294868150}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 1
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!1 &4989881414933245618
GameObject:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@ public class LabelSizeController : MonoBehaviour
[SerializeField] private BoxCollider textCollider;
[SerializeField] private RectTransform textRectTransfrom;

private void Start()
{
AdjustSize();
}

private void OnRectTransformDimensionsChange()
{
AdjustSize();
}

private void AdjustSize()
{
var textRect = textRectTransfrom.rect;

textCollider.size = new Vector3(textRect.width, textRect.height, 1);
textCollider.center = new Vector3(0, -(textRect.height / 2));
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ private void UpdateView()
_exampleLabelBackground.color = GetColorFromString(splitArray[2]);
}
}
UpdateButtonColours();
}

private void InitClampedScrollRect(ClampedScrollRect clampedScrollRect, GameObject templatePrefab, int maxCount, string text)
Expand Down Expand Up @@ -237,13 +238,15 @@ public void OnFontSizeChanged()
public void OnFontColourChange()
{
// _colourPickerObject.SetActive(true);
_settingsPannel.SetActive(false);
_colourPickerScript.Open();
_colourPickerOption = ColourPickerOption.Font;
}

public void OnBackgroundColourChanged()
{
//_colourPickerObject.SetActive(true);
_settingsPannel.SetActive(false);
_colourPickerScript.Open();
_colourPickerOption = ColourPickerOption.Background;
}
Expand All @@ -263,6 +266,7 @@ public void OnColourPickerChange()
}

UpdateButtonColours();
_settingsPannel.SetActive(true);

_colourPickerOption = ColourPickerOption.NA;
}
Expand Down
Loading

0 comments on commit 6b3241a

Please sign in to comment.