Пример #1
0
 public void OnTeleport(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         VncEventSystem.Trigger(new GameEvent {
             Event = GameEventType.TrackRestart
         });
     }
 }
Пример #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         VncEventSystem.Trigger(new GameEvent {
             Event = GameEventType.TrackEnd
         });
     }
 }
Пример #3
0
        public void CheckFire(GameObject target = null)
        {
            if (Input.GetButtonDown("Fire1"))
            {
                m_MouseLook.Kick(10);
                //m_Gun.LookAt(gunHitpoint);

                Bullet bullet = Instantiate(m_bulletPrefab, m_Gun.position, m_Gun.rotation);
                bullet.SetTarget(gunHitpoint, m_bulletSpeed);

                if (target)
                {
                    VncEventSystem.Trigger(new ButtonPressedEvent {
                        target = target
                    });
                }
            }
        }
Пример #4
0
        void Update()
        {
            if (IsAlive && !GameManager.Instance.Paused)
            {
                m_View.gameObject.SetActive(true);
                body.useGravity = true;

                UpdateView();
                UpdateGun();

                // get input
                FacingDirection = transform.forward;
                FowardInput     = (Input.GetButton("Forward") ? 1 : 0) - (Input.GetButton("Backwards") ? 1 : 0);
                float strafe = (Input.GetButton("Right") ? 1 : 0) - (Input.GetButton("Left") ? 1 : 0);

                // body rotation
                float aimSpeed = aimAssist ? m_Settings.m_aimAssistSpeed : 1f;
                Yaw = Input.GetAxis("LookHorizontal") * m_MouseLook.m_HorizontalSpeed * aimSpeed;

                if (Input.GetButtonDown("Crouch"))
                {
                    CrouchInput = true;
                }

                if (Input.GetButtonDown("Jump") && OnGround)
                {
                    JumpInput = true;
                }

                RecoverInput = Input.GetButtonDown("Recover");

                wishDir  = transform.TransformDirection(Vector3.forward) * FowardInput;
                wishDir += transform.TransformDirection(Vector3.right) * strafe;
                wishDir.Normalize();

                if (Input.GetButtonDown("Restart"))
                {
                    VncEventSystem.Trigger(new GameEvent {
                        Event = GameEventType.TrackRestart
                    });
                }
            }
        }
Пример #5
0
        void Start()
        {
            GameManager.Instance.playerInstance = FindObjectOfType <SkatingController>();
            if (GameManager.Instance.playerInstance == null)
            {
                GameManager.Instance.playerInstance = Instantiate(m_playerPrefab, transform.position, transform.rotation);
            }
            else
            {
                GameManager.Instance.playerInstance.transform.position = transform.position;
                GameManager.Instance.playerInstance.transform.rotation = transform.rotation;
            }

            ownCamera.gameObject.SetActive(false);
            GameManager.Instance.currentStartPoint = this;

            VncEventSystem.Trigger(new GameEvent {
                Event = GameEventType.TrackStart
            });
        }
Пример #6
0
 private void Update()
 {
     if (Input.GetButtonDown("Pause"))
     {
         if (Paused)
         {
             VncEventSystem.Trigger(new GameEvent {
                 Event = GameEventType.Resume
             });
             Paused = false;
         }
         else
         {
             VncEventSystem.Trigger(new GameEvent {
                 Event = GameEventType.Pause
             });
             Paused = true;
         }
     }
 }
Пример #7
0
 public void Restart()
 {
     VncEventSystem.Trigger(new GameEvent {
         Event = GameEventType.TrackRestart
     });
 }