using System.Collections; using System.Collections.Generic; using UnityEngine; namespace cakeslice { public class Toggle : MonoBehaviour { // Use this for initialization void Start() { } // Update is called once per frame void Update() { if(Input.GetKeyDown(KeyCode.K)) { GetComponent().enabled = !GetComponent().enabled; } } } }