コード例 #1
0
        public void Deinit()
        {
            Reloader.Deinit();
            Shooter.Deinit();
            Aimer.Deinit();
            Targeting.Deinit();
            TargetFinder.Deinit();

            Reloader.OnReloadingFinish -= OnReloadingFinish;
            Shooter.OnShootingFinished -= OnShootingFinished;
            Aimer.OnAimed   -= OnAimed;
            Shooter.OnShoot -= OnShoot;
        }
コード例 #2
0
        public void Init(int ownerId, Vector3 slotOffset, UnitTargeting unitTargeting, Navigation navigation, ShotsManager shotsManager, TimeManager timeManager)
        {
            _slotOffset = slotOffset;
            _ownerId    = ownerId;
            _navigation = navigation;

            _timeManager  = timeManager;
            _shotsManager = shotsManager;

            Targeting    = new Targeting(unitTargeting);
            Reloader     = new Reloader(timeManager);
            Shooter      = new Shooter(timeManager);
            Aimer        = new Aimer(_navigation, Targeting, _timeManager);
            TargetFinder = new TargetFinder(Targeting, Aimer, _navigation, Range, _ownerId);

            Reloader.OnReloadingFinish += OnReloadingFinish;
            Shooter.OnShootingFinished += OnShootingFinished;
            Aimer.OnAimed   += OnAimed;
            Shooter.OnShoot += OnShoot;
        }