Sei sulla pagina 1di 4

When you create a new script it creates a new object which contains variables which are properties

within the script, these are placed at the beginning of the script and are things such as floats,
strings, gameobjects, soundclips and anything else that may need to be referenced within the script,
these are mostly either public or private, public allows you to edit it within the unity editor and
reference it elsewhere easily whereas private makes sure that it can only be changed within said
script. There are functions, which are each method of coding within the script these can be accessed
by the creator of the code, these can be public or private just like a variable and will often be things
such as “void Start()” which will run that method whenever the game is started, or “void Update()”
which will run within every frame of the game.

There are many data types that each object can hold, these include:

Integers: these are whole numbers between -2147483648 and 2147483647

Floats: like integers however these CAN include decimal values

Booleans: these are a true or false or binary value that can be changed from one to another

Array: these are a way to collect variables into an easily manageable

String: these are an array of characters or simply, creates the ability to put specific writing
into a variable

There are conditions within coding that help determine what functions to call these are IF
and ELSE, if asks to check for whether certain conditions are met before calling that
function, for example “if (exampleBool == true)” these can include multiple conditions that
it must meet by adding && and then a second condition within the brackets, whereas else is
used along side an if whenever there are two solutions to the function, for example you can
have “

if (exampleBool == true)

~~function here~~

Else if (Input.GetKeyDown(KeyCode.E)

~~function here~~

“ this is most useful when there are two ways to do the same thing.
A finite state machine is a model of computation based off a hypothetical machine that is made of
multiple states, only a single state may be active at any given time within the code so it must
transform between different states to change behaviours and perform different actions, for example
an enemy may be within a moving state where it calls for code that makes it move around the level
then using an if statement if can transition to another state such as attacking if the player is within a
certain distance

Fuzzy logic is where instead of a simple Boolean level of logic where it is simply an on or off or 0 or 1
it is much more alike to actual human reasoning and while contains extremes of 0/1 it will detect
anywhere between there such as 0.43 etc and will make decisions based on that

Pathfinding is rather self explanatory it is the system of deciding how an AI should move from one
position to another it does this by deciding the fastest route to the target location, this is sometimes
done with a system of nodes that litter a level which calculate the distance between each individual
one, adding them all together in each possible route until the shortest one is found

A Physics engine is a component of a games engine that provides the approximate simulation of
physical systems allowing other components such as collision detection, rigidbodies, soft bodies etc
to work

Collision detection is the detection of objects within the games environment, this is done by
creating meshes that check whether two objects come into contact, these can be simple shapes such
as cubes and spheres or can be a complex mesh created from a 3D model within the scene

A rigid body is a component that allows a gameobject to experience forces, torque and make the
object move in a realistic way, it also makes the object experience the effects of gravity if you want it
to, without this component two objects colliding within eachother will not make them move apart
like the would in real life

A soft body is similar to a rigid body however as the name suggests it is for more flexible and flowing
objects such as a bean bag or a dead character, often called a rag doll, this will allow an object to flex
and bend wherever force is added to it

Speed is the distance an object moves within a specific unit of time such as miles per hour

Velocity is the act of the speed of an object in a specific direction for example 3 miles per hour
northward

Acceleration is the rate of which velocity changes over time, this includes increasing speed,
decreasing speed (deceleration) and changing direction (centripetal acceleration)

Friction is the force of resistance between the relative motions of 2 solid surfaces

Force is an interaction onto an object that when unopposed or facing weaker forces acting the
opposite way will make an object with mass change its velocity, force can be described as a push or
pull
Mass is the measurement of how much matter is in an object, which will mean that objects with a
higher mass weigh more as well, which is why a lead bar the same size of an aluminium bar will feel
heavier, this means that the force of momentum on a heavier mass object will be slower than the
force of momentum on a lighter object, momentum is the amount of motion on a moving object,
measured as a product of its mass and velocity

The basic primitives within unity are the Cube, Sphere, Capsule, Cylinder, Plane and Quad

A terrain is a large plane which you can use in a multitude more ways, you can paint
textures onto them, you can change the height map of it, making the shape of a terrain as
you wish however you can only obviously make this higher or lower, you can also paint grass
and trees onto it which you cannot do on other objects

A static mesh is a model which does not move around and is not animated, for example a
building within the level

The basic types of lighting are point, spot, directional and area, point lights are lighting that
is located at a specific point in space that then sends out light equally in all directions, it has
an intensity which changes the reach of the lights effects these are best used in lamps and
other localised lighting sources

Spot lights are like a point light, however it will only send out light within a certain radius
creating a cone of light, these are useful for things such as flashlights

Directional lights are useful for creating effects like sunlight within your game, it will blanket
the lights effect on all you have in the scene, meaning its position within unity does not
matter and can be useful for simulating the sun or moon

An Area light is defined by a rectangle within the scene which light is emitted from in all
directions uniformly across its surface area, it will only emit the light from one side of the
rectangle and is quite processor intensive therefore it can only be baked into lightmaps

Path animations are where the animation moves the position or rotation of an object within
the scene whereas skeletal animation, also known as bone based animation is animation
that uses a mesh to represent what is being animated such as a character and a set of
connected bones within the object that all connect one after another and are used to
animate the surface mesh of the object in much more realistic and fluid ways

A volume is an area within a level that you can walk through without anything blocking you,
one that is often used are trigger volumes, these will detect what moves through it and keep
track of it and can then be used to call upon what has touched the trigger volume within
script
Particles are a way of creating an animated and moving group of sprites within the scene,
instead of using meshes that are 3D particle systems use 2D sprites that depict small moving
effects such as smoke, flames, sparks and spells that are made of many of the sprites

Physically based rendering, also known as PBR is a lighting model that simulates natural
interactions of light and real world materials, this means that while an object has one
material and texture if it is put under different lighting the different materials will look
slightly different

Materials define how the surface it is placed on should render a texture it allows you to tile
the texture multiple times, add a colour tint and reflections

Shaders are small scripts that contains the calculations and algorithms used to calculate the
colours of each pixel on an object, based on the light input and the configuration on the
material

Diffuse maps compute a simple lighting model for the object that makes the lighting on the
surface decrease as the angle between is and the light decreases this only depends on the
angle and does not change as the camera moves

Specular uses the same simple lighting as diffuse however it also creates a viewer
dependent specular hightlight which is called the Blinn-Phong lighting model, it has a
highlight that is dependent on surface angle light angle and viewing angle, simply it creates
blurred reflection of the light source

An Emssive map makes the material illuminate itself, this means that no matter what
lighting levels are around it you will always see the material as bright as it normally would
be

Decals create a secondary texture in addition to the main texture and places it over the top
of it, it uses an alpha channel to determine which areas of the main texture are still visible

Potrebbero piacerti anche