85 lines
2.2 KiB
C#
85 lines
2.2 KiB
C#
// ***********************************************************************
|
||
// Assembly : Game
|
||
// Author : Kimch
|
||
// Created : 2020-09-02
|
||
// Description :
|
||
// Last Modified By :
|
||
// Last Modified On :
|
||
// ***********************************************************************
|
||
// <copyright file= "Stat_IdleAction" company="Kimch"></copyright>
|
||
// <summary></summary>
|
||
// ***********************************************************************
|
||
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
namespace G
|
||
{
|
||
|
||
public class Stat_DarkenAction : Stat_BaseAction
|
||
{
|
||
private string animNam = string.Empty;
|
||
|
||
#pragma warning disable CS0414 // 字段“Stat_DarkenAction.m_bAnimEnd”已被赋值,但从未使用过它的值
|
||
private bool m_bAnimEnd = true;
|
||
#pragma warning restore CS0414 // 字段“Stat_DarkenAction.m_bAnimEnd”已被赋值,但从未使用过它的值
|
||
|
||
private Vector3 posOffY = new Vector3(0f, 0.002f, 0f);
|
||
|
||
public Stat_DarkenAction(Stat_StateManager statMgr)
|
||
: base(statMgr)
|
||
{
|
||
}
|
||
|
||
public override bool Enter(Dictionary<string, object> param, bool clearDelegates = false)
|
||
{
|
||
base.Enter(param, clearDelegates);
|
||
//m_char.EndOutofCameraHint();
|
||
//m_char.SetColliderEnabled(false);
|
||
//m_char.ReleaseDataOnDead();
|
||
//m_char.SetAttributeTexture(AtkDamageAttribute.DARKEN);
|
||
m_curAniLength = 1.2f;
|
||
if (param.ContainsKey("darken_time"))
|
||
{
|
||
m_curAniLength = (float)param["darken_time"];
|
||
}
|
||
animNam = "behitdown";
|
||
m_bAnimEnd = false;
|
||
m_statMgr.AddTimer(0.05f, AnimationLoop_CB, null, true);
|
||
m_statMgr.AddTimer(m_curAniLength, AnimationEnd_CB);
|
||
return true;
|
||
}
|
||
|
||
private bool AnimationLoop_CB(object[] param)
|
||
{
|
||
m_char.StopAnimation();
|
||
m_char.PlayAnimation(animNam);
|
||
return true;
|
||
}
|
||
|
||
private bool AnimationEnd_CB(object[] param)
|
||
{
|
||
m_bAnimEnd = true;
|
||
//return m_char.OnDead();
|
||
return false;
|
||
}
|
||
|
||
public override bool UpdateDelegate()
|
||
{
|
||
Vector3 curPos = m_char.position;
|
||
m_char.position = (curPos + posOffY);
|
||
return true;
|
||
}
|
||
|
||
public override bool Exit()
|
||
{
|
||
//m_char.ResetMainTexture();
|
||
return base.Exit();
|
||
}
|
||
|
||
public override bool CanTransition(enStat stat)
|
||
{
|
||
return false;
|
||
}
|
||
}
|
||
}
|