Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions POINT-VR-Chapter-1/Assets/POINT/Credits/EndCreditsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using System.Collections.Generic;


public class EndCreditsManager : MonoBehaviour
Expand Down Expand Up @@ -73,6 +74,19 @@ private class CreditsPosition
[Tooltip("The speed (units per second) that the credits are scrolling")]
[SerializeField] private float scrollSpeed = 5.0f;

[Tooltip("Base Scene UI Container for button continuing to Post-Credits Sandbox")]
[SerializeField] private GameObject SceneUIContainer;

[Tooltip("Title Text for button continuing to Post-Credits Sandbox")]
[SerializeField] private TMP_Text continueButtonTitleText;

[Tooltip("Description of button continuing to Post-Credits Sandbox")]
[SerializeField] private TMP_Text continueButtonDescription;

[Tooltip("Background image for button continuing to Post-Credits Sandbox")]
[SerializeField] private Image continueButtonImage;


/// <summary>
/// Canvas containing canvasText
/// </summary>
Expand Down Expand Up @@ -155,6 +169,14 @@ private IEnumerator Start()
}
}

// Enable. I think we can make this code more professional
yield return new WaitForSeconds(5);

SceneUIContainer.SetActive(true);
StartCoroutine(FadeInText(continueButtonTitleText, fadeDuration));
StartCoroutine(FadeInText(continueButtonDescription, fadeDuration));
StartCoroutine(FadeInImage(continueButtonImage, fadeDuration));

yield break;
}

Expand Down
23 changes: 18 additions & 5 deletions POINT-VR-Chapter-1/Assets/POINT/Feature3/Constraints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public class Constraints : MonoBehaviour
List<Rigidbody> spheres = new List<Rigidbody>();
public GridScript deformScript;

public bool twoAtOnce = false;

private void OnTriggerEnter(Collider other)
{
if (!spheres.Contains(other.GetComponent<Rigidbody>()))
Expand All @@ -28,21 +30,32 @@ private void OnTriggerExit(Collider other)

void UpdateDeforms()
{
// if > 1, warn the user that the script is not designed to handle more than 1 sphere
// if > 2 (or 1, depending on user settings), warn the user that the script is not designed to handle more than 1 sphere
// if 0, do nothing
if (spheres.Count == 0)
{
deformScript.rigidbodiesToDeformAround = new Rigidbody[0];
}
if (spheres.Count == 1)
if (spheres.Count == 1 || (spheres.Count == 2 && twoAtOnce))
{
deformScript.rigidbodiesToDeformAround = spheres.ToArray();
}

if (spheres.Count > 1)
else
{
deformScript.rigidbodiesToDeformAround = Array.Empty<Rigidbody>();
Debug.LogWarning("The script is not designed to handle more than 1 sphere");
Debug.LogWarning("The grid has not been configured to allow this number of spheres");
}
}

private void AllowTwoSpheres()
{
twoAtOnce = true;
UpdateDeforms();
}

private void RestrictTwoSpheres()
{
twoAtOnce = false;
UpdateDeforms();
}
}
77 changes: 77 additions & 0 deletions POINT-VR-Chapter-1/Assets/POINT/Grid/2D Grid Material (1).mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 2D Grid Material (1)
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 0.457
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 1
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.107683994, g: 0.85882354, b: 0.0980392, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,26 @@ MonoBehaviour:
m_Key: CREDITS_GITHUB
m_Metadata:
m_Items: []
- m_Id: 114460531303956480
m_Key: SCENES_SANDBOX
m_Metadata:
m_Items: []
- m_Id: 120615334279168000
m_Key: MENU_GRIDTOGGLE
m_Metadata:
m_Items: []
- m_Id: 120616997882740736
m_Key: New Entry
m_Metadata:
m_Items: []
- m_Id: 120637133415038976
m_Key: SETTINGS_ONE
m_Metadata:
m_Items: []
- m_Id: 120637218341306368
m_Key: SETTINGS_TWO
m_Metadata:
m_Items: []
m_Metadata:
m_Items: []
m_KeyGenerator:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,23 @@ MonoBehaviour:
m_Localized: Congratulations! The simulation is over.
m_Metadata:
m_Items: []
- m_Id: 114460531303956480
m_Localized: Sandbox
m_Metadata:
m_Items: []
- m_Id: 120615334279168000
m_Localized: Disabling this option allows masses from any distance to deform
the grid.
m_Metadata:
m_Items: []
- m_Id: 120637133415038976
m_Localized: One
m_Metadata:
m_Items: []
- m_Id: 120637218341306368
m_Localized: Two
m_Metadata:
m_Items: []
references:
version: 1
00000000:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,23 @@ MonoBehaviour:
m_Localized: "\xA1Enhorabuena! La simulaci\xF3n ha terminado."
m_Metadata:
m_Items: []
- m_Id: 114460531303956480
m_Localized: Sandbox
m_Metadata:
m_Items: []
- m_Id: 120615334279168000
m_Localized: "Deshabilitar esta opci\xF3n para permitir que masas desde cualquier
distancia deformen la cuadr\xEDcula."
m_Metadata:
m_Items: []
- m_Id: 120637133415038976
m_Localized: Uno
m_Metadata:
m_Items: []
- m_Id: 120637218341306368
m_Localized: Dos
m_Metadata:
m_Items: []
references:
version: 1
00000000:
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AdjustMassAndRadius : MonoBehaviour
{
[SerializeField] private float initialMass;
[SerializeField] private float initialScale;


// Start is called before the first frame update
void Start()
{
gameObject.GetComponent<Rigidbody>().mass = initialMass;
transform.localScale = new Vector3(initialScale, initialScale, initialScale);
}

public void SetMass(float newMass)
{
gameObject.GetComponent<Rigidbody>().mass = newMass;
}

public void SetRadius(float newRadius)
{
transform.localScale = new Vector3(newRadius, newRadius, newRadius);
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading