read mepdf v3_0_03input

9
Input Manager 1 All of the Controls were referenced from InputManager 1. Create an Empty GameObject, Name it InputManager, and add InputManager script to it 2. Mouse Sensitivity are mainly use for how fast Camera Control move. Higher number will cause the Camera to move Faster Last Updated in 1.0

Upload: matumit-sombunjaroen

Post on 06-Aug-2015

47 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Read mepdf v3_0_03input

Input Manager 1

All of the Controls were referenced from InputManager 1. Create an Empty GameObject, Name it InputManager, and add InputManager script to it 2. Mouse Sensitivity are mainly use for how fast Camera Control move.

• Higher number will cause the Camera to move Faster

Last Updated in 1.0

Page 2: Read mepdf v3_0_03input

Input Manager 2

InputManager contain optional Setup for CInput

If you want to replace with Cinput instead, Replace Scripts in InputManager with Scripts from InputManager_Cinput

Last Updated in 2.3

Page 3: Read mepdf v3_0_03input

Input Module

Unit Control

AI Input

Unit Input Module

Player Input

Unit Control is controlled by InputModule On Awake() If isAI is true, The unit will add AI Input to itself and will be

control via AI module AIModule is empty and will do nothing at the

moment If isAI is false, The Unit will be control by Player’s Input If CanSwitchAIAtRuntime is true, AI and Player Input will both be included and can

be switch during Runtime

Last Updated in 2.0

Page 4: Read mepdf v3_0_03input

Unit Switcher

Last Updated in 2.5

If you want to be able to Switched Control Characters on the fly, do the following

Add UnitSwitcher Component to any GameObject of your choice. Drag Camera GameObject with CameraControl to Camera Control Add Characters with Unit_InputModule to Character Slots

CanSwitchAIOnTheFly for each Characters must be manually turned on You can Switch Character by Pressing F5 to F8 Input can be adjust in Input Manager, SelectUnit()

Page 5: Read mepdf v3_0_03input

AI Scripting Guideline

Last Updated in 3.0

**NOTE** Because Core feature continued being developed, AI is not available right out of the box. This is simply a sample Guideline. Inside folder, Script/Controls/Input please look at the following files, InputModule_AI_Base InputModule_Player InputModule_Interface InputModule_AI_Base and InputModule_Player share the same Interface from InputModule_Interface. Public functions in InputModule_Player, can be reference and apply to InputModule_AI_Base.

Page 6: Read mepdf v3_0_03input

AI Scripting Guideline

Last Updated in 2.301

Let say that there are 2 States in which the Character either stand still or move forward, public MovementSpeedVector CalcMoveSpeed( float rotSpeed ) { if( STATE.STANDSTILL ) { return new MovementSpeedVector( 0.0f, unitTransform.forward ); } //Moving Forward Vector3 movingDirection = //Some Scripts that determine where the Character is heading// return new MovementSpeedVector( 1.0f, movingDirection ); }

////Note that the current version of MovementSpeedVector script is not yet optimized

Page 7: Read mepdf v3_0_03input

AI Scripting Guideline

Last Updated in 2.301

To make Character Attack public bool Attack1() { if( STATE.STANDSTILL ) return false; return true; }

Page 8: Read mepdf v3_0_03input

AI Scripting Guideline

Last Updated in 2.301

It would also be more convenient to do something like the following, public MovementSpeedVector speedVector = new MovementSpeedVector(); public bool attack1Bool = false; public void Update() { if( STATE.STANDSTILL ) { speedVector = new MovementSpeedVector( 0.0f, unitTransform.forward ); attack1Bool = false; return; } //Attack+MovingForward Vector3 movingDirection = //Some Scripts that determine where the Character is heading// speedVector = new MovementSpeedVector( 1.0f, movingDirection ); attack1Bool = true; } public MovementSpeedVector CalcMoveSpeed( float rotSpeed ) { return speedVector; } public bool Attack1() { return attack1Bool ; }

//For the thing inside Update(), these could be Refactor to inherited Class for different AI types, while retaining the rest in AI_Base

Page 9: Read mepdf v3_0_03input

AI Scripting Guideline

Last Updated in 2.5

For demonstration Purpose, ControlExplain.cs AIUpdate() control boolean that are referenced by AIModule