Parse ini configuration file ---- INIParser, Unity ---- iniparser in unity
Hello everyone, I am Sun Guangdong. Reprinted please indicate the source: http://blog.csdn.net/u010019717
More comprehensive content please see my game pretty cool address: http://www.unitymanual.com/space-uid-18602.htmlIni files
This library can process INI files. Please refer to the extension name of the file (for example, .txt) as
Unity script optimization and unity script Optimization
Selecting the correct script Optimization in Unity is more efficient than adjusting the code without any purpose. It is worth noting that the best optimization is not simply to reduce the complexity of the Code.
1. when using the FixedUpdate function, do not write too much code in the method body that does
Unity provides developers with many convenient development tools. They are all functions and methods encapsulated by the system. For example, the time class that implements time and the random number random. Range () method.
Time
Time class, mainly used to obtain the current system time.
Using unityengine; using system. collections; public class script_04_13: monobehaviour {void ongui () {guilayout. label ("current game time:" + time. time); guilayo
We found in the development process that to adjust the size of the unity UI element, Recttransform provides the Sizedelta property that can be used to dynamically modify the size of the recttransform. But at the same time we also Google to another way to modify the size of Recttransform, the method is as follows:1 Public Static voidsetrecttransformsize (Recttransform trans, Vector2 newSize)2 {3Vector2 oldsize =trans.rect.size;4Vector2 deltasize =
In software development, MAC addresses can be used as a unique indication of the device, and we can also get it through unity, which can be tested by Pc,ios but not available to Android.The code is as follows:usingUnityengine;usingSystem.Collections;usingSystem.Net.NetworkInformation; Public classnetworkinfo:monobehaviour{voidStart () {Debug.Log (getmacaddress ()); } Public Static stringgetmacaddress () {stringPhysicaladdress =""; Networkinterface
parametersParameters for Fog calculation: (Density/sqrt (ln (2)), DENSITY/LN (2), –1/(End-start), end/(End-start)). X is useful-Exp2 fog mode, Y for EXP mode, Z and W for Linear mode method Unityobjecttoclippos
Inline Float4 unityobjecttoclippos (in Float3 Pos)
{
//More efficient than computing M*VP matrix product since unity says it It's quicker, so use this.
return Mul (UNITY_MATRIX_VP, Mul (Unity_objecttoworld, FLOAT4 (POS, 1.0)));
}
Inlin
Import Settings
Import settings
Each type of asset this Unity supports have a set of Import Settings, which affect how the asset appears
or behaves.To view a asset ' s import settings, select the asset in the Project view. The Import settings
For this asset would appear in the Inspector. The options that is displayed'll vary depending on the type
of asset that is selected.
Each unity-supported resource ty
Unity main thread and subthread jump call (1), unity jump
Except for some basic data types, almost all APIs of Unity cannot be called in non-unity threads. If there is a time-consuming operation in the project, unity may be suspended ". If this operation has nothing to do wi
It's becoming easier for independent developers to develop games, because many of the thankless work in game design can be solved directly using game engines like Epic games or Unity Technologies. These days, the game engine has announced that its products will be cheaper or even free of charge to the game developers, the threshold for the development of the game is further reduced.First Epic Games announced its Unreal Engine 4 (Unreal Engine 4) from
[Unity] inheritance relationships of common scripts (entry) and unity
Preface
Beginners who learn the Unity development engine will be exposed to a large number of script classes, and the relationships between these classes are often overlooked.
This article summarizes some common classes in Unity engine development an
Unity Application Block (Unity) is a lightweight, extensible, dependency injection container that supports constructors, properties, and method invocation injection. It has the following advantages:
simplifies the creation of objects, especially hierarchical object structures and dependencies, and simplifies application code.
Support abstraction of requirements, which allows developers to specify dependen
write in frontKnowing unity knows that unity can perform basic fog simulations. The so-called fog effect, is in the direction away from our perspective, the object appears to be covered with a certain color (usually gray). The implementation of this technique is actually very simple, which is to mix the color of the fog and the color of the object according to the distance of the object from the camera.Ther
Most of the functions in unity can be implemented through drag and drop, but in order to facilitate the introduction, code is used here. There are three main elements for playing music in Unity: 1. audiosource: controls the subject of music playback. 2. audioclip: The music to be played. 3. audiolistener: add this control to hear the effect of playing music. The Code is as follows: Audiosource m_aud
Generate an object based on angle and distance in Unity, and generate an object based on Unity distance.
Using UnityEngine; using System. collections; public class CreateGameObject: MonoBehaviour {private Vector3 centerPos; // The position of the center private float radius = 5; // The radius private float angle = 0; // The angle public GameObject cube; // Use this for initialization void Start () {Create
Mathematics and Physics in Unity game development 4 (adding gravity to object motion), unity Game Development
Adding gravity to object motion
Note:
Use the series superposition algorithm y + = vy
Acceleration on location vy + = GR
The acceleration GR on the speed is the gravity acceleration. The unit of acceleration used in the computer is the special dot/F ^ 2 (pixel/square frame), instead of the 9.
Executive Officer of the generation of unity Namwon Palace: how traditional developers do mobile games well, unity executives
According to paper.com/recently, Jeferson Valadares has just become general manager and vice president of product R D at Bandai Namco. He has been engaged in mobile games and social games for ten years, works in EA, BioWare, Playfish, Digital Chocolate, and other companies.
Anyone who has developed Android should know that every activity in Android has a set of complete lifecycles, and unity scripts have similar lifecycles. Let's take a look at them. 1,Awake ():Script wake-up. This method is the first method executed when the script is generated. It is used to initialize the script. The script is executed only once throughout the lifecycle. 2,Start ():The script starts. This method is executed only once after awake. 3
New Android project in 1.eclipse, add Mainactivity.java code: Packagecom.example.test;ImportCom.unity3d.player.UnityPlayer;Importcom.unity3d.player.UnityPlayerActivity;ImportAndroid.os.Bundle; Public classMainactivityextendsunityplayeractivity {protected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); } Public voidSend () {Unityplayer.unitysendmessage ("AAA", "Androidcallback", "Okokoko"); }}mainactivityExport the jar package from eclipse2.
Similar to Webplayer, use SendMessage in JSFor example, there is a gameobject in the unity scene, called A,There's a C # script on A, there's a waypublic void F(string str){ //do something...}Call this method with JS in the published WebGL project index.htmlNote that gameinstance, first to initialize a gameinstance, such as the code, in the Gameinstance call SendMessage methodOnline Many examples are directly write SendMessage, this will be an
that memory redundancy is not caused. 10 read file in bundle mode there is a problem with the PC mode file correctly. Equipment model in the PC inside the normal load on the phone does not come in because the resources of the picture and model or material name, the bundle inside does not distinguish the suffix name, so loaded the wrong file and failed.
The solution is to add the suffix of all types of files, or you can load them by pressing typeof () to load the resources. 10.2 about renaming
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.