Exemplo n.º 1
0
 public void Update()
 {
     if (DebugKey.GetKeyDown(KeyCode.D))
     {
         rigidbody.useGravity  = !_inSpace.Value;
         rigidbody.isKinematic = false;
         collider.enabled      = true;
         rigidbody.velocity    = Vector3.one;
         Vector3 randomDirection = UnityEngine.Random.insideUnitSphere;
         rigidbody.velocity += randomDirection;
     }
 }
Exemplo n.º 2
0
    void Update()
    {
        if (DebugKey.GetKeyDown(KeyCode.G))
        {
            cheatGodMode = !cheatGodMode;
            Debug.Log("God mode: " + cheatGodMode);
        }

        if (DebugKey.GetKeyDown(KeyCode.B))
        {
            //GamePlayer.localGamePlayer.StopNetworkTimer();
            //_explosionPower = 1;
            Explode();
            StartCoroutine(Explode());
            _lifespan.Value             = 0f;
            _explodeBeforeReachingSpace = true;
            _explodeInSpace             = true;
        }

        if (DebugKey.GetKeyDown(KeyCode.D))
        {
            Vector3 velocity = GetComponent <Rigidbody>().velocity;
            rigidbody.isKinematic = true;
            gameObject.GetComponent <Collider>().enabled = false;
        }

        if (DebugKey.GetKeyDown(KeyCode.I))
        {
            StopAllCoroutines();
            GamePlayer.localGamePlayer.InterruptNetworkTimer();
            StartCoroutine(TransitionToResults(0));
        }

        if (Input.GetKeyDown(KeyCode.K))
        {
            //_launchSpeed = 90;
            StartCoroutine(DebugForcedLaunch());
        }

        if (_inSpace.Value == true)
        {
            // if we're in space, fly
            FlyThroughSpace();
        }
    }
Exemplo n.º 3
0
    private void Update()
    {
        if (DebugKey.GetKeyDown(KeyCode.S))
        {
            _cheatScreenSaverMode = !_cheatScreenSaverMode;
            Debug.Log("Screensaver Mode = " + _cheatScreenSaverMode.ToString());
        }

        // do calculations for the score counting up


        // planet flyby
        _travelTimer += Time.deltaTime;
        PlanetFlyBy();

        // space background texture scrollby
        _backdropOffset.y -= Time.deltaTime * _backdropSpeed;
        _backdropMaterial.SetTextureOffset(_backdropNameID, _backdropOffset);
    }