/// ---------------------------------------------
/// Ultimate Character Controller
/// Copyright (c) Opsive. All Rights Reserved.
///
https://www.opsive.com
/// ---------------------------------------------
using UnityEngine;
using Opsive.UltimateCharacterController.Character;
using Opsive.UltimateCharacterController.Character.Abilities.Items;
public class BuildToggleWeaponOff : ItemAbility
{
[Tooltip("A reference to the Ultimate Character Controller character.")]
[SerializeField] protected GameObject m_Character;
/// <summary>
/// Equips the item.
/// </summary>
private void start ()
{
var characterLocomotion = m_Character.GetComponent<UltimateCharacterLocomotion>();
if (characterLocomotion != null) {
// Equip a specific index within the ItemSetManager with the EquipUnequip ability.
var equipUnequip = characterLocomotion.GetAbility<EquipUnequip>();
if (equipUnequip != null) {
// Equip the ItemSet at index -1 within the ItemSetManager.
equipUnequip.StartEquipUnequip(-1);
}
}
}
}