private void Start() { detectionEvent = gameObject.GetComponentInParent(typeof(MonsterDetectionEvent)) as MonsterDetectionEvent; if (detectionEvent == null) { Debug.LogWarning(this + " doesn't have a MonsterDetectionEvent in its parent, footstep won't be registered in events"); } initialDistanceToStep = distanceToStep; initialStepDuration = stepDuration; startPos = foot.position; currentTarget.position = foot.position; }
private void Start() { detectionEvent = GetComponent <MonsterDetectionEvent>(); detectionEvent.OnWallIsNextBy += OnWallIsNextHandler; detectionEvent.OnPlayerDetected += OnPlayerDetectedHandler; detectionEvent.OnPlayerNotDetectedAnymore += OnPlayerNotDetectedAnymoreHandler; detectionEvent.OnMonsterHit += OnMonsterHitHandler; heightPosition = _body.position.y; _initialSpeed = speed; detectionEvent.ShiftDirection(new MonsterDetectionEvent.ShiftDirectionEventArgs { newDir = _dir }); }
public void Initialize(MonsterDetectionEvent eventDetection, MonsterDetectionEvent.HitBox hitbox) { _eventDetection = eventDetection; _hitbox = hitbox; }
private void Start() { detectionEvent = GetComponent <MonsterDetectionEvent>(); detectionEvent.OnMonsterDie += OnMonsterDie; detectionEvent.OnMonsterHit += OnMonsterHit; }