Ejemplo n.º 1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.name.Contains("Skater"))
     {
         Respawn r = PlayerController.Instance.respawn;
         // Break the pointer reference
         Vector3 playerOffset = r.getSpawn[0].position - r.getSpawn[1].position - new Vector3(0.0f, 0.08f, 0.0f);
         this._pinPos  = new Vector3(r.pin.position.x, r.pin.position.y, r.pin.position.z);
         this._pinQuat = new Quaternion(r.pin.rotation.x, r.pin.rotation.y, r.pin.rotation.z, r.pin.rotation.w);
         r.SetSpawnPos(this._destination.position - playerOffset, this._destination.rotation);
         r.DoRespawn();
         r.SetSpawnPos(this._pinPos - playerOffset, this._pinQuat);
     }
 }
Ejemplo n.º 2
0
 private void Update()
 {
     isRespawning = false;
     movement.z   = Input.GetAxis(Axes.Vertical) * forceSpeed.z;
     movement.x   = Input.GetAxis(Axes.Horizontal) * forceSpeed.x;
     if (Input.GetButton(Axes.Jump))
     {
         doJump = true;
     }
     if (Input.GetKeyDown(KeyCode.R))
     {
         Respawn.DoRespawn(respawn);
     }
 }