Quantcast
Channel: Recent Discussions — Mixed Reality Developer Forum
Viewing all articles
Browse latest Browse all 10543

Sharing and custom messages not working

$
0
0

I'm attempting to highlight a model and then send message to other Hololens to show that highlight also. The highlight works on my device but does not turn to highlighted on the other devices.

Any idea where I'm going wrong?

private void HightlightCamShaft()
{
CustomMessages.Instance.SendHightlightCamShaft();
TheEnergyHub.GetComponent().HighlightCamShaft();
}

CustomMessages.cs

public void SendHightlightCamShaft()
{
// If we are connected to a session, broadcast our head info
if (this.serverConnection != null && this.serverConnection.IsConnected())
{
// Create an outgoing network message to contain all the info we want to send
NetworkOutMessage msg = CreateMessage((byte)TestMessageID.HightlightCamShaft);

        // Send the message as a broadcast, which will cause the server to forward it to all other users in the session.
        this.serverConnection.Broadcast(
            msg,
            MessagePriority.Immediate,
            MessageReliability.ReliableOrdered,
            MessageChannel.Avatar);
    }
}

EnergyHubBase.cs
public void HighlightCamShaft()
{
Color32 col = pCylinder13.gameObject.GetComponent().material.GetColor("_Color");
col.r = 229;
col.g = 253;
col.b = 0;
col.a = 100;

    pCylinder13.gameObject.GetComponent<Renderer>().material.SetColor("_Color", col);
    pCylinder14.gameObject.GetComponent<Renderer>().material.SetColor("_Color", col);
    pCylinder17.gameObject.GetComponent<Renderer>().material.SetColor("_Color", col);
    pCylinder19.gameObject.GetComponent<Renderer>().material.SetColor("_Color", col);
    pCylinder20.gameObject.GetComponent<Renderer>().material.SetColor("_Color", col);
}

Sorry but code '' are not working on this post.


Viewing all articles
Browse latest Browse all 10543

Trending Articles