Skip to content

Commit

Permalink
Added browse option to code cubes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vito217 committed Jun 4, 2021
1 parent f038924 commit 16bb711
Show file tree
Hide file tree
Showing 24 changed files with 13,194 additions and 358 deletions.
837 changes: 802 additions & 35 deletions Assets/Resources/Prefabs/Static/CodeCubes/CodeCubeMenu.prefab

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9316,7 +9316,7 @@ Transform:
m_GameObject: {fileID: 7743499910539656559}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_LocalScale: {x: 0.3, y: 0.3, z: 0.3}
m_Children:
- {fileID: 932795552325712835}
- {fileID: 6659873175409633131}
Expand Down Expand Up @@ -11123,7 +11123,7 @@ PrefabInstance:
- target: {fileID: 8251592563098711619, guid: 85305bd961128dd48b7b3b50bc622259,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 35.74005
value: -0.000061035156
objectReference: {fileID: 0}
- target: {fileID: 8251592563098711619, guid: 85305bd961128dd48b7b3b50bc622259,
type: 3}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3610,7 +3610,7 @@ Transform:
m_GameObject: {fileID: 7743499910539656559}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_LocalScale: {x: 0.3, y: 0.3, z: 0.3}
m_Children:
- {fileID: 932795552325712835}
- {fileID: 6659873175409633131}
Expand Down Expand Up @@ -3766,18 +3766,7 @@ MonoBehaviour:
lineCounter: {fileID: 827000592675701620}
freezeRotation: 0
loadingWheels: []
AFrameCube: {fileID: 4770452102599372922, guid: 2a5bce944c0ee424fa75b5265779af50,
type: 3}
AFrameSphere: {fileID: 6703919554910717439, guid: 35f352b577411b6429deb8baca44217b,
type: 3}
AFrameCylinder: {fileID: 9217918177551430936, guid: 0466357c68df6f448b8c4b618e695021,
type: 3}
AFramePlane: {fileID: 2838364793849875850, guid: 3bea66fad180cf1418e2f9aa49ca591f,
type: 3}
AFrameQuad: {fileID: 5909503192085912964, guid: 261325f5c16f6d34caf7045c912bcbab,
type: 3}
AFrameCapsule: {fileID: 5049317187185663198, guid: 6a1e0f0d7b04a59478d46899f80d7ea4,
type: 3}
codeCubePrefab: {fileID: 0}
metrics: {fileID: 3920583410558807829}
--- !u!1 &7804756461454528152
GameObject:
Expand Down
5 changes: 5 additions & 0 deletions Assets/Scenes/MainScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -2071,6 +2071,11 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7236977680674023404, guid: deaf761c35b3def408bffd10dd23a04d,
type: 3}
propertyPath: m_RequestedTrackingOriginMode
value: 2
objectReference: {fileID: 0}
- target: {fileID: 7236977680674023405, guid: deaf761c35b3def408bffd10dd23a04d,
type: 3}
propertyPath: m_Name
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Controllers/VRIDEController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class VRIDEController : MonoBehaviour

Vector3 currentPosition = Vector3.zero;

void Awake()
void Start()
{
GetComponent<XRRig>().cameraYOffset = 1.5f;
}
Expand Down
30 changes: 28 additions & 2 deletions Assets/Scripts/UI/CodeCubes/PharoClassCodeCube.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ public void OnActivate()
else
{
Instantiate(codeCubeMenuPrefab, transform);
transform.Find("CodeCubeMenu(Clone)/Button").GetComponent<Button>().onClick.AddListener(OnInspect);
transform.Find("CodeCubeMenu(Clone)/Button (1)").GetComponent<Button>().onClick.AddListener(OnDependences);
transform.Find("CodeCubeMenu(Clone)/Panel/Button").GetComponent<Button>().onClick.AddListener(OnInspect);
transform.Find("CodeCubeMenu(Clone)/Panel/Button (1)").GetComponent<Button>().onClick.AddListener(OnDependences);
transform.Find("CodeCubeMenu(Clone)/Panel (2)/Button (1)").GetComponent<Button>().onClick.AddListener(OnBrowse);
transform.Find("CodeCubeMenu(Clone)/Panel (1)/Button (1)").GetComponent<Button>().onClick.AddListener(OnDestroyCube);
}
}
else
Expand Down Expand Up @@ -325,4 +327,28 @@ public void OnDependences()
Dependences();
Destroy(transform.Find("CodeCubeMenu(Clone)").gameObject);
}

public void OnBrowse()
{
BrowserWindowCube wc = Instantiator.Instance.BrowserWindowCube();
wc.transform.position = transform.position;
wc.transform.forward = transform.forward;

BrowserPackage p = Instantiator.Instance.PackageObject(packageName, wc);
BrowserClass c = Instantiator.Instance.ClassObject(className, wc);

p.GetComponent<TextMeshProUGUI>().color = Color.white;
c.GetComponent<TextMeshProUGUI>().color = Color.white;

foreach (Transform child in wc.transform)
LayoutRebuilder.ForceRebuildLayoutImmediate(child.GetComponent<RectTransform>());

//p.click();
c.click();
}

public void OnDestroyCube()
{
Destroy(gameObject);
}
}
1 change: 1 addition & 0 deletions Assets/Scripts/UI/Objects/Browser/Browser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ public void LoadCodeCube()
PharoClassCodeCube classCodeCube = Instantiate(pharoClassCodeCubePrefab);
classCodeCube.transform.position = transform.position;
classCodeCube.className = class_list.last_selected.name;
classCodeCube.packageName = package_list.last_selected.name;

float width = GetComponent<RectTransform>().sizeDelta.x *
transform.Find("Panel").GetComponent<RectTransform>().localScale.x;
Expand Down
Loading

0 comments on commit 16bb711

Please sign in to comment.