Kategorier: Alle - game - controls - physics - script

av Mike Ton 10 år siden

369

Unity3D:UFE

A game developed with Unity3D features an intricate structure, consisting of various components like players, controls, and scripts. Players have distinct control scripts that manage their states, such as crouching, jumping, and hitting.

Unity3D:UFE

Unity3D:UFE

(runtime)

MainCamera
Player Light
Directional Light
Game
TrainingRoom

Plane

Layer == "Ground"

scripts

GlobalInfo.cs

(game)

(background)

(rounds)

AnnouncerOptions{}

(GUI)

GUIOptions{}

(character)

(bounce)

(knockdown)

(block)

ComboOptions{}

public float minPushForce = 5;

HitTypeOptions{}

public GameObject hitParticle;

public bool shakeCharacterOnHit = true;

public bool shakeCameraOnHit = true;

HitOptions{}

HitTypeOptions

crumpleHit;

weakHit;

customHit1;

heavyHit;

mediumHit;

(display)

CharacterRotationOptions{}

CameraOptions{}

(control)

MoveQueueType

NoQueue

QueueAnyMove

QueueOnlyMoveLinks

InputManagerType

ControlFreak

cInput

UnityInputManager

(physics)

HitBoxType

low

high

CollisionType

noCollider

hitCollider

bodyCollider

(player)

Sizes

High

Medium

Small

None

BodyPart

upperTorso

head

none

AnimationType

Mecanim

Legacy

Side

Right

Left

Player

Player2

Player1

float

gravity = .37f;

ScriptableObject

GlobalInfo

//all enums and global classes
MoveSetScript.cs

void

Update()

(crouching)

PlayBasicMove(...){}

(overload)

BasicMoveInfo basicMove, string clipName, float blendingTime, bool replay

BasicMoves{}

BasicMoveInfo

...

crouching = new BasicMoveInfo();

idle = new BasicMoveInfo();

BasicMoveInfo{}

enum

PossibleStates{}

(hit)

HitStun

Block

Down

(jump)

BackJump

ForwardJump

StraightJump

Crouch

Stand

PhysicsScript.cs
ControlsScript.cs
public

class

ControlsScript{}

func

Update(){}

//if crouching

currentState = PossibleStates.Crouch;

//crouching animation currently playing

false

//not blocking

myMoveSetScript.PlayBasicMove(myMoveSetScript.basicMoves.blockingCrouchingPose);

//is blocking

myMoveSetScript.PlayBasicMove(myMoveSetScript.basicMoves.crouching);

true

if (!myMoveSetScript.IsAnimationPlaying(myMoveSetScript.basicMoves.crouching.name)) {}

(check)

//state

//!stunned

//!blockstunned

//physics

//onGround

//current move = null

//control input state down

var

private

ControlsScript

opControlsScript

???

HitBoxesScript

opHitBoxesScript

myHitBoxesScript

PhysicsScript

opPhysicsScript

myPhysicsScript

MoveSetScript

myMoveSetScript

AnimatorStateInfo

currentBaseState

PossibleStates

currentState

InputReferences{}