// Start is called before the first frame update void Start() { MatchController.RegisterOnPause(Pause); MatchController.RegisterOnResume(Resume); _startingPosition = _movingTransform.position; ResetPlayer(); //Invert the ratio in order to use multiplication instead of division later on. Faster calculations. _energyToHPRatio = 1.0f / _energyToHPRatio; _weaponsManager = GetComponentInChildren <WeaponsManager>(); if (_weaponsManager == null) { throw new Exception("Error: weapon manager not found in player."); } if (_collisionResolver == null) { throw new Exception("Error: Collision Resolver not found in player!"); } var playerWeapons = new List <WeaponData>(); playerWeapons.Add(new WeaponData() { GloveType = GloveType.Glove, ProjectileType = ProjectileTypeEnum.Physical }); playerWeapons.Add(new WeaponData() { GloveType = GloveType.Glove, ProjectileType = ProjectileTypeEnum.Energy }); _weaponsManager.CreateWeapons(playerWeapons); _currentWeapon = _weaponsManager.GetCurrentWeapon(); InputController.RegisterOnMouseLeftDown(UsePrimaryWeapon); InputController.RegisterOnMouseLeftUp(StopUsingPrimaryWeapon); InputController.RegisterOnMouseRightPressed(SwitchPrimaryWeapon); InputController.RegisterOnTriggerDown(UsePrimaryWeapon); InputController.RegisterOnTriggerUp(StopUsingPrimaryWeapon); InputController.RegisterOnTouchPressed(SwitchPrimaryWeapon); }