
1.搭建完了场景3,等待补充动画和相关演出CG
建议:
(1.场景3的前排树的动画很怪,美术看看要不要调整
(2.多张合一张的逐帧动画注意分割像素割齐,不要一个宽100一个宽110这样,保证每一个单元的分辨率一样
可以摸鱼吗😿
42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
|
||
/// <summary>
|
||
/// 状态模式的状态管理员基类,每一组状态的管理员都必须继承这个类
|
||
/// </summary>
|
||
public class StateMachineBase : MonoBehaviour
|
||
{
|
||
protected StateBase currentState;
|
||
protected bool isBegin = false;
|
||
/// <summary>
|
||
/// 改变状态的时候调用
|
||
/// </summary>
|
||
/// <param name="newState"></param>
|
||
public void ChangeState(StateBase newState)
|
||
{
|
||
isBegin = false;
|
||
if (currentState != null)
|
||
{
|
||
currentState.End();
|
||
}
|
||
currentState = newState;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 状态的每一帧调用,需要手动安排到主程序的Update中,切记!
|
||
/// </summary>
|
||
public void StateUpdate()
|
||
{
|
||
if (currentState != null)
|
||
{
|
||
if (!isBegin)
|
||
{
|
||
currentState.Enter();
|
||
isBegin = true;
|
||
}
|
||
currentState.StateUpdate();
|
||
}
|
||
}
|
||
}
|