コード例 #1
0
        /// <summary>
        /// Handler for destroy event.
        /// </summary>
        void OnDestroy()
        {
            DebugEx.Verbose("EscapeButtonListenerScript.OnDestroy()");

            if (sInstance == this)
            {
                sInstance = null;
            }
        }
コード例 #2
0
        /// <summary>
        /// Script starting callback.
        /// </summary>
        void Start()
        {
            DebugEx.Verbose("EscapeButtonListenerScript.Start()");

            if (sInstance == null)
            {
                sInstance = this;
            }
            else
            {
                DebugEx.Error("Two instances of EscapeButtonListener not supported");
            }

            mHandlers = new List <IEscapeButtonHandler>();

            enabled = false;
        }