// Update is called once per frame void Update() { //debugText.text = string.Format("Saved bot: {0}", gm.numBotSaved); debugText.text = string.Format("my pos: {0}", subject.GetPosition2D().ToString()); //bot0 distance //float d0 = Vector2.Distance(subject.GetPosition2D(), new Vector2(20, 20)); //float d1 = Vector2.Distance(subject.GetPosition2D(), new Vector2(16, 30)); //debugText.text = string.Format("d0: {0}, d1: {1}", d0, d1); //Show minimap or not if (WaveVR_Controller.Input(mainControllerType).GetPress(WVR_InputId.WVR_InputId_Alias1_Menu)) { ShowCanvas(); } else { HideCanvas(); } // Update countdown time left cdText.text = "剩余时间:" + timeLeft; if (timeLeft <= 0) { StopCoroutine("DecrementTime"); gmGO.BroadcastMessage("BC_Timesup", SendMessageOptions.DontRequireReceiver); } }
private bool checkSubjectReachable() { Vector2 subjectPos = subject.GetPosition2D(); if (Vector2.Distance(subjectPos, myPos) <= reachableDistance) { return(true); } else { return(false); } }