日志2025.2.1

ops/2025/2/3 2:36:42/

日志2025.2.1
1.做了敌人状态机
public class EnermyStateMachine
{
    public EnermyState currentState { get; private set; }

    public void InitializeState(EnermyState startState)
    {
        currentState = startState;
        currentState.Enter();
    }

    public void ChangeState(EnermyState newState)
    {
        currentState.Exit();
        currentState = newState;
        currentState.Enter();
    }

}


2.简略做了近战敌人
public class EnermyStateMachine
{
    public EnermyState currentState { get; private set; }

    public void InitializeState(EnermyState startState)
    {
        currentState = startState;
        currentState.Enter();
    }

    public void ChangeState(EnermyState newState)
    {
        currentState.Exit();
        currentState = newState;
        currentState.Enter();
    }

}

public class MoveState_Melee : EnermyState
{
    private Enermy_Melee enermy;
    private Vector3 destination;

    public MoveState_Melee(Enermy enermyBase, EnermyStateMachine stateMachine, string animBoolName) : base(enermyBase, stateMachine, animBoolName)
    {
        enermy = (Enermy_Melee)enermyBase;
    }

    public override void Enter()
    {
        base.Enter();

        destination = enermy.GetPatrolDestination();
        enermy.agent.destination = destination;

    }

    public override void Exit()
    {
        base.Exit();
    }

    public override void Update()
    {
        base.Update();
    }
}


http://www.ppmy.cn/ops/155193.html

相关文章

C#面向对象(封装)

1.什么是封装? C# 封装 封装 被定义为“把一个或多个项目封闭在一个物理的或者逻辑的包中”。 在面向对象程序设计方法论中,封装是为了防止对实现细节的访问。 抽象和封装是面向对象程序设计的相关特性。 抽象允许相关信息可视化,封装则使开发者实现所…

Python之Excel操作 - 读取数据

我们将使用 openpyxl 库,它是一个功能强大且易于使用的库,专门用于处理 Excel 文件。 1. 安装 openpyxl 首先,你需要安装 openpyxl 库。你可以使用 pip 命令进行安装: pip install openpyxl2. 读取 Excel 文件 要读取 Excel 文…

conda配置channel

你收到 CondaKeyError: channels: value https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main not present in config 错误是因为该镜像源(https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main)可能没有被正确添加到 Conda 的配置文件中&…

Flink Connector 写入 Iceberg 流程源码解析_confluent icebergsinkconnector

// 添加 Writer 算子&#xff0c;有并行度SingleOutputStreamOperator<WriteResult> writerStream appendWriter(distributeStream, flinkRowType, equalityFieldIds);// 添加 Commit 算子&#xff0c;并行度固定为 1 SingleOutputStreamOperator<Void> committerS…

深入理解若依RuoYi-Vue数据字典设计与实现

深入理解若依数据字典设计与实现 一、Vue2版本主要文件目录 组件目录src/components&#xff1a;数据字典组件、字典标签组件 工具目录src/utils&#xff1a;字典工具类 store目录src/store&#xff1a;字典数据 main.js&#xff1a;字典数据初始化 页面使用字典例子&#xf…

“开源AI智能名片2+1链动模式S2B2C商城小程序源码”在市场推广中的应用与策略

摘要&#xff1a;本文旨在探讨“开源AI智能名片21链动模式S2B2C商城小程序源码”在市场推广中的应用策略。通过分析品牌与企业实力的展示、产品体验分享以及赋能B端合作伙伴的重要性&#xff0c;本文提出了一套系统的市场推广方案。该方案强调以信任为基础&#xff0c;以自用体…

基于GS(Gaussian Splatting)的机器人Sim2Real2Sim仿真平台

项目地址&#xff1a;RoboGSim 背景简介 已有的数据采集方法中&#xff0c;遥操作&#xff08;下左&#xff09;是数据质量高&#xff0c;但采集成本高、效率低下&#xff1b;传统仿真流程成本低&#xff08;下右&#xff09;&#xff0c;但真实度&#xff08;如纹理、物理&…

分布式服务接口的幂等性如何设计(比如不能重复扣款)?

面试题 分布式服务接口的幂等性如何设计&#xff08;比如不能重复扣款&#xff09;&#xff1f; 面试官心理分析 从这个问题开始&#xff0c;面试官就已经进入了实际的生产问题的面试了。 一个分布式系统中的某个接口&#xff0c;该如何保证幂等性&#xff1f;这个事儿其实是…