public void LoadBundle(AssetInfo assetInfo) { var lodIndex = -1; assetInfo.Bundles.Sort((bundle1, bundle2) => bundle1.LODNumber.CompareTo(bundle2.LODNumber)); var targetLod = (HololensHelper.IsDeviceHololens() ? 2 : 1); for (var i = 0; i < assetInfo.Bundles.Count; ++i) { lodIndex = i; if (assetInfo.Bundles[i].LODNumber >= targetLod) { break; } } lodIndex = Math.Max(0, Math.Min(lodIndex, assetInfo.Bundles.Count - 1)); if (lodIndex > assetInfo.Bundles.Count - 1) { return; } CurrentAssetInfo = assetInfo; StartCoroutine(LoadBundleAsync(assetInfo, lodIndex)); StartCoroutine(LoadMaxInfo()); }
void Start() { keywords.Add("show f p s", () => { MasterController.Instance.ToggleDebugInfo(true); }); keywords.Add("hide f p s", () => { MasterController.Instance.ToggleDebugInfo(false); }); keywords.Add("reset stage position", () => { MasterController.Instance.SetDefaultStagePosition(); }); keywords.Add("quit application", () => { #if NETFX_CORE Windows.ApplicationModel.Core.CoreApplication.Exit(); #else UnityEngine.Application.Quit(); #endif }); #if NETFX_CORE if (HololensHelper.IsDeviceHololens()) { keywordRecognizer = new KeywordRecognizer(keywords.Keys.ToArray()); keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized; keywordRecognizer.Start(); } #endif }
private void OnGUI() { if (!HololensHelper.IsDeviceHololens()) { GUILayout.BeginArea(new Rect(10, 0, 100, 200)); var names = QualitySettings.names; GUILayout.BeginVertical(); GUILayout.Label("Render Quality"); int i = 0; while (i < names.Length) { if (GUILayout.Toggle(QualitySettings.GetQualityLevel() == i, names[i])) { QualitySettings.SetQualityLevel(i, true); } ++i; } GUILayout.EndVertical(); GUILayout.EndArea(); } if (CurrentAssetInfo.IsEmpty()) { return; } }
private void OnGUI() { if (!HololensHelper.IsDeviceHololens()) { GUILayout.BeginArea(new Rect(10, 110, 100, 200)); GUILayout.Label("Manipulate"); if (GUI.RepeatButton(new Rect(0, 25, 30, 30), "<")) { MasterController.Instance.SetStageRotationRelative(25f * Time.deltaTime); } if (GUI.RepeatButton(new Rect(35, 25, 30, 30), ">")) { MasterController.Instance.SetStageRotationRelative(-25f * Time.deltaTime); } if (GUI.RepeatButton(new Rect(0, 60, 30, 30), "Up")) { MasterController.Instance.SetVerticalOffsetRelative(.1f * Time.deltaTime); } if (GUI.RepeatButton(new Rect(35, 60, 30, 30), "Dn")) { MasterController.Instance.SetVerticalOffsetRelative(-.1f * Time.deltaTime); } if (GUI.RepeatButton(new Rect(0, 95, 30, 30), "+")) { MasterController.Instance.SetStageScaleRelative(.075f * Time.deltaTime); } if (GUI.RepeatButton(new Rect(35, 95, 30, 30), "-")) { MasterController.Instance.SetStageScaleRelative(-.075f * Time.deltaTime); } GUILayout.EndArea(); } }
void Start() { AssetManager.AssetLoaded += AssetManager_AssetLoaded; AssetManager.AssetLoadFailed += AssetManager_AssetLoadFailed; AssetManager.AssetLoadUpdated += AssetManager_AssetLoadUpdated; #if UNITY_WSA InteractionManager.InteractionSourcePressed += InteractionManager_SourcePressed; #endif ToggleModelInfo(false); StageManager.SetPreviewMode(false); StageManager.ToggleLoading(false); if (!HololensHelper.IsDeviceHololens()) { QualitySettings.SetQualityLevel(2, true); } }
public void SetInfo(MenuButtonInfo buttonInfo) { ButtonInfo = buttonInfo; SetToggle(ButtonInfo.InitialToggleState); gameObject.SetActive(HololensHelper.IsDeviceHololens() || buttonInfo.VisibleOnPC); }