public void Enter() { if (GameManager.Instance.CurrentRoom != null) { GameManager.Instance.CurrentRoom.Exit(); } GameManager.Instance.CurrentRoom = this; _camera.GoTo(_cameraPosition); WeaponMouse vitalWeapon = VitalHardwareBase.Hardware as WeaponMouse; if (vitalWeapon != null) { if (_hwManager.CurrentVitalWeapon != vitalWeapon) { SetCurrentVitalWeapon(vitalWeapon); } vitalWeapon.Info.ShowSelectionIcon(); } Debug.Log("Entered room " + name); }
public void Exit() { WeaponMouse vitalWeapon = VitalHardwareBase.Hardware as WeaponMouse; if (vitalWeapon != null) { vitalWeapon.Info.HideSideIcon(); } }
public void InitVitalWeaponInfo() { if (Vital && Hardware != null) { WeaponMouse weapon = Hardware as WeaponMouse; if (weapon != null) { VitalWeaponInfo info = GameManager.Instance.UI.ActivateWeaponInfo(weapon); weapon.SetInfoUI(info); } } }
private void SetCurrentVitalWeapon(WeaponMouse weapon) { if (weapon != null) { _hwManager.CurrentVitalWeapon.Info.UpdatePortraitColor(false); _hwManager.CurrentVitalWeapon = weapon; _hwManager.CurrentVitalWeapon.Info.UpdatePortraitColor(true); } else { Debug.LogError("The Hardware is null or not a weapon."); } }
public void HandleHardwareDestruction(Hardware hw, HardwareBase hwBase) { WeaponMouse weapon = hw as WeaponMouse; if (weapon != null) { if (hwBase.Vital) { if (weapon == CurrentVitalWeapon) { GameManager.Instance.EndGame(false); } GameManager.Instance.UI.DeactivateWeaponInfo(weapon); } } }