Skip to content

Commit df1d74a

Browse files
committed
[1.01 Update] Adding the option to change character size
1 parent 85834dd commit df1d74a

File tree

12 files changed

+54
-14
lines changed

12 files changed

+54
-14
lines changed
108 Bytes
Binary file not shown.

.vs/SimpleNoteVR/v15/Server/sqlite3/db.lock

Whitespace-only changes.
4 KB
Binary file not shown.
32 KB
Binary file not shown.
2.28 MB
Binary file not shown.

Assets/Simple Note VR/SimpleNoteVR.cs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,21 @@ public class SimpleNoteVR : MonoBehaviour
1515
public Color TextColor = Color.white;
1616
public Color FrameColor = Color.white;
1717
public Font TextFont;
18-
[Range(0.4f, 1f), Header("Distance to Camera")]
19-
public float Multiplier;
18+
[Range(0.4f, 5f), Header("Distance to Camera")]
19+
public float DistanceMultiplier = 0.4f;
20+
21+
[Range(1f, 30f), Header("Character Size")]
22+
public float CharacterSizeMultiplier = 1f;
2023

2124
#region Private Variables
2225
private Camera MainCam;
2326
private TextMesh tmesh;
2427
private Rigidbody rigid;
2528
private SpriteRenderer BorderSprite;
2629
private Coroutine Cached;
30+
31+
private float DistanceCached;
32+
private float CharacterSizeCached;
2733
#endregion
2834

2935
#region Singleton build-ups
@@ -60,6 +66,8 @@ void Start()
6066

6167
BorderSprite = gameObject.GetComponentInChildren<SpriteRenderer>();
6268
BorderSprite.color = FrameColor;
69+
70+
CharacterSizeCached = tmesh.characterSize;
6371
}
6472

6573
/// <summary>
@@ -75,13 +83,14 @@ public void Notify(string words)
7583
}
7684

7785
//Calculate position to appear
78-
transform.position = MainCam.transform.position + MainCam.transform.forward * Multiplier;
86+
transform.position = MainCam.transform.position + MainCam.transform.forward * DistanceMultiplier;
7987
transform.rotation = Quaternion.LookRotation(transform.position - MainCam.transform.position);
8088

8189
//Calculate border length to match word length
82-
BorderSprite.size = new Vector2((words.Length) / 30f, 0.1f);
90+
BorderSprite.size = new Vector2((words.Length * CharacterSizeMultiplier) / 30f, 0.1f * CharacterSizeMultiplier);
8391

8492
tmesh.text = words;
93+
tmesh.characterSize = CharacterSizeCached * CharacterSizeMultiplier;
8594

8695
Cached = StartCoroutine(Recycle(1.5f, 2f));
8796
}
@@ -120,4 +129,14 @@ private void ResetValues()
120129
tmesh.text = "";
121130
BorderSprite.size = Vector2.zero;
122131
}
132+
133+
134+
135+
private void Update()
136+
{
137+
if (Input.GetKeyDown(KeyCode.Space))
138+
{
139+
SimpleNoteVR.Instance.Notify("Testing this it");
140+
}
141+
}
123142
}

Assets/Simple Note VR/TestScene.unity

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ OcclusionCullingSettings:
1313
--- !u!104 &2
1414
RenderSettings:
1515
m_ObjectHideFlags: 0
16-
serializedVersion: 8
16+
serializedVersion: 9
1717
m_Fog: 0
1818
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
1919
m_FogMode: 3
@@ -39,6 +39,7 @@ RenderSettings:
3939
m_CustomReflection: {fileID: 0}
4040
m_Sun: {fileID: 0}
4141
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
42+
m_UseRadianceAmbientProbe: 0
4243
--- !u!157 &3
4344
LightmapSettings:
4445
m_ObjectHideFlags: 0
@@ -54,11 +55,10 @@ LightmapSettings:
5455
m_EnableBakedLightmaps: 1
5556
m_EnableRealtimeLightmaps: 1
5657
m_LightmapEditorSettings:
57-
serializedVersion: 9
58+
serializedVersion: 10
5859
m_Resolution: 2
5960
m_BakeResolution: 40
60-
m_TextureWidth: 1024
61-
m_TextureHeight: 1024
61+
m_AtlasSize: 1024
6262
m_AO: 0
6363
m_AOMaxDistance: 1
6464
m_CompAOExponent: 1
@@ -77,15 +77,18 @@ LightmapSettings:
7777
m_PVRDirectSampleCount: 32
7878
m_PVRSampleCount: 500
7979
m_PVRBounces: 2
80-
m_PVRFiltering: 0
80+
m_PVRFilterTypeDirect: 0
81+
m_PVRFilterTypeIndirect: 0
82+
m_PVRFilterTypeAO: 0
8183
m_PVRFilteringMode: 1
8284
m_PVRCulling: 1
8385
m_PVRFilteringGaussRadiusDirect: 1
8486
m_PVRFilteringGaussRadiusIndirect: 5
8587
m_PVRFilteringGaussRadiusAO: 2
86-
m_PVRFilteringAtrousColorSigma: 1
87-
m_PVRFilteringAtrousNormalSigma: 1
88-
m_PVRFilteringAtrousPositionSigma: 1
88+
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
89+
m_PVRFilteringAtrousPositionSigmaIndirect: 2
90+
m_PVRFilteringAtrousPositionSigmaAO: 1
91+
m_ShowResolutionOverlay: 1
8992
m_LightingDataAsset: {fileID: 0}
9093
m_UseShadowmask: 1
9194
--- !u!196 &4
@@ -107,6 +110,8 @@ NavMeshSettings:
107110
manualTileSize: 0
108111
tileSize: 256
109112
accuratePlacement: 0
113+
debug:
114+
m_Flags: 0
110115
m_NavMeshData: {fileID: 0}
111116
--- !u!1 &629266589
112117
GameObject:
@@ -244,11 +249,11 @@ Camera:
244249
m_TargetEye: 3
245250
m_HDR: 1
246251
m_AllowMSAA: 1
252+
m_AllowDynamicResolution: 0
247253
m_ForceIntoRT: 0
248254
m_OcclusionCulling: 1
249255
m_StereoConvergence: 10
250256
m_StereoSeparation: 0.022
251-
m_StereoMirrorMode: 0
252257
--- !u!4 &1415145698
253258
Transform:
254259
m_ObjectHideFlags: 0
@@ -301,6 +306,11 @@ Prefab:
301306
propertyPath: m_RootOrder
302307
value: 2
303308
objectReference: {fileID: 0}
309+
- target: {fileID: 114947602997358680, guid: 8370767263316394fb259faa513e3b2c,
310+
type: 2}
311+
propertyPath: DistanceMultiplier
312+
value: 0.4
313+
objectReference: {fileID: 0}
304314
m_RemovedComponents: []
305315
m_ParentPrefab: {fileID: 100100000, guid: 8370767263316394fb259faa513e3b2c, type: 2}
306316
m_IsPrefabParent: 0

Packages/manifest.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"dependencies": {
3+
}
4+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!1386491679 &1
4+
PresetManager:
5+
m_ObjectHideFlags: 0
6+
m_DefaultList: []

ProjectSettings/ProjectVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
m_EditorVersion: 2017.1.1f1
1+
m_EditorVersion: 2018.1.6f1

0 commit comments

Comments
 (0)