using System.Collections.Generic; using AudioSystem.Runtime; using FinTOKMAK.TimelineSystem.Runtime; using NaughtyAttributes; using UnityEngine; using UnityEngine.Serialization; namespace FinTOKMAK.WeaponSystem.Runtime { public class WeaponConfigData : ScriptableObject, IWeaponData { #region Serialized Private Field /// /// The id of the weapon. /// [SerializeField] [BoxGroup("Info")] private string _id; #region Timelines /// /// The timeline played when put out the weapon. /// [SerializeField] [BoxGroup("Timeline")] private Timeline _putoutTimeline; /// /// The timeline played when put in the weapon. /// [SerializeField] [BoxGroup("Timeline")] private Timeline _putinTimeline; #endregion #region Events /// /// The TimelineEvent called when finish weapon put out. /// [TimelineEvent] [BoxGroup("Events")] public string finishPutoutEvent = "root/WEAPON/FINISH_PUT_OUT"; /// /// The TimelineEvent called when finish weapon put in. /// [TimelineEvent] [BoxGroup("Events")] public string finishPutinEvent = "root/WEAPON/FINISH_PUT_IN"; #endregion #endregion #region Public Field /// /// The timeline played when put out the weapon. /// public Timeline putoutTimeline => _putoutTimeline; /// /// The timeline played when put in the weapon. /// public Timeline putinTimeline => _putinTimeline; /// /// The audio config of the weapon. /// [BoxGroup("Audio")] public List audioEventConfigs; /// /// The audio player prefab weapon use. /// [FormerlySerializedAs("playerPrefab")] [BoxGroup("Audio")] public AudioPlayer audioPlayerPrefab; /// /// The mount point of all the audio players. /// [BoxGroup("Audio")] public string audioMountPoint = "audio"; #endregion #region IWeaponData Interface public string id { get => _id; set => _id = value; } public WeaponDataType weaponDataType => WeaponDataType.Config; public IWeaponData DeepCopy() { return ScriptableObject.Instantiate(this); } public virtual IWeaponData ToRuntime() { WeaponRuntimeData runtimeData = ScriptableObject.CreateInstance(); runtimeData.id = _id; runtimeData.putoutTimline = _putoutTimeline; runtimeData.putinTimeline = _putinTimeline; return runtimeData; } #endregion } }