コード例 #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);
        }
コード例 #2
0
        public void Exit()
        {
            WeaponMouse vitalWeapon =
                VitalHardwareBase.Hardware as WeaponMouse;

            if (vitalWeapon != null)
            {
                vitalWeapon.Info.HideSideIcon();
            }
        }
コード例 #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);
         }
     }
 }
コード例 #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.");
     }
 }
コード例 #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);
                }
            }
        }