This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class GunScript : MonoBehaviour { | |
public ITangoController TangoController; | |
public GameObject LaserBeam; | |
bool previousSelectButton = false; | |
private GameObject muzzle; | |
... | |
void Start () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var originToMarker = Matrix4x4.TRS(obj.position, obj.rotation * Quaternion.Euler(90, 0, 0), Vector3.one); | |
var tangoOriginToMarker = Matrix4x4.TRS(TangoController.transform.position, TangoController.transform.rotation, Vector3.one); | |
var originToTangoOrigin = originToMarker * tangoOriginToMarker.inverse; | |
var rot = GetRotationFromMatrix(originToTangoOrigin); | |
transform.parent.SetPositionAndRotation(originToTangoOrigin.MultiplyPoint(Vector3.zero), rot); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using Vuforia; | |
public class GunScript : MonoBehaviour { | |
public ITangoController TangoController; | |
public GameObject LaserBeam; | |
public CustomTrackingHandler trackingHandler; | |
bool previousSelectButton = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
using Vuforia; | |
public class CustomTrackingHandler : MonoBehaviour, ITrackableEventHandler | |
{ | |
private GameObject target; | |
private TrackableBehaviour trackableBehaviour; | |
private TrackableBehaviour.Status currentStatus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public interface ITangoController{ | |
bool SelectButton | |
{ | |
get; | |
set; | |
} | |
Transform transform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnetLLAPISample; | |
using UnityEngine; | |
public class UnetTangoController : MonoBehaviour, ITangoController { | |
public LLAPINetworkManager NetworkManager; | |
public bool SelectButton { get; set; } | |
public GunScript GunScript; | |
private void Awake() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using UnetLLAPISample; | |
using UnityEngine; | |
using UnityEngine.Networking; | |
public class UnetTangoController : MonoBehaviour | |
{ | |
public LLAPINetworkManager NetworkManager; | |
public bool SelectButton = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Networking; | |
using System; | |
namespace UnetLLAPISample { | |
public class LLAPINetworkEventArgs : EventArgs | |
{ | |
public NetworkEventType eventType { set; get; } | |
public byte[] data { set; get; } |