Beispiel #1
0
        public void Start()
        {
            _worldGrid = FindObjectOfType <WorldManagerBehavior>().WorldGrid;

            _statisticContainer = new StatisticDictionaryContainer()
            {
                KnownStats.DamageDone,
                KnownStats.DamageReceived,
            };

            _playerInputHandler = new PlayerInputHandler();
            _reloadLimiter      = new RateLimiter(allowFirst: true);

            _reticule           = transform.Find("Reticle");
            _playerBodyBehavior = transform.Find("Body").GetComponent <PlayerBodyBehavior>();
            _playerBodyBehavior.Initalize(_playerInputHandler);

            _playerBody = _playerBodyBehavior.transform;

            _rigidBody = transform.GetComponent <Rigidbody2D>();
            _hud       = transform.GetComponent <HudInformationBehavior>();

            SelectUsable(AvailableWeaponsDescriptor.FirstOrDefault());

            _hud.Statistics = this._statisticContainer;
        }
 public void Initalize(PlayerInputHandler inputHandler)
 {
     _inputHandler = inputHandler;
 }