// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2020-12-30 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** using System.Collections; using System.Collections.Generic; using UnityEngine; namespace G { /// /// 技能 /// public class SkillBase : MonoBehaviour { #region Field private Rigidbody _rigidbody; private AudioSource _audioSource; #endregion #region Property /// /// 伤害 /// public int damage { get { return (int)_rigidbody.mass; } set { _rigidbody.mass = Mathf.Max(0, value); } } /// /// 持续时间 /// public float duration { get; set; } /// /// 数量 /// public int amount { get; set; } /// /// 概率 /// public int probability { get; set; } /// /// /// public int special1 { get; set; } /// /// /// public int special2 { get; set; } #endregion #region Method public void MovePosition(Vector3 position) { _rigidbody.MovePosition(position); } /// /// /// /// public void PlaySound(AudioClip clip) { if (SoundProxy.Instance.fxEnabled) { _audioSource.clip = clip; _audioSource.Play(); } } #endregion #region Unity // Use this for initialization private void Awake() { _rigidbody = GetComponent(); _audioSource = GetComponent(); if (_audioSource) { SoundProxy.Instance.SetAudioMixer(_audioSource, SoundProxy.FX_LAYER_INDEX); } } // Update is called once per frame private void Update() { } #endregion } }