Exemplo n.º 1
0
        /// <summary>
        /// Indicates that the command has finished and calls the OnDeathCallback event.
        /// Also unpauses our game and resumes input handling if necessary.
        /// </summary>
        public override void Die()
        {
            base.Die();

            // Clear our previous command reference so we don't have a memory leak with references not being released
            // This is really important if we have a string of commands otherwise they will not be GB until the final one is completed
            if (PreviousCommand != null)
            {
                PreviousCommand = null;
            }

            if (!GameHandleInput)
            {
                ParentScreen.ShouldHandleInput = true;
            }

            if (!GameUpdate)
            {
                ParentScreen.ShouldUpdate = true;
            }

            OnDeathCallback?.Invoke(this);
        }
Exemplo n.º 2
0
 public void SetCallback(OnDeathCallback callBack)
 {
     onDeathCallback = callBack;
 }