title: Unity: Skipping through GameObjects with different KeyPress
body: <p>I want to have one gameObject active. At the moment with &quot;space&quot; I can count from 1 to 12 and one single gameObject is active. Now I want it the other way round from 12-1 with &quot;Esc&quot; for example...</p>
  <p>Thank you for your help!</p>
  <pre><code>using UnityEngine;
  using System.Collections;
  using System.Collections.Generic;
  
  public class ToggleTest : MonoBehaviour
  {
      public GameObject[] objects;
      public int objCount = 0;
  
  
      void Update()
      {
          if (Input.GetKeyDown(KeyCode.Space))
          {
              objCount += 1;
              objects[objCount].SetActive(true);
              objects[objCount - 1].SetActive(false);
  
          }
  
      }
  }
  </code></pre>