public void FinishCalibration() { tiltInput = GameObject.FindGameObjectWithTag("TiltInput").GetComponent <AmazeballTiltInput> (); tiltInput.ConfigureVerticalOrientationOffset(); //if in tunnel, resume scoring if (LevelManager.manager.IsTunnelRunner()) { TunnelScoreController scorer = rbBall.GetComponent <TunnelScoreController>(); scorer.ResumeScoring(); } //unfreeze ball rbBall.isKinematic = false; ballInputReader.enabled = true; //reset ball velocity rbBall.velocity = ballVelocity; rbBall.angularVelocity = ballAngularVelocity; //reset stored velocities ballVelocity = Vector3.zero; ballAngularVelocity = Vector3.zero; dropPanel.transform.DOLocalMoveY((Screen.height * 1.2f), 0.5f).OnComplete(Deregister).Play(); }
protected override void Awake() { base.Awake(); this.item = transform.FindChild("Item"); this.hoverEffect = transform.FindChild("HoverEffect").GetComponent <ParticleSystem>(); this.collectEffect = transform.FindChild("CollectEffect").GetComponent <ParticleSystem>(); this.scorer = GameObject.FindObjectOfType <TunnelScoreController>(); }
public void UpdateLastRunData() { TunnelScoreController scoreController = GameObject.FindObjectOfType <TunnelScoreController> (); scoreController.HaltScoring(); lastScore = scoreController.GetScore(); lastDistance = scoreController.GetDistance(); lastKmTime = scoreController.GetFastestKmTime(); lastCrateCount = LevelManager.manager.GetNumCollectablesFound(); }
protected override void Apply(BallController ball) { //ball.gameObject.GetComponent<Rigidbody>().AddForce (ball.GetTargetVelocity().normalized * rocketPower, ForceMode.Impulse); ball.gameObject.GetComponent <Rigidbody>().AddForce(Vector3.Scale(Camera.main.transform.forward, new Vector3(1, 0, 1)).normalized *rocketPower, ForceMode.Impulse); ball.GetComponent <LightsController>().TurnLightTrailOn(); TunnelScoreController scorer = ball.GetComponent <TunnelScoreController> (); for (int i = 0; i < maxMultiplierIncrease; i++) { scorer.checkMultiplier(canDecrease: false); } }
public void StartCalibration() { //if in tunnel, halt scoring if (LevelManager.manager.IsTunnelRunner()) { TunnelScoreController scorer = rbBall.GetComponent <TunnelScoreController>(); scorer.HaltScoring(); } //remember ball's current velocity ballVelocity = rbBall.velocity; ballAngularVelocity = rbBall.angularVelocity; //freeze ball rbBall.isKinematic = true; ballInputReader.enabled = false; Show(); }
void Start() { scorer = GameObject.FindObjectOfType <TunnelScoreController>(); }
void Awake() { sparks = transform.parent.parent.FindChild("Sparks").GetComponentInParent <ParticleSystem> (); scoreController = GameObject.FindGameObjectWithTag("Player").GetComponent <TunnelScoreController> (); }