Created
February 2, 2017 14:42
-
-
Save flushpot1125/be76818631aa133e7810764717b4736a to your computer and use it in GitHub Desktop.
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
/*copied from complete version in sample project of "https://developer.microsoft.com/en-us/windows/holographic/holograms_210"*/ | |
using Academy.HoloToolkit.Unity; | |
using UnityEngine; | |
/// <summary> | |
/// InteractibleAction performs custom actions when you gaze at the holograms. | |
/// </summary> | |
public class InteractibleAction : MonoBehaviour | |
{ | |
[Tooltip("Drag the Tagalong prefab asset you want to display.")] | |
public GameObject ObjectToTagAlong; | |
void PerformTagAlong() | |
{ | |
if (ObjectToTagAlong == null) | |
{ | |
return; | |
} | |
// Recommend having only one tagalong. | |
GameObject existingTagAlong = GameObject.FindGameObjectWithTag("TagAlong"); | |
if (existingTagAlong != null) | |
{ | |
return; | |
} | |
GameObject instantiatedObjectToTagAlong = GameObject.Instantiate(ObjectToTagAlong); | |
instantiatedObjectToTagAlong.SetActive(true); | |
/* TODO: DEVELOPER CODING EXERCISE 6.b */ | |
// 6.b: AddComponent Billboard to instantiatedObjectToTagAlong. | |
// So it's always facing the user as they move. | |
instantiatedObjectToTagAlong.AddComponent<Billboard>(); | |
// 6.b: AddComponent SimpleTagalong to instantiatedObjectToTagAlong. | |
// So it's always following the user as they move. | |
instantiatedObjectToTagAlong.AddComponent<SimpleTagalong>(); | |
// 6.b: Set any public properties you wish to experiment with. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment