Esempio n. 1
0
        public bool CanMoveThrough(TouchDetectorType touchDetectorType)
        {
            if (controlMechanism.controlType == ControlType.ENEMY)
            {
                return(true);
            }

            if (TouchDetectors.ContainsKey(touchDetectorType))
            {
                TouchDetector t = TouchDetectors[touchDetectorType];
                if (t.IsTouching)
                {
                    foreach (GameObject obj in t.GeneralObjects)
                    {
                        if (obj.name.Contains("Enemy"))
                        {
                            if (controlMechanism.characterStateController.CurrentState.GetType() != typeof(PlayerRunningSlide))
                            {
                                AIControl ai = obj.GetComponent <AIControl>();
                                if (!ai.IsDead())
                                {
                                    return(false);
                                }
                            }
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
            }
            return(true);
        }
Esempio n. 2
0
 public TouchDetector GetTouchDetector(TouchDetectorType touchDetectorType)
 {
     if (TouchDetectors.ContainsKey(touchDetectorType))
     {
         return(TouchDetectors[touchDetectorType]);
     }
     else
     {
         return(null);
     }
 }
Esempio n. 3
0
 public bool IsTouchingGeneralObject(TouchDetectorType touchDetectorType)
 {
     if (TouchDetectors.ContainsKey(touchDetectorType))
     {
         TouchDetector t = TouchDetectors[touchDetectorType];
         if (t.IsTouching)
         {
             if (t.GeneralObjects.Count > 0)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Esempio n. 4
0
 public bool UpdateHit(TouchDetectorType touchDetectorType, ref ControlMechanism target)
 {
     if (IsWithinAttackTime())
     {
         TouchDetector detector  = characterData.GetTouchDetector(touchDetectorType);
         Touchable     touchable = GetFirstTouch(detector, TouchableType.CHARACTER);
         if (touchable != null)
         {
             touchable.controlMechanism.characterStateController.TakeHit(controlMechanism, characterData.characterAnimationData.DesignatedAnimation);
             target = touchable.controlMechanism;
             return(true);
         }
     }
     return(false);
 }
Esempio n. 5
0
 public bool IsTouchingPlayer(TouchDetectorType touchDetectorType)
 {
     if (TouchDetectors.ContainsKey(touchDetectorType))
     {
         TouchDetector t = TouchDetectors[touchDetectorType];
         if (t.IsTouching)
         {
             foreach (GameObject obj in t.GeneralObjects)
             {
                 if (obj.name.Contains("Player"))
                 {
                     return(true);
                 }
             }
         }
     }
     return(false);
 }