Hello everyone.
The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Options
Problem when using more classes in Hololens Emulator
Hi guys,
I have 2 classes (communication_final and backup) in my application. When I try to set a bool variable in the backup class from the communication_final class, it didn't work. Does the hololens emulator supports the usage of more classes and should it be possible to set a variable in another class? Does this work on hololens?
Thanks,
Chris
0
Answers
Could you please post your code on the bool variable and changing it?
Hi,
Backup is my second class.
Backup.comm_displayed = true;
The funny thing is that the code works in the unity editor and also when I build a app for the desktop, only in the hololens emulator this didn't work.
@ChristophMarko I think what Shayne was referring to was you need to post the whole method containing where you change the variable not just a single line where you call something true. There could be a number of different things that could go wrong causing something like your variable not to be true.
In order for someone to be able to help you out you need to show everywhere in your script that you reference your class and the variable.
AR Developer
@dbarrett here are my 2 classes:
Communication_v3.cs (only a extract)
using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Runtime;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System.Diagnostics;
using System.Collections.ObjectModel;
using test_neu;
if !UNITY_EDITOR
using Windows.Networking.Sockets;
using Windows.Networking;
using Windows.Networking.Connectivity;
using Windows.Devices.Bluetooth;
using Windows.Devices.Bluetooth.GenericAttributeProfile;
using Windows.Devices.Enumeration;
using Windows.Storage.Streams;
using test;
using Windows.UI.Core;
using System.Threading.Tasks;
using backup_scene;
endif
namespace comm_final
{
}
}
}
}
and here is the backup file where the variables are located:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Collections.ObjectModel;
if !UNITY_EDITOR
using Windows.Networking.Sockets;
using Windows.Networking;
using Windows.Networking.Connectivity;
using Windows.Devices.Bluetooth;
using Windows.Devices.Bluetooth.GenericAttributeProfile;
using Windows.Devices.Enumeration;
using Windows.Storage.Streams;
using test;
using test_neu;
using comm_final;
using Windows.UI.Core;
using System.Threading.Tasks;
endif
namespace backup_scene
{
public class Backup
{
public static bool scene_first_time = true;
public static bool udp_selected;
public static bool tcp_selected;
public static bool ble_selected;
public static bool comm_displayed;
}
}
Call me blind but, I don't see anywhere in this code where you say:
Backup.comm_displayed = true;
I'd also assume you have all of your required permissions set under the Player Settings?
AR Developer
@dbarret: I'm sry I copied only a part of the source code and the mentioned part was in the other part. I set all the needed capabilites and when I run it as a Desktop app the program works, only it doesn't work with the emulator and the hololens.
@dbarrett: The start function in my communication_v3 class compares if a value of the backup class is set and afterwards sets a gameobject active and show a text in a textfield but this wouldn't work on the emulator and on the hololens.
I solved the problem I forgot to instantiate the needed class to create an object.