private void UseJumpProperty(GameObject newRobot, bool isImposter, GameObject selectedSphere) { JumpProperty script = newRobot.AddComponent <JumpProperty> (); script.arCamera = arCamera; script.isImposter = isImposter; script.resultText = resultText; script.gestureButtonScript = holdButton.GetComponent <GestureButton> (); script.selectedSphere = selectedSphere; }
public IEnumerator JumpCoroutine(int index) { float timeCount = 0; JumpProperty p = jumpProperties[index]; jumpStatus[index] = true; if (jumpEvent != null) { jumpEvent.Invoke(); } while (timeCount < p.jumpTime && Input.GetButton("Jump")) { Velocity = VectorUtils.ChangeY(Velocity, p.jumpSpeed); yield return(new WaitForFixedUpdate()); timeCount += Time.fixedDeltaTime; } jumpStatus[index] = false; yield break; }