public void Init() { ines = GameObject.Find("NodeManager").GetComponent <InstantiateNode>(); if (!ines.isServer) { ines.SetClientOriginScreenplanes(); } //outsource search for parent? //maybe static SYNC.findParent? bool foundSyncScript = false; var findParent = this.gameObject; while (foundSyncScript == false && findParent != null) { if (findParent == null) { Debug.LogError("No parent of " + this.gameObject.name + " has a SyncScript."); return; } mySyncScript = findParent.GetComponent <DataDistributor>(); if (mySyncScript != null) { foundSyncScript = true; Debug.Log("Found parent"); return; } findParent = findParent.transform.parent.gameObject; } }
void Start() { _started = false; NodeInformation.Load(); this.networkAddress = NodeInformation.master.ip; this.networkPort = NodeInformation.master.port; if (NodeInformation.IsMaster()) { isServer = true; this.StartServer(); //Instantiate the origin-GameObject GameObject objOrigin = Instantiate(origin, originParent); DataDistributor dd = objOrigin.GetComponent <DataDistributor>(); dd.ines = this; dd.parent = originParent.gameObject; //Spawn the object for the clients NetworkServer.Spawn(objOrigin); //Test Master; if we remove this, then the master won't see anything (same goes for config) originSlave = FindOrigin(); NodeInformation.SpawnScreenplanes(originSlave.transform.Find("ScreenPlanes")); trackerSettings = (TrackerSettings)originSlave.transform.Find("CameraHolder").GetComponent("TrackerSettings"); trackerSettings.HostSettings = (TrackerHostSettings)GameObject.Find("NodeManager/TrackerHostSettings").GetComponent("TrackerHostSettings"); trackerSettings = (TrackerSettings)originSlave.transform.Find("Flystick").GetComponent("TrackerSettings"); trackerSettings.HostSettings = (TrackerHostSettings)GameObject.Find("NodeManager/TrackerHostSettings").GetComponent("TrackerHostSettings"); //trackerSettings.gameObject.SetActive(false); } else { this.StartClient(); //The camera manipulation happens in Update() //GameObject objOrigin = Instantiate(origin, originParent); //////Spawn the object for the clients //NetworkServer.Spawn(objOrigin); // deactivate music and sound for clients AudioListener.volume = 0f; } }
public CurrencyDataNetworkTemplate() { _dataSerializer = new CsvFinancialSerializer(); _dataDistributor = new DataDistributor(); }
/// <summary> /// Constructor for MainWindow uden parameter /// </summary> public MainWindow() { InitializeComponent(); _controller = new ThreadController(); _dataDistributor = new DataDistributor(); }