Esempio n. 1
0
 private void OnWallIsNextHandler(object sender, MonsterDetectionEvent.WallIsNextByEventArgs e)
 {
     ShiftDirection(_dir);
     detectionEvent.ShiftDirection(new MonsterDetectionEvent.ShiftDirectionEventArgs {
         newDir = _dir
     });
 }
Esempio n. 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
        });
    }