using the photon engine for Unity online game Development (ii)--photon Common class IntroductionPhotonPUNUnityOnline game developmentphoton Common class Introduction:Ipuncallback
The Pungipuncallback interface defines a number of callback functions related to the Photon network connection.
These callback functions are called by the game client when the network connection state changes.
Pun
The physics engine is the real physical effect of the game simulation. If two objects collide, the object is free falling, etc. Using Nvidia's PhysX in unity, it renders a realistic picture of the game.Rigid bodyA rigid body is a very well-wanted component.By default, a newly created object is not physically effective, and a rigid body component can add some common physical properties to an object. For exam
-based collision detection: Edit->project settings->physics., open the physical reference interface. Select the layer that you want to interact with the other layers in the collision matrix, and check it. (Provided that the layer is set first)Physical material Physic MaterialThe physical material is used to adjust the friction and elasticity effects of the colliding object. To create a physical material select Assets->create->physic Material from the menu bar. Then drag the physical material fro
to the five physical materials in the Unity standard resource package, you can also create physical materials on your own. Click Create -- physic material in the project view. For example:
Dynamic Friction: Dynamic Friction. The value ranges from 0 to 1. The value 0 is the minimum and the value 1 is the maximum.
Static Friction: static friction. The value ranges from 0 to 1. The value 0 is the minimum and the value 1 is the maximum.
Bounciness: coll
The physics engine controls the rigid body, the rigid body above the patch, so it looks like the game is running up stateThe physical world calculates the operating state of a rigid body and shows the result of the operation by mapping.First, the physical engineThe 1:unity 2D physics engine is based on the box2d package;2: Physics
The physics engine does not allow two collisions to overlap, and when two or more objects collide, unity will rootcalculate the impact effect at their rotational speed. Calculation is mainly based on the object of the collider is still stillis dynamic. Objects are not moved, for example, walls, floors, spray ponds in the yard, etc. Dynamic ObjectsThe body is mobile, for example the player controls the ball,
SummaryThis article focuses on how to implement uniform circular motions with the unity physics engine.ObjectiveFirst, we can use unity Api,transform.rotatearound to implement uniform circular motions. But this implementation, I think not enjoyable, because you just understand an API, and did not learn any other knowledge. Take a little bit of interesting stuff.Physical knowledge1. Definition:The motion is
collision:
In the oncollisionenter function, you can set the logic after the collision.
Example: C #
void OnCollisionEnter(Collider collsion) { print(collsion.gameObject); }
Here, the collison variable is the collision body.
Print the collision object type,
It indicates that when a collision occurs, the function receives the message and responds accordingly;
Trigger collision and message transmission:
Each collision server has a trigger or not option. This option is set to play t
Elastic Force to perform relative motion, and they can limit the elastic range and maximum breaking force themselves: For example: The two yellow blocks that can be seen are links; 4. characterjoint: Follow
Http://game.ceeger.com/Components/class-CharacterJoint.html
The role controller is to achieve the doll effect, similar to the puppet effect. In the trunk object, the role controller can be used for connection to achieve the effects similar to those of the climbing p
make some necessary transfers.Clear flags is set to depth only (render depth only), culling mask retains only the UI layer, projection is set to orthographic (orthogonal mode), and the value of depth depth must be greater than the value of the scene master camera. This will keep the UI on top of the scene object.Canvas Scaler Components:UI scale mode (UI scaling): This is how the UI scales when adaptive, and here's the second way to follow the screen zoom.Reference Resolution (reference resolut
some common methods in the Unity engine
emission Ray
Launch from any gameobject or on-screen mouse position.
void Update ()
{
//Click the left mouse button
to emit a ray if (Input.getmousebuttondown (0))
{/
/launch//camera from the location of the mouse
Currentcamera = Camera.main;
Vector2 screenposition = input.mouseposition;
Ray Ray = Currentcamera.screenpoi
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.