示例#1
0
 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;
 }
示例#2
0
    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
        });
    }
示例#3
0
 public void Initialize(MonsterDetectionEvent eventDetection, MonsterDetectionEvent.HitBox hitbox)
 {
     _eventDetection = eventDetection;
     _hitbox         = hitbox;
 }
示例#4
0
 private void Start()
 {
     detectionEvent = GetComponent <MonsterDetectionEvent>();
     detectionEvent.OnMonsterDie += OnMonsterDie;
     detectionEvent.OnMonsterHit += OnMonsterHit;
 }