Teaching Newbies since 2014

  • Home
  • Javascript ❤
    • JavaScript
    • Node.js
  • WebDev Tuts
  • screencasts
  • Resources
  • VR & AR
  • Github
  • Twitter
  • YouTube
  • RSS
  • C++
You are here: Home / Unity3D / Unity3D Scripting API #13: OnApplicationQuit() 📱

February 7, 2021 by: Kauress

Unity3D Scripting API #13: OnApplicationQuit() 📱

⭐ 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);
    }
}
Unity3D Scripting API #12: OnApplicationFocus() 📱
Introduction to C# in Unity3D #6: Operators – Part 1 📠

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2022 ·Kauress

Go to mobile version