132 lines
2.1 KiB
C#
132 lines
2.1 KiB
C#
![]() |
// ***********************************************************************
|
|||
|
// Assembly : Game
|
|||
|
// Author : Kimch
|
|||
|
// Created : 2020-12-30
|
|||
|
// Description :
|
|||
|
// Last Modified By :
|
|||
|
// Last Modified On :
|
|||
|
// ***********************************************************************
|
|||
|
// <copyright file= "SkillBase" company="Kunpo"></copyright>
|
|||
|
// <summary></summary>
|
|||
|
// ***********************************************************************
|
|||
|
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace G
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 技能
|
|||
|
/// </summary>
|
|||
|
public class SkillBase : MonoBehaviour
|
|||
|
{
|
|||
|
#region Field
|
|||
|
|
|||
|
private Rigidbody _rigidbody;
|
|||
|
private AudioSource _audioSource;
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Property
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 伤害
|
|||
|
/// </summary>
|
|||
|
public int damage
|
|||
|
{
|
|||
|
get { return (int)_rigidbody.mass; }
|
|||
|
set { _rigidbody.mass = Mathf.Max(0, value); }
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 持续时间
|
|||
|
/// </summary>
|
|||
|
public float duration
|
|||
|
{
|
|||
|
get;
|
|||
|
set;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 数量
|
|||
|
/// </summary>
|
|||
|
public int amount
|
|||
|
{
|
|||
|
get;
|
|||
|
set;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 概率
|
|||
|
/// </summary>
|
|||
|
public int probability
|
|||
|
{
|
|||
|
get;
|
|||
|
set;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
public int special1
|
|||
|
{
|
|||
|
get;
|
|||
|
set;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
public int special2
|
|||
|
{
|
|||
|
get;
|
|||
|
set;
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Method
|
|||
|
|
|||
|
public void MovePosition(Vector3 position)
|
|||
|
{
|
|||
|
_rigidbody.MovePosition(position);
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
/// <param name="clip"></param>
|
|||
|
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<Rigidbody>();
|
|||
|
_audioSource = GetComponent<AudioSource>();
|
|||
|
if (_audioSource)
|
|||
|
{
|
|||
|
SoundProxy.Instance.SetAudioMixer(_audioSource, SoundProxy.FX_LAYER_INDEX);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
// Update is called once per frame
|
|||
|
private void Update()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|