Giter Site home page Giter Site logo

time-control's Introduction

时间回溯 TimeControl 简介 Intro

爱姬kurisu设计的一个时间回溯系统,包含基础的Transform回溯器,基于Animator录制的动画回溯器,基于记录层结构的自定义回溯器。支持游戏中记录、回溯和重播。你也可以自定义记录数据、记录层和回溯器,拓展记录方法和回溯方法,从而快速实现一些非线性时空的游戏玩法!(不包含Netcode部分代码)

安装

  • 直接复制到自己项目中,使用时using相应命名空间
  • 如出现报错说明没有Odin插件,可将代码中标红Attribute去除,不影响使用

使用

  1. 在场景内创建空物体添加TimeController和TimeManager脚本
  • 在希望回溯的物体上添加基础回溯器TimeStore
  • 设置TimeManager的触发按键,游戏中按下进行记录和回溯
  • 尝试其他类型的回溯器例如RecordStore
  • 尝试自定义的回溯器如CustomizedStore
  • 自定义回溯器需要设置自定义记录层,你可以右键Create/TimeControl找到可以设置的记录层。例如AnimatorLayerLayer可以记录动画状态机中一个层级的数据,你需要为layerIndex赋值来设置记录的层级。记录层设置完后将作为一个模板,你可以给不同回溯器上添加相同的记录层,在游戏运行时回溯器会根据模板复制出新的实例。

拓展

  • 自定义回溯器=>继承CustomizedStore
  • 自定义记录层=>继承GenericLayer
  • 自定义同步=>继承ITimeSync接口

联网拓展

  • 可以使用Netcode结合同步接口实现主机端和客户端的回溯同步

样例

time-control's People

Contributors

akikurisu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.