예제 #1
0
 public static void IssueOnSurvived()
 {
     if (OnSurvived != null)
     {
         OnSurvived.Invoke();
     }
 }
예제 #2
0
        // Start eating progress and check whether we died or not
        public void Eat(int target)
        {
            _anim.SetTrigger("Eat");

            if (_currentTarget != target)
            {
                // Die after 3 seconds to make it exciting if the user choose right or wrong.
                DOVirtual.DelayedCall(3f, Die);
            }
            else
            {
                // Call survive event after 1.5 seconds to start whole process over.
                DOVirtual.DelayedCall(1.5f, () => OnSurvived?.Invoke());
            }
        }