Beispiel #1
0
 private void Update()
 {
     if (Input.GetKey(KeyCode.F))
     {
         shipGuide.Fire(new WeaponFireEvent(new Ray(camera.transform.position, camera.transform.forward)));
     }
 }
Beispiel #2
0
        private void Update()
        {
            if (Input.GetKey(KeyCode.F))
            {
                Debug.DrawRay(camera.transform.position, camera.transform.forward, Color.white, 1f);
                shipGuide.Fire(new WeaponFireEvent(new Ray(camera.transform.position, camera.transform.forward)));
            }

            if (Input.GetKey(KeyCode.Escape))
            {
                playerCharacter.transform.position = Vector3.back * 10f + Vector3.up * 2f;
                playerCharacter.GetComponentInChildren <PlatformController>().platform = null;
                playerCharacter.GetComponentInChildren <Rigidbody>().velocity          = Vector3.zero;
            }
        }