备份CatanBuilding瘦身独立工程
This commit is contained in:
61
Assets/Scripts/GampPlay/ChallengeMatch/ChallengeKiller.cs
Normal file
61
Assets/Scripts/GampPlay/ChallengeMatch/ChallengeKiller.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using PlayFab.Internal;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 挂在到鳄鱼或者其他东西身上
|
||||
/// </summary>
|
||||
///
|
||||
public class ChallengeKiller : MonoBehaviour
|
||||
{
|
||||
|
||||
[Header("下沉上浮动画")]
|
||||
[SerializeField]
|
||||
private Animation aniOnOrOff;
|
||||
[SerializeField]
|
||||
private string startActionName;
|
||||
[SerializeField]
|
||||
private string endActionName;
|
||||
|
||||
|
||||
[Header("Eye眨眼动画")]
|
||||
[SerializeField] private Animation aniEye;
|
||||
//
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Log("Awake");
|
||||
}
|
||||
|
||||
public async Task OnAttackingStart(float actionTime = 0.3f)
|
||||
{
|
||||
if (aniOnOrOff)
|
||||
{
|
||||
aniOnOrOff.Play(startActionName);
|
||||
}
|
||||
await Awaiters.Seconds(actionTime);
|
||||
}
|
||||
|
||||
public async Task OnAttackingEnd(float actionTime = 0.3f)
|
||||
{
|
||||
if (aniOnOrOff)
|
||||
{
|
||||
aniOnOrOff.Play(endActionName);
|
||||
}
|
||||
await Awaiters.Seconds(actionTime);
|
||||
}
|
||||
public void OnIdle()
|
||||
{
|
||||
if (aniEye)
|
||||
{
|
||||
aniEye.Play();
|
||||
}
|
||||
}
|
||||
|
||||
private void Log(object t)
|
||||
{
|
||||
Debug.Log($"Killer -> {t}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user