using System.Linq;
using HurricaneVR.Framework.Core.Player;
using UnityEngine;
namespace HurricaneVR.TechDemo.Scripts
{
public class DemoManualTeleport : MonoBehaviour
{
public Transform PositionOne;
public Transform PositionTwo;
public Transform PositionThree;
public HVRTeleporter Teleporter { get; set; }
public void Start()
{
Teleporter = GameObject.FindObjectsOfType<HVRTeleporter>().FirstOrDefault(e => e.gameObject.activeInHierarchy);
}
public void GoToOne()
{
if (Teleporter && PositionOne)
{
Teleporter.Teleport(PositionOne.position, PositionOne.forward);
}
}
public void GoToTwo()
{
if (Teleporter && PositionTwo)
{
Teleporter.Teleport(PositionTwo.position, PositionTwo.forward);
}
}
public void GoToThree()
{
if (Teleporter && PositionThree)
{
Teleporter.Teleport(PositionThree.position, PositionThree.forward);
}
}
}
} Unity vr projem için ufak bir kod yardımı
0
●36
- 23-07-2022, 20:20:05kodlama bılenlerden ufak bır yardım ıstıcem elımdekı bu kodla butona tıklayınca 2. 3. sırayla diger spawn noktalarına ışınlaya bılıyorum fakat bunu sırayla değilde rasgele yapmak ıstıyorum. Yardımcı olabılecek var mı ?