Professional Documents
Culture Documents
Scripts
Scripts
Scripts
Colision.cs
Este script es la modificación de los scripts incluidos en “Simple Waypoint System”. Se utiliza
para detectar la colisión de un objeto con otro objeto con tag “Nave”. Al colisionar se activan y
desactivan otros objetos.
using UnityEngine;
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
using System.Collections;
using DG.Tweening;
using SWS;
example4.objetoEncender.SetActive(true);
example4.objetooff3.SetActive(true);
example4.objetoEncender2.SetActive(true);
example4.objetooff.SetActive(false);
example4.objetooff2.SetActive(false);
example4.moveRef.Pause();
[System.Serializable]
public class ExampleClass4
{
public splineMove moveRef;
public GameObject objetoEncender;
public GameObject objetoEncender2;
public GameObject objetooff;
public GameObject objetooff2;
public GameObject objetooff3;
}
Irme.cs
Este script es la modificación de los scripts incluidos en “Simple Waypoint System”. Se utiliza
para encender y apagar objetos cuando el cursor del casco de realidad virtual colisiona sobre el
objeto que contenga este script. Esto hace que la nave empiece su camino desde el punto
original por la ruta trazada en moveRef.
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using VRStandardAssets.Utils;
using UnityEngine;
using UnityEngine.Events;
using System.Collections;
using DG.Tweening;
using SWS;
namespace VRStandardAssets.Menu
{
public class Irme : MonoBehaviour
{
void Start()
{
}
private void OnEnable()
{
m_InteractiveItem.OnOver += HandleOver;
m_InteractiveItem.OnOut += HandleOut;
m_SelectionRadial.OnSelectionComplete += HandleSelectionComplete;
//Debug.Log("Toy Dentro");
}
if (Input.GetKeyUp("space"))
{
m_SelectionRadial.DetenerLlenado();
}
}
}
m_GazeOver = false;
}
{
print("Me he ido");
example2.moveRef.Pause();
example2.apagarR1.SetActive(false);
example2.apagarR2.SetActive(false);
example2.objetoEncender.SetActive(false);
example2.objetoEncender2.SetActive(false);
example2.objetoEncender3.SetActive(false);
example2.objetoEncender4.SetActive(false);
example2.offTierraPanel.SetActive(false);
example2.offTierraPlaneta.SetActive(false);
example2.offTierraColision.SetActive(false);
example2.offMartePanel.SetActive(false);
example2.offMartePlaneta.SetActive(false);
example2.offMarteColision.SetActive(false);
example2.offJupiterPanel.SetActive(false);
example2.offJupiterPlaneta.SetActive(false);
example2.offJupiterColision.SetActive(false);
example2.offUranoPanel.SetActive(false);
example2.offUranoPlaneta.SetActive(false);
example2.offUranoColision.SetActive(false);
example2.offNeptunoPanel.SetActive(false);
example2.offNeptunoPlaneta.SetActive(false);
example2.offNeptunoColision.SetActive(false);
example2.offSaturnoPanel.SetActive(false);
example2.offSaturnoPlaneta.SetActive(false);
example2.offSaturnoColision.SetActive(false);
example2.SS.SetActive(true);
example2.panel.SetActive(true);
example2.planetas.SetActive(true);
//example4.moveRef.Pause();
example2.moveRef.Resume();
}
[System.Serializable]
public class ExampleClass2
{
public splineMove moveRef;
public GameObject SS;
public GameObject panel;
public GameObject planetas;
public GameObject objetoEncender;
public GameObject objetoEncender2;
public GameObject objetoEncender3;
public GameObject objetoEncender4;
public GameObject apagarR1;
public GameObject apagarR2;
public GameObject offTierraPanel;
public GameObject offTierraPlaneta;
public GameObject offTierraColision;
public GameObject offMartePanel;
public GameObject offMartePlaneta;
public GameObject offMarteColision;
}
}
NoIrme.cs
Este script es similar a Irme.cs. Se utiliza para encender y apagar objetos cuando el cursor del
casco de realidad virtual colisiona sobre el objeto que contenga este script. Esto hace que la
nave regrese al punto original por la ruta trazada en moveRef
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using VRStandardAssets.Utils;
using UnityEngine;
using UnityEngine.Events;
using System.Collections;
using DG.Tweening;
using SWS;
namespace VRStandardAssets.Menu
{
public class NoIrme : MonoBehaviour
{
// Use this for initialization
[SerializeField] private SelectionRadial m_SelectionRadial; // This controls when the
selection is complete.
[SerializeField] private VRInteractiveItem m_InteractiveItem; // The interactive item
for where the user should click to load the level.
public static int vidas=0;
private bool m_GazeOver;
public splineMove moveRef;
public GameObject OffSistemaSolar;
public GameObject OnColision;
public GameObject OffColision2;
public GameObject OffColision3;
public GameObject OffColision4;
public GameObject OffColision5;
public GameObject OffColision6;
public GameObject OffColision7;
public GameObject OffColision8;
void Awake()
{
void Start()
{
vidas = 0;
}
private void OnEnable()
{
m_InteractiveItem.OnOver += HandleOver;
m_InteractiveItem.OnOut += HandleOut;
m_SelectionRadial.OnSelectionComplete += HandleSelectionComplete;
//Debug.Log("Toy Dentrooooooooooooooooooooo");
}
if (Input.GetKeyUp("space"))
{
m_SelectionRadial.DetenerLlenado();
}
}
}
m_GazeOver = false;
}
{
print("He ido al planeta");
OnColision.gameObject.SetActive(true);
OffColision2.gameObject.SetActive(false);
OffColision3.gameObject.SetActive(false);
OffColision4.gameObject.SetActive(false);
OffColision5.gameObject.SetActive(false);
OffColision6.gameObject.SetActive(false);
OffColision7.gameObject.SetActive(false);
OffColision8.gameObject.SetActive(false);
OffSistemaSolar.gameObject.SetActive(false);
moveRef.StartMove();
}
}
}
}