Skip to main content
Unity3D

Unity3D Scripting API #13: OnApplicationQuit() 📱

By February 7, 2021February 14th, 2021No Comments
Unity3D Scripting API
https://www.youtube.com/watch?v=d8kIOzEnkmE&feature=youtu.be

⭐ OnApplicationQuit():
📱 Sent to all GameObjects before the application quits.
📱Called when a user quits the game application✅
📱Called when the play mode is exited from✅
📱OnApplicationQuit() takes no argument
📱 Use cases: saving a player’s score upon quitting the game

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CubeController : MonoBehaviour
{
    // Start is called before the first frame update

    void Start()
    {

        Debug.Log("Start event");
    }

   
 void OnApplicationFocus(bool focusState)

    {
        Debug.Log("The application's focus state is: " + focusState);
    }
 void OnApplicationQuit(bool quitState)

    {
        Debug.Log("The application's focus state is: " + quitState);
    }
}

Leave a Reply