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); }
public TouchDetector GetTouchDetector(TouchDetectorType touchDetectorType) { if (TouchDetectors.ContainsKey(touchDetectorType)) { return(TouchDetectors[touchDetectorType]); } else { return(null); } }
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); }
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); }
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); }