Coder Social home page Coder Social logo

moto2002 / dn_asset Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ww386362087/dn_asset

1.0 3.0 2.0 409.49 MB

代码整理 AI、CutScene、寻路、Native 龙之谷

Home Page: https://huailiang.github.io/2018/02/23/fashion/

License: MIT License

C# 70.50% ShaderLab 9.00% Batchfile 0.04% Smalltalk 0.19% Shell 0.17% HLSL 1.58% Objective-C 0.05% Objective-C++ 0.28% C 3.37% C++ 14.08% Makefile 0.08% CMake 0.68%

dn_asset's Introduction

Unity 实现Avatar换装

对应fashion.unity

提取资源-预处理

第一步: 从fbx中提取部件mesh, 并给mesh赋值一些必要的属性

第二步: 保存mesh, 并提取出Main Texture,并且保存在本地

第三步: 预处理uv

根据部件位置序列,设置相应uv, 先确保uv的区间在[0,1]之间,然后u加上部件的索引 uvOffsetX对应每个部位的枚举定义值[1-8]。

往往在预处理uv之前,为了减少不必要的计算和内存,也是为了优化,我们会清理掉mesh上可能附带的信息,比如uv2,切线信息。处理好的之后的mesh确保是干净的,且只有我们想要的信息。

第四步: 预处理Texture

在Texture提取出来之后,往往是各种预带有各种信息,这时我们还需要写一个类似格式刷工具把项目里所有的texture全部处理一遍。类似这样实现:

运行时,组装时装

第一步:Shader处理, DrawCall合并

这时游戏中参与光照计算的shader,由八张Texture合并。 Shader针对预处理的uv拼接时装。 下面代码会在MaskNV函数会在vert Shader中调用,BlendColor函数在frag 函数中调用。

第二步 c#动态拼接

  • 收集部件
  • 合并skinmesh
  • 设置材质
  • 设置texture

AI 系统

对应AI.unity

Behavior Designer 是一个行为树插件!是为了让设计师,程序员,美术人员方便使用的可视化编辑器!Behavior Designer 提供了强大的 API 可以让你轻松的创建 tasks(任务),配合 uScript 和 PlayMaker 这样的插件,可以不费吹灰之力就能够创建出强大的 AI 系统,而无需写一行代码!

如果你还不了解什么是行为树(behavior trees)请查看"行为树的概述"!依赖于 Behavior Designer你完全可以不用关心什么是行为树(behavior trees)但是,如果你了解了一些 behavior trees!这将有助于你使用 Behavior Designer,包括一些常用组件,例如:tasks(任务),action(行为),composite(复合),conditional(条件),decorator(修饰符)!

过场动画

对应CutScene.unity

基于帧实现的一套战斗动画 cutscene.

打开 cutscene编辑器,点击 XEditor->Cutscene

你可以在编辑器里编辑特效、文字、声音、动画等

dn_asset's People

Contributors

huailiang avatar

Stargazers

 avatar

Watchers

Jack avatar James Cloos avatar  avatar

Forkers

fuck2ky atom-chen

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.