Skip to main content

Unity3D Scripting API #9: OnDisable() 🛡

By January 31, 2021February 14th, 2021No Comments
Unity3D Scripting API

⭐ OnDisable()

🛡️Called whenever the script component is disabled
🛡️ Also called when a game object is destroyed. When you quit your game, the scripts (which are game objects) are destroyed and this triggers the OnDisable() event method
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CubeController : MonoBehaviour
    // Start is called before the first frame update
    void Start()
    void Update()

    void OnDisable()
        Debug.Log("On Disable");


Leave a Reply