Beispiel #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;
     }
 }
    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();
        }
    }
Beispiel #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);
    }
Beispiel #4
0
 private void InitializeKeys()
 {
     foreach (var s in Fields)
     {
         FieldInfo fi = s.component.GetType().GetField(s.fieldName);
         if (fi == null)
         {
             Debug.LogError(string.Format("Cannot found a field named '{0}' in component '{1}' type of gameobject '{2}'",
                                          s.fieldName, s.component.GetType(), s.component.name));
             continue;
         }
         if (fi.FieldType == typeof(float))
         {
             s.fieldType = typeof(float);
             s.fieldInfo = fi;
             DebugKey k = Instantiate(FloatKeyPrefab, KeysContainer);
             k.linkedSetting           = s;
             k.transform.localPosition = ComputeKeyPosition();
             ++spawnedItems;
         }
         else if (fi.FieldType == typeof(int))
         {
             s.fieldType = typeof(int);
             s.fieldInfo = fi;
             DebugKey k = Instantiate(IntKeyPrefab, KeysContainer);
             k.linkedSetting           = s;
             k.transform.localPosition = ComputeKeyPosition();
             ++spawnedItems;
         }
         else
         {
             Debug.LogError(string.Format("Cannot add the field named '{0}' in component '{1}' type of gameobject '{2}' to the debug menu because the type : {3} is not handled yet !",
                                          s.fieldName, s.component.GetType(), s.component.name));
             continue;
         }
     }
 }