[03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC]

Added feature to modify the navigator ip.
master
LH 5 years ago
parent 3fb8c1663c
commit 712f975793
  1. 1
      03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait.unity
  2. 17
      03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait/Script/ResourceClient.cs

@ -3389,6 +3389,7 @@ MonoBehaviour:
onStateChanged: onStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
overrideHost: 192.168.60.220
interval: 1 interval: 1
onTextureReceived: onTextureReceived:
m_PersistentCalls: m_PersistentCalls:

@ -11,6 +11,9 @@ namespace UltraCombos.Frozen.RoyalGallery
[RequireComponent(typeof(RorayGalleryGrpcServer))] [RequireComponent(typeof(RorayGalleryGrpcServer))]
public class ResourceClient : GrpcClientBase public class ResourceClient : GrpcClientBase
{ {
[Configuration.Config]
public string overrideHost = "192.168.60.220";
public float interval = 1.0f; public float interval = 1.0f;
float stamp = 0.0f; float stamp = 0.0f;
Queue<DataRequest> data_pool; Queue<DataRequest> data_pool;
@ -29,15 +32,29 @@ namespace UltraCombos.Frozen.RoyalGallery
data_pool = new Queue<DataRequest>(); data_pool = new Queue<DataRequest>();
/*
var options = new List<ChannelOption> { new ChannelOption(ChannelOptions.MaxSendMessageLength, int.MaxValue) }; var options = new List<ChannelOption> { new ChannelOption(ChannelOptions.MaxSendMessageLength, int.MaxValue) };
Connect(options); Connect(options);
*/
server = GetComponent<RorayGalleryGrpcServer>(); server = GetComponent<RorayGalleryGrpcServer>();
server.onMessageReceived += OnMessageReceived; server.onMessageReceived += OnMessageReceived;
} }
private void Init()
{
host = overrideHost;
var options = new List<ChannelOption> { new ChannelOption(ChannelOptions.MaxSendMessageLength, int.MaxValue) };
Connect(options);
}
private void Update() private void Update()
{ {
if (channel == null || host.Equals(overrideHost) == false)
{
Init();
}
if (Time.time - stamp > interval && data_pool.Count > 0) if (Time.time - stamp > interval && data_pool.Count > 0)
{ {
stamp = Time.time; stamp = Time.time;

Loading…
Cancel
Save