// this chain is pretty ugly IEnumerator UpdateSlaveStillPositions(int inShotCount) { while (cueController.stillBallPocketed == null || cueController.stillBallPositions == null) { yield return(null); } yield return(new WaitForEndOfFrame()); // slave would sprodically supply some user info and other info to master. but this doesn't change our fail scenario, in which slaves are strictly listening and master talking // we need to make sure that game should be able to carry on without any functional glitches even when the slave is completely slient if (cueController.NetworkSlaveInControl()) { cueController.updateSlaveStillPositions(inShotCount); } }
void SlideBallPivot(CircularSlider circularSlider) { if (cueController.NetworkSlaveInControl()) { return; } GameManager_script.Instance().CanControlCue = false; transform.localPosition = new Vector3(-circularSlider.displacementZ, circularSlider.displacementX, 0.0f); float distance = Vector3.Distance(transform.position, strPosition); if (distance > radius) { transform.position -= (distance - radius) * (transform.position - strPosition).normalized; } }
void MoveForceSlider(Slider slider) { if (!cueController.allIsSleeping) { return; } if (cueController.NetworkSlaveInControl() || cueController.BotInControl() || cueController.NetworkBotInControl()) { return; } cueController.cueForceisActive = true; cueForceValue = slider.Value; transform.localScale = new Vector3(slider.Value, 1.0f, 1.0f); mesr.sharedMaterial.SetTextureScale("_MainTex", new Vector2(1.0f, slider.Value)); cueController.cueDisplacement = cueController.cueMaxDisplacement * cueForceValue; }