コード例 #1
0
        internal static void OnUnequipped(EquippableModComponent modComponent)
        {
            if (modComponent == null)
            {
                return;
            }

            if (modComponent.EquippedModel != null)
            {
                Object.Destroy(modComponent.EquippedModel);
                modComponent.EquippedModel = null;
            }

            modComponent.OnUnequipped?.Invoke();
            ModUtils.PlayAudio(modComponent.StowAudio);
        }
コード例 #2
0
        public static void Equip(EquippableModComponent equippable)
        {
            if (equippable == null)
            {
                return;
            }

            if (equippable.EquippedModelPrefab != null)
            {
                equippable.EquippedModel       = Object.Instantiate(equippable.EquippedModelPrefab, GameManager.GetWeaponCamera().transform);
                equippable.EquippedModel.layer = vp_Layer.Weapon;
            }

            equippable.OnEquipped?.Invoke();

            InterfaceManager.QuitCurrentScreens();
            ModUtils.PlayAudio(equippable.EquippingAudio);
        }