Skip to content
This repository has been archived by the owner on Sep 17, 2022. It is now read-only.

Commit

Permalink
Added States Counter
Browse files Browse the repository at this point in the history
States Counter will show at which state the ARgorithm is running at.
  • Loading branch information
Vin-dictive committed Mar 10, 2021
1 parent 5aab31f commit f229cc1
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 2 deletions.
140 changes: 138 additions & 2 deletions Assets/Scenes/ARStage.unity
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ GameObject:
- component: {fileID: 218829093}
- component: {fileID: 218829092}
m_Layer: 5
m_Name: CommentsBox
m_Name: InfoBox
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand All @@ -329,6 +329,7 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 926064522}
- {fileID: 703624899}
m_Father: {fileID: 1149782917}
m_RootOrder: 2
Expand Down Expand Up @@ -1044,7 +1045,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 218829091}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
Expand Down Expand Up @@ -1343,6 +1344,140 @@ Camera:
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!1 &926064519
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 926064522}
- component: {fileID: 926064521}
- component: {fileID: 926064520}
m_Layer: 5
m_Name: StatesCounter
m_TagString: CommentBox
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &926064520
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 926064519}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text:
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: db8e5d852fafb3f4ab85b612e8d470ce, type: 2}
m_sharedMaterial: {fileID: 8963545961531463164, guid: db8e5d852fafb3f4ab85b612e8d470ce,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 50
m_fontSizeBase: 50
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 65
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 1
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &926064521
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 926064519}
m_CullTransparentMesh: 0
--- !u!224 &926064522
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 926064519}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 218829091}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: -108.953354}
m_Pivot: {x: 0.5, y: 1}
--- !u!1 &981664036
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -2537,4 +2672,5 @@ MonoBehaviour:
placementIndicator: {fileID: 543700799}
cube: {fileID: 39518484157928013, guid: 40a3700af4216614b8336f12ca407fad, type: 3}
CommentBox: {fileID: 703624896}
StatesCounterGameObject: {fileID: 926064519}
ARgorithmHeading: {fileID: 1545845627}
14 changes: 14 additions & 0 deletions Assets/Scripts/ARStage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class ARStage : MonoBehaviour
public GameObject placementIndicator;
public GameObject cube;
public GameObject CommentBox;
public GameObject StatesCounterGameObject;
public GameObject ARgorithmHeading;

private StageData stageData;
Expand Down Expand Up @@ -62,19 +63,32 @@ void FixedUpdate()
UpdatePlacementPose();
UpdatePlacementIndicator();
}
if(index+1 > 0 && index+1<=stageData.size)
{
ChangeStateCounter(index+1, stageData.size);
}
}

private void OnApplicationQuit()
{
PlayerPrefs.DeleteKey("CloudMenuEnabled");
}

//function to change UI comments. Display states comments
private void ChangeComments(string text)
{
// called in updates based on EventList contents with "comments" key
CommentBox.GetComponent<TextMeshProUGUI>().SetText(text);
}

//function to change UI states counter. Display states at which the stage is running
private void ChangeStateCounter(int step,int totalSteps)
{
string stepString = step.ToString();
string totalStepsString = totalSteps.ToString();
StatesCounterGameObject.GetComponent<TextMeshProUGUI>().SetText(stepString+"/"+totalStepsString);
}

//Dont Change the code below this comment
private void UpdatePlacementIndicator()
{
Expand Down

0 comments on commit f229cc1

Please sign in to comment.