【Unity插件】Corgi Topdown Engine使用笔

2021-03-25  本文已影响0人  zitaoye

基本的角色Character

The best wayt to access the player(s) via script is via the LevelManager class,

// this will freeze your main character
LevelManager.Instance.Players[0].Freeze();

// sets the main character's max Health to 50
LevelManager.Instance.Players[0].gameObject.MMGetComponentNoAlloc<Health>().MaximumHealth = 50;

// forces the character to dash
LevelManager.Instance.Players[0].gameObject.MMGetComponentNoAlloc<CharacterDash>().StartDash();

Topdown Controller
Character组件作为一个中心点
Health组件来处理伤害问题
Character Abilities 最重要的来封装15种能力 (可选)

Standard Abilities

自己写技能可参见 https://topdown-engine-docs.moremountains.com/character-abilities.html#ability-overview

AI 部分

AIState : A State is a combination of one or more actions, and one or more transitions. An example of a state could be “patrolling until an enemy gets in range”. 不同action地组合
AIAction : Actions are behaviours and describe what your character is doing. Examples include patrolling, shooting, jumping, etc. The engine comes with a lot of predefined actions, and it’s very easy to create your own. 形容aciton是个什么东西
AIDecision : Decisions are components that will be evaluated by transitions, every frame, and will return true or false. Examples include time spent in a state, distance to a target, or object detection within an area. 判断是否需要过渡
AITransition : Transitions are a combination of one or more decisions and destination states whether or not these transitions are true or false. An example of a transition could be “if an enemy gets in range, transition to the Shooting state”. 包括了decisions条件以及目标状态
AIBrain : the AI brain is responsible for going from one state to the other based on the defined transitions. It’s basically just a collection of states, and it’s where you’ll link all the actions, decisions, states and transitions together. 将这些东西链接在一起

装备武器

需要有CharacterHandleWeapon的方法 -
Weapon Attachment

上一篇 下一篇

猜你喜欢

热点阅读