Dialogue buttons too far away

The Dialogue buttons are uncomfortably far apart.

Posted 1 years ago
Votes Newest


Go into the VRUIParent.cs script (located in Equal Reality > Equal Reality API > Scripts > GUI)

Find the function "CreateMutlipleChoiceButtons", and go down to the line

mutlipleChoiceButtons[i].transform.localPosition = + Vector3.left*Mathf.CeilToInt(i/ 2 + 0.001f )*0.75f/2 * ( i % 2 == 0? -1 : 1);

This equation dictates how far away the buttons will spawn. Since we know we are only going to have 2 choices, we're going to create a hack solution.

Create an if else statement and leave the equation as the else condition. The if condition will be if "names.Length==2", which means that we're looking for 2 buttons. If there aren't 2, then go to the previous equation. (this means if you add more buttons, or the program had a bug and adds one for you -so helpful- then it'll go back to its original distance). Obviously, if you have 3 buttons, make that number a 3.

create an if else loop in that block, iterating through each button (i).

if(names.Length==2) { if(i == 0) mutlipleChoiceButtons[i].transform.localPosition = - Vector3.left * .15f; else mutlipleChoiceButtons[i].transform.localPosition = + Vector3.left * .15f; }

The first (if (i==0)), we are just saying start at the center ( and subtract by (arbitrary number that felt right) .15f. Same with the second button, but we're doing addition instead of subtraction, which makes it cross the center line of reference.

This is how it should look

An update has gone out today (2018 07 25) enabling custom interfaces. SDK Version 0.018.001 Brennan Hatton   1 years ago Report