Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public void Exit()
        {
            WeaponMouse vitalWeapon =
                VitalHardwareBase.Hardware as WeaponMouse;

            if (vitalWeapon != null)
            {
                vitalWeapon.Info.HideSideIcon();
            }
        }
Esempio n. 3
0
 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);
         }
     }
 }
Esempio n. 4
0
 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.");
     }
 }
Esempio n. 5
0
        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);
                }
            }
        }