示例#1
0
 void Update()
 {
     if (_trackedKey != null && !_animationStarted)
     {
         if (Vector2.Distance(transform.position.XYComponent(), _trackedKey.transform.position.XYComponent()) < KeyCloseEnoughDistance)
         {
             _trackedKey.AchievedKeyhole();
             _animationStarted = true;
             AnimationToRun.StartAnimation();
             GameObject.Destroy(gameObject);
         }
     }
 }