<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ByDesign Games &#187; Unity3D</title>
	<atom:link href="http://www.bydesigngames.com/tag/unity3d/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bydesigngames.com</link>
	<description>Next-Generation Casual Entertainment</description>
	<lastBuildDate>Fri, 03 Feb 2012 19:46:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PhilhAppy &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2012/01/28/philhappy-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2012/01/28/philhappy-unify-wiki/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 23:58:20 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=PhilhAppy</guid>
		<description><![CDATA[PhilhAppy: Created page with &#34;Web optimization, and also Search Website Search engine optimization, is the process through which an internet site will be &#34;optimized&#34; intended for superior exposure while in...&#34;

Web optimization, and...]]></description>
			<content:encoded><![CDATA[<p>PhilhAppy: Created page with &quot;Web optimization, and also Search Website Search engine optimization, is the process through which an internet site will be &quot;optimized&quot; intended for superior exposure while in...&quot;</p>
<hr />
<div>Web optimization, and also Search Website Search engine optimization, is the process through which an internet site will be &quot;optimized&quot; intended for superior exposure while in the search search engines. Its content has responsibilities which have been designed in a shot to obtain your online web page to show up while in the search listings when people type associated words and phrases into your search engines.<br />
<br />
The two primary ingredients of successful search motor search engine optimization on the web-site. The 1st part is really what is referred to as &quot;on-site&quot; Search engine optimization, but it consists of the things you conduct on to a code within your home page's internet pages. It is usually the placement and employ of search phrases over the website's subject material, and it also would be the using acceptable meta data.<br />
<br />
Another element of profitable search website optimization is the method associated with linking. As soon as search engines &quot;look&quot; at the website, additionally factor in the amount of web sites of which link to your internet site, together with the kinds of web sites that link to your blog. A greater high quality one way link should have more weight than a cheaper superior hyperlink and taking advantage of a new [http://theshhnetwork.com high page rank network] to your links might help likewise.<br />
<br />
Imperative that you understanding how backlinking is effective concerning SEO approach subsequently, is knowing perhaps you link a superior quality hyperlink. A top notch connection to your website is one which should include one or more within your web page search phrases from the keywords. (The anchortext of a web page link would be the precise perhaps the url that is certainly engaged and also takes the individual doing the clicking to your web page). The reason why one of the links while using the keyword in the keywords emerged more weight as compared to backlinks with out your keywords while in the key phrases is that it seems to be the back links will be via web pages by using similar information if your keywords and phrases are only from the anchortext.<br />
<br />
A site which includes countless inbound back links coming from websites without the need of meaning on the subject material of this website will never be as valuable in comparison to its search serps search engine optimization being a internet site with only some dozen one way links comprising keyword phrases inside key phrases.<br />
<br />
Because affiliates all perform will be geared towards driving traffic to our web page, landing page, online page of copy or blog site. Most of us produce content with these web site Website url inside options pack for a back link All of us investigate various other affiliate marketing websites and produce community blogposts. Most people book mark our posts for our absolute favorite bookmarking sites.<br />
<br />
Why is it that we all post remarks upon one more entrepreneurs blog? Are we writing comments to supply more charm subject material as well as shall we be publishing your thoughts to receive credit score for the one way link?<br />
<br />
After looking at writing responses for any period of time I am believing that a lot of the blog site<br />
commentors are usually placing comments for the backlink but not to offer superior data. Practical goal preaching about people demented individuals who submit fowl mouthed reviews. Setting up all those comments that declare “nice post”, “you have a good concept there”. Those remarks include nothing to the info shown on the blog post. That is several blogs have a very absolutely no adhere to marking. Search engine lions usually do not recognise the web address that has a not any comply with marking in addition to. as a result, simply no inbound link credit to the commenter.<br />
<br />
Should we book mark our articles or blog posts with bookmarking sites intended for exposure for the posts or even to have back-link credit rating.<br />
<br />
By the things i have witnessed with the bookmarking sites is almost all bookmarking produce a backlink and perhaps the follows the web link. Social bookmarking with many individuals will deliver numerous back links. Sometimes the document saved becomes popular in addition to head out virus-like. Will need to which happen the many trys to follow your website affiliate marketer weblink technique above eye shadows the value of a new backlink. This will come about. I would heartily suggest an individual book mark your current high quality articles then cross your current hands.<br />
<br />
Do we pay a visit to and also inquire into the particular user discussion forums with trademark record available confident a number of online community guest is going to simply click our own signature document url or even are we posting in order to message boards to get back links?<br />
<br />
Some of the popular boards possess a nofollow label. Its not all just some. Type cards were being using some sneaky strategies to add quite a few backlinks inside just about every write-up plus the community facilitators countered having creating the many links and you get no links. Putting up upon web sites can give experience your link for the discussion board website visitor to be able to click on, nevertheless, zero back link credit history..<br />
<br />
It is possible to lots of dofollow discussion board web-sites around to join in addition to posting regarding one way link credit score. Anything of care. Several forum supporters feel that Yahoo is in a position to identify between those who publish to dofollow discussion boards and/or blogs and forums those which publish on the dofollow as well as nofollow blogs. The believing is always that all those putting up so that you can dofollow simply is not a approach a backlinks could by natural means arise. The slap might final result. I am about to take it easy and include both for a short time regardless.<br />
<br />
Likely to website of which invitations someone to article details on their website and you have a backlink to get executing in which. Using your information submit people place your own website link and also a click opportunity of your respective domain's home page.<br />
<br />
I am putting up on the site to view when accomplishing this really is encouraging me. This website is termed Qondio. The site is from your submitting of social bookmarks site along with post site. In all probability far better any book-marking site.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2012/01/28/philhappy-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MirrorReflection3 &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2012/01/28/mirrorreflection3-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2012/01/28/mirrorreflection3-unify-wiki/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 23:37:36 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=MirrorReflection3</guid>
		<description><![CDATA[UnfathomableChaos: 

[[Category: Unity 3.x shaders]]
[[Category: Unity Pro shaders]]

Author: Original = [[User:NeARAZ&#124;Aras Pranckevicius]] Update = [[User:UnfathomableChaos&#124;Unfathomable Chaos]]

==Note==
[[Image:mirrorReflection.png&#124;thumb&#124;Example of w...]]></description>
			<content:encoded><![CDATA[<p>UnfathomableChaos: </p>
<hr />
<div>[[Category: Unity 3.x shaders]]<br />
[[Category: Unity Pro shaders]]<br />
<br />
Author: Original = [[User:NeARAZ|Aras Pranckevicius]] Update = [[User:UnfathomableChaos|Unfathomable Chaos]]<br />
<br />
==Note==<br />
[[Image:mirrorReflection.png|thumb|Example of what the mirror reflection looks like]]<br />
This is [[User:NeARAZ|Aras Pranckevicius']] mirror shader and script updated to work for Unity 3.x. Thanks to him for making the original scripts and shaders. His original description follows:<br />
<br />
See also: [[MirrorReflection2|Mirror Reflection for Unity 2.x]].<br />
<br />
==Description==<br />
This is shader+script to make perfectly reflective mirrors, for Unity 3.x. Use the FX/Mirror Reflection shader on an object, attach the MirrorReflection script to it and there you are.<br />
<br />
Works about everywhere (dual texture cards, i.e. TNT2 and up). Requires Unity 3.x Pro. Works in scene view as well!<br />
<br />
==Usage==<br />
Prerequisites: This technique requires Unity 3.x Pro. <br />
<br />
* Create a material that uses the shader below (FX/Mirror Reflection)<br />
* Use this material on a plane-like (i.e. flat) object.<br />
* Set this object to use Water layer.<br />
* Attach the MirrorReflection to the same object.<br />
<br />
Notes:<br />
* The reflection happens '''along object's 'up' direction''' (green axis in the scene view). E.g. the builtin plane object is suitable for use as a mirror. If you experience weird reflection, check whether your mirror object is oriented correctly.<br />
<br />
<br />
<br />
==ShaderLab - Mirror.shader==<br />
&lt;syntaxhighlight lang=&quot;shaderlab&quot;&gt;// Unlit shader. Simplest possible textured shader.<br />
// - no lighting<br />
// - no lightmap support<br />
// - no per-material color<br />
<br />
Shader &quot;Mirror&quot; {<br />
Properties {<br />
	_MainTex (&quot;Base (RGB)&quot;, 2D) = &quot;white&quot; {}<br />
	_ReflectionTex (&quot;Reflection&quot;, 2D) = &quot;white&quot; { TexGen ObjectLinear }<br />
}<br />
<br />
SubShader {<br />
	Tags { &quot;RenderType&quot;=&quot;Opaque&quot; }<br />
	LOD 100<br />
	<br />
	Pass {<br />
        SetTexture[_MainTex] { combine texture }<br />
        SetTexture[_ReflectionTex] { matrix [_ProjMatrix] combine texture * previous }<br />
    }<br />
}<br />
<br />
// fallback: just main texture<br />
Subshader {<br />
	Tags { &quot;RenderType&quot;=&quot;Opaque&quot; }<br />
	LOD 100<br />
	<br />
    Pass {<br />
        SetTexture [_MainTex] { combine texture }<br />
    }<br />
}<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
<br />
<br />
==C# - MirrorReflection.cs==<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;using UnityEngine;<br />
using System.Collections;<br />
<br />
// This is in fact just the Water script from Pro Standard Assets,<br />
// just with refraction stuff removed.<br />
<br />
[ExecuteInEditMode] // Make mirror live-update even when not in play mode<br />
public class MirrorReflection : MonoBehaviour<br />
{<br />
    public bool m_DisablePixelLights = true;<br />
    public int m_TextureSize = 256;<br />
    public float m_ClipPlaneOffset = 0.07f;<br />
    <br />
    public LayerMask m_ReflectLayers = -1;<br />
        <br />
    private Hashtable m_ReflectionCameras = new Hashtable(); // Camera -&gt; Camera table<br />
    <br />
    private RenderTexture m_ReflectionTexture = null;<br />
    private int m_OldReflectionTextureSize = 0;<br />
    <br />
    private static bool s_InsideRendering = false;<br />
<br />
    // This is called when it's known that the object will be rendered by some<br />
    // camera. We render reflections and do other updates here.<br />
    // Because the script executes in edit mode, reflections for the scene view<br />
    // camera will just work!<br />
    public void OnWillRenderObject()<br />
    {<br />
        if( !enabled || !renderer || !renderer.sharedMaterial || !renderer.enabled )<br />
            return;<br />
            <br />
        Camera cam = Camera.current;<br />
        if( !cam )<br />
            return;<br />
    <br />
        // Safeguard from recursive reflections.        <br />
        if( s_InsideRendering )<br />
            return;<br />
        s_InsideRendering = true;<br />
        <br />
        Camera reflectionCamera;<br />
        CreateMirrorObjects( cam, out reflectionCamera );<br />
        <br />
        // find out the reflection plane: position and normal in world space<br />
        Vector3 pos = transform.position;<br />
        Vector3 normal = transform.up;<br />
        <br />
        // Optionally disable pixel lights for reflection<br />
        int oldPixelLightCount = QualitySettings.pixelLightCount;<br />
        if( m_DisablePixelLights )<br />
            QualitySettings.pixelLightCount = 0;<br />
        <br />
        UpdateCameraModes( cam, reflectionCamera );<br />
        <br />
        // Render reflection<br />
        // Reflect camera around reflection plane<br />
        float d = -Vector3.Dot (normal, pos) - m_ClipPlaneOffset;<br />
        Vector4 reflectionPlane = new Vector4 (normal.x, normal.y, normal.z, d);<br />
    <br />
        Matrix4x4 reflection = Matrix4x4.zero;<br />
        CalculateReflectionMatrix (ref reflection, reflectionPlane);<br />
        Vector3 oldpos = cam.transform.position;<br />
        Vector3 newpos = reflection.MultiplyPoint( oldpos );<br />
        reflectionCamera.worldToCameraMatrix = cam.worldToCameraMatrix * reflection;<br />
    <br />
        // Setup oblique projection matrix so that near plane is our reflection<br />
        // plane. This way we clip everything below/above it for free.<br />
        Vector4 clipPlane = CameraSpacePlane( reflectionCamera, pos, normal, 1.0f );<br />
        Matrix4x4 projection = cam.projectionMatrix;<br />
        CalculateObliqueMatrix (ref projection, clipPlane);<br />
        reflectionCamera.projectionMatrix = projection;<br />
        <br />
        reflectionCamera.cullingMask = ~(1&lt;&lt;4) &amp; m_ReflectLayers.value; // never render water layer<br />
        reflectionCamera.targetTexture = m_ReflectionTexture;<br />
        GL.SetRevertBackfacing (true);<br />
        reflectionCamera.transform.position = newpos;<br />
        Vector3 euler = cam.transform.eulerAngles;<br />
        reflectionCamera.transform.eulerAngles = new Vector3(0, euler.y, euler.z);<br />
        reflectionCamera.Render();<br />
        reflectionCamera.transform.position = oldpos;<br />
        GL.SetRevertBackfacing (false);<br />
        Material[] materials = renderer.sharedMaterials;<br />
        foreach( Material mat in materials ) {<br />
            if( mat.HasProperty(&quot;_ReflectionTex&quot;) )<br />
                mat.SetTexture( &quot;_ReflectionTex&quot;, m_ReflectionTexture );<br />
        }<br />
        <br />
        // Set matrix on the shader that transforms UVs from object space into screen<br />
        // space. We want to just project reflection texture on screen.<br />
        Matrix4x4 scaleOffset = Matrix4x4.TRS(<br />
            new Vector3(0.5f,0.5f,0.5f), Quaternion.identity, new Vector3(0.5f,0.5f,0.5f) );<br />
        Vector3 scale = transform.lossyScale;<br />
        Matrix4x4 mtx = transform.localToWorldMatrix * Matrix4x4.Scale( new Vector3(1.0f/scale.x, 1.0f/scale.y, 1.0f/scale.z) );<br />
        mtx = scaleOffset * cam.projectionMatrix * cam.worldToCameraMatrix * mtx;<br />
        foreach( Material mat in materials ) {<br />
            mat.SetMatrix( &quot;_ProjMatrix&quot;, mtx );<br />
        }<br />
        <br />
        // Restore pixel light count<br />
        if( m_DisablePixelLights )<br />
            QualitySettings.pixelLightCount = oldPixelLightCount;<br />
        <br />
        s_InsideRendering = false;<br />
    }<br />
    <br />
    <br />
    // Cleanup all the objects we possibly have created<br />
    void OnDisable()<br />
    {<br />
        if( m_ReflectionTexture ) {<br />
            DestroyImmediate( m_ReflectionTexture );<br />
            m_ReflectionTexture = null;<br />
        }<br />
        foreach( DictionaryEntry kvp in m_ReflectionCameras )<br />
            DestroyImmediate( ((Camera)kvp.Value).gameObject );<br />
        m_ReflectionCameras.Clear();<br />
    }<br />
    <br />
    <br />
    private void UpdateCameraModes( Camera src, Camera dest )<br />
    {<br />
        if( dest == null )<br />
            return;<br />
        // set camera to clear the same way as current camera<br />
        dest.clearFlags = src.clearFlags;<br />
        dest.backgroundColor = src.backgroundColor;        <br />
        if( src.clearFlags == CameraClearFlags.Skybox )<br />
        {<br />
            Skybox sky = src.GetComponent(typeof(Skybox)) as Skybox;<br />
            Skybox mysky = dest.GetComponent(typeof(Skybox)) as Skybox;<br />
            if( !sky || !sky.material )<br />
            {<br />
                mysky.enabled = false;<br />
            }<br />
            else<br />
            {<br />
                mysky.enabled = true;<br />
                mysky.material = sky.material;<br />
            }<br />
        }<br />
        // update other values to match current camera.<br />
        // even if we are supplying custom camera&amp;projection matrices,<br />
        // some of values are used elsewhere (e.g. skybox uses far plane)<br />
        dest.farClipPlane = src.farClipPlane;<br />
        dest.nearClipPlane = src.nearClipPlane;<br />
        dest.orthographic = src.orthographic;<br />
        dest.fieldOfView = src.fieldOfView;<br />
        dest.aspect = src.aspect;<br />
        dest.orthographicSize = src.orthographicSize;<br />
    }<br />
    <br />
    // On-demand create any objects we need<br />
    private void CreateMirrorObjects( Camera currentCamera, out Camera reflectionCamera )<br />
    {<br />
        reflectionCamera = null;<br />
        <br />
        // Reflection render texture<br />
        if( !m_ReflectionTexture || m_OldReflectionTextureSize != m_TextureSize )<br />
        {<br />
            if( m_ReflectionTexture )<br />
                DestroyImmediate( m_ReflectionTexture );<br />
            m_ReflectionTexture = new RenderTexture( m_TextureSize, m_TextureSize, 16 );<br />
            m_ReflectionTexture.name = &quot;__MirrorReflection&quot; + GetInstanceID();<br />
            m_ReflectionTexture.isPowerOfTwo = true;<br />
            m_ReflectionTexture.hideFlags = HideFlags.DontSave;<br />
            m_OldReflectionTextureSize = m_TextureSize;<br />
        }<br />
        <br />
        // Camera for reflection<br />
        reflectionCamera = m_ReflectionCameras[currentCamera] as Camera;<br />
        if( !reflectionCamera ) // catch both not-in-dictionary and in-dictionary-but-deleted-GO<br />
        {<br />
            GameObject go = new GameObject( &quot;Mirror Refl Camera id&quot; + GetInstanceID() + &quot; for &quot; + currentCamera.GetInstanceID(), typeof(Camera), typeof(Skybox) );<br />
            reflectionCamera = go.camera;<br />
            reflectionCamera.enabled = false;<br />
            reflectionCamera.transform.position = transform.position;<br />
            reflectionCamera.transform.rotation = transform.rotation;<br />
            reflectionCamera.gameObject.AddComponent(&quot;FlareLayer&quot;);<br />
            go.hideFlags = HideFlags.HideAndDontSave;<br />
            m_ReflectionCameras[currentCamera] = reflectionCamera;<br />
        }        <br />
    }<br />
    <br />
    // Extended sign: returns -1, 0 or 1 based on sign of a<br />
    private static float sgn(float a)<br />
    {<br />
        if (a &gt; 0.0f) return 1.0f;<br />
        if (a &lt; 0.0f) return -1.0f;<br />
        return 0.0f;<br />
    }<br />
    <br />
    // Given position/normal of the plane, calculates plane in camera space.<br />
    private Vector4 CameraSpacePlane (Camera cam, Vector3 pos, Vector3 normal, float sideSign)<br />
    {<br />
        Vector3 offsetPos = pos + normal * m_ClipPlaneOffset;<br />
        Matrix4x4 m = cam.worldToCameraMatrix;<br />
        Vector3 cpos = m.MultiplyPoint( offsetPos );<br />
        Vector3 cnormal = m.MultiplyVector( normal ).normalized * sideSign;<br />
        return new Vector4( cnormal.x, cnormal.y, cnormal.z, -Vector3.Dot(cpos,cnormal) );<br />
    }<br />
    <br />
    // Adjusts the given projection matrix so that near plane is the given clipPlane<br />
    // clipPlane is given in camera space. See article in Game Programming Gems 5 and<br />
    // http://aras-p.info/texts/obliqueortho.html<br />
    private static void CalculateObliqueMatrix (ref Matrix4x4 projection, Vector4 clipPlane)<br />
    {<br />
        Vector4 q = projection.inverse * new Vector4(<br />
            sgn(clipPlane.x),<br />
            sgn(clipPlane.y),<br />
            1.0f,<br />
            1.0f<br />
        );<br />
        Vector4 c = clipPlane * (2.0F / (Vector4.Dot (clipPlane, q)));<br />
        // third row = clip plane - fourth row<br />
        projection[2] = c.x - projection[3];<br />
        projection[6] = c.y - projection[7];<br />
        projection[10] = c.z - projection[11];<br />
        projection[14] = c.w - projection[15];<br />
    }<br />
<br />
    // Calculates reflection matrix around the given plane<br />
    private static void CalculateReflectionMatrix (ref Matrix4x4 reflectionMat, Vector4 plane)<br />
    {<br />
        reflectionMat.m00 = (1F - 2F*plane[0]*plane[0]);<br />
        reflectionMat.m01 = (   - 2F*plane[0]*plane[1]);<br />
        reflectionMat.m02 = (   - 2F*plane[0]*plane[2]);<br />
        reflectionMat.m03 = (   - 2F*plane[3]*plane[0]);<br />
<br />
        reflectionMat.m10 = (   - 2F*plane[1]*plane[0]);<br />
        reflectionMat.m11 = (1F - 2F*plane[1]*plane[1]);<br />
        reflectionMat.m12 = (   - 2F*plane[1]*plane[2]);<br />
        reflectionMat.m13 = (   - 2F*plane[3]*plane[1]);<br />
    <br />
        reflectionMat.m20 = (   - 2F*plane[2]*plane[0]);<br />
        reflectionMat.m21 = (   - 2F*plane[2]*plane[1]);<br />
        reflectionMat.m22 = (1F - 2F*plane[2]*plane[2]);<br />
        reflectionMat.m23 = (   - 2F*plane[3]*plane[2]);<br />
<br />
        reflectionMat.m30 = 0F;<br />
        reflectionMat.m31 = 0F;<br />
        reflectionMat.m32 = 0F;<br />
        reflectionMat.m33 = 1F;<br />
    }<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
==Changelog==<br />
* &quot;2012 January 27&quot; Updated shader to work with Unity 3.x.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2012/01/28/mirrorreflection3-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PablLorch &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2012/01/28/pabllorch-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2012/01/28/pabllorch-unify-wiki/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 23:06:29 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=PablLorch</guid>
		<description><![CDATA[PablLorch: Created page with &#34;A purpose of an headhunter with employment can be quite often misinterpreted. A number of people mix up headhunters along with internal headhunters, or perhaps career business...&#34;

A purpose of an headhunter with...]]></description>
			<content:encoded><![CDATA[<p>PablLorch: Created page with &quot;A purpose of an headhunter with employment can be quite often misinterpreted. A number of people mix up headhunters along with internal headhunters, or perhaps career business...&quot;</p>
<hr />
<div>A purpose of an headhunter with employment can be quite often misinterpreted. A number of people mix up headhunters along with internal headhunters, or perhaps career businesses -- but they are not the same thing.<br />
<br />
Internal employers usually operate within the Hours (Hour or so) office on the organization and select people from inside this company itself which they feel can fit particular assignments. On the other hand occupation agencies set of two way up prospects searching for jobs having corporations planning to hire staff members.<br />
<br />
A headhunter, specially a strong [http://www.headmatcher.com executive headhunter] , can be quite diverse.<br />
<br />
What is Executive Search?<br />
<br />
Fundamentally a good executive search involves searching for ideal job hopefuls to slip in to executive-level jobs in most companies. Even so, a real difference here is that these particular 'candidates' usually are not actively in search of jobs.<br />
<br />
Think of it by doing this: Firms possess particular customized as well as 'key' roles that they require particular people with higher quantities of expertise, skill, and practical experience. These kinds of postures are certainly not all to easy to pack and also often the men and women had to fill up these are a crème of your plant instead of apt to be looking for job.<br />
<br />
Quite a few corporations may initially look at inside recruitment with the Hour or so (An hour) section to ascertain if any one of its current personnel what you need, but more often than not ultimately these firms search for the services of some sort of headhunter to do a strong executive search in addition to enable them to to complete the location.<br />
<br />
Evaluating Candidate Relevance<br />
<br />
Headhunters are extremely picky while selecting on the part the companies which may have caught these folks as well as take care to bud a list with possibilities job hopefuls into those who find themselves most suited for your job.<br />
<br />
It isn't uncommon intended for executive search jobs in order to even contain interview along with tests to make sure that the last applicants given to this company will likely in shape both the job and also the company themselves.<br />
<br />
Make not any slip-up, it may not be just a dilemma with document requirements ( blank ) earlier job experience, style, results, and many variables frequently be involved around analyzing likely staff members in addition.<br />
<br />
Owing to the way unique your part of the headhunter frequently can be, companies very often assemble long-lasting relationships along with those which they are can deliver the solutions. Massive corporations and multinationals may also possess many headhunter businesses working away at their own account.<br />
Search engine optimization, or perhaps Search Serps Search engine optimization, is the process by which a web page is usually &quot;optimized&quot; with regard to far better exposure in the search motors. It provides duties that are placed in hard work for getting your online internet site to show up while in the search item listings when individuals form relevant words to the search motors.<br />
<br />
The two primary elements with thriving search powerplant search engine optimization of the web-site. The earliest element really is referred to as &quot;on-site&quot; Website positioning, and yes it includes the things you conduct instantly to this web coding within your home page's web sites. It can be the location and rehearse regarding keywords during the entire online site's content material, but it would be the use of proper meta tags.<br />
<br />
The 2nd element of successful search powerplant search engine optimization is the method connected with linking. As soon as search machines &quot;look&quot; in your web site, additionally they factor in how many web pages in which link to your web site, together with the forms of internet sites which connection to your internet site. An improved top quality back-link are going to have more weight than a more affordable quality weblink and taking advantage of a new [http://theshhnetwork.com high page rank network] for ones hyperlinks might help likewise.<br />
<br />
Vital that you finding out how back linking is effective concerning Search engine optimization system subsequently, is knowing do not know url an exceptional website link. An exceptional connection to your websites are one that includes one or more of this site search phrases inside keywords. (This key phrases of a website link could be the real area of the link that is certainly made itself known yet in addition to can take anybody performing the press aimed at your website). The explanation the link while using search phrase inside the anchortext emerges excess fat than back links without having keyword phrases within the keywords is that it shows up the fact that links tend to be coming from sites using related details once the search phrases are found in the keywords.<br />
<br />
A site which has many hundreds of inward bound one-way links out of web-sites devoid of relevance towards the subject material of one's site will never be because attractive relation to its search serps search engine marketing as being a website with just a couple of dozen one way links containing keywords from the anchor text.<br />
<br />
Because entrepreneurs almost everything we all do is definitely targeted at driving traffic to site, landing page, internet sales copy or maybe web site. Most of us generate content with your web page Web link from the choice pack for any backlink Many of us inquire into different affiliate internet marketing websites and produce community forum posts. Most of us take note of our own articles or blog posts for your social bookmarking sites.<br />
<br />
Why do all of us article remarks on another internet marketers website? So are we commenting to supply more charm content material and also am i placing a remark to have credit for the back link?<br />
<br />
Immediately after considering writing remarks to get a timeframe I'm just convinced that the majority of the web site<br />
commentors usually are commenting with the one way link without to deliver quality information. I'm not discussing those demented those that submit chook mouthed remarks. I am talking about individuals comments which point out “nice post”, “you have a very good notion there”. People reviews increase absolutely nothing to the knowledge displayed within the post. This is why several information sites have a very not any adhere to label. Search website robots tend not to identify the website url with a absolutely no follow level in addition to. hence, absolutely no one way link consumer credit for the commenter.<br />
<br />
Should we save our posts for social bookmarking sites pertaining to visibility for your posts or even to have one way link consumer credit.<br />
<br />
Out of what I have seen of your social bookmarking sites is the fact that almost all book marks provide a link as well as perhaps any clicks your own website url. Social bookmarking in quite a few crack houses gives quite a few back links. Often a person's post added will end up very well liked in addition to visit viral. Ought to which happen the numerous clicks on your blog affiliate marketing hyperlink method in excess of shadows the price of a back link. This really does come about. We would heartily suggest you take a note of a person's quality posts after which crossstitching your current fingertips.<br />
<br />
Do we pay a visit to along with investigate the actual community forums along with trademark document constantly in place in hopes some forum targeted visitor may visit your signature document link or perhaps are we placing so that you can user discussion forums to have backlinks?<br />
<br />
Some of the more popular boards use a and you get no marking. Its not all a totally. Variety prints were being using some sly ways to add in many one way links with every posting as well as online community facilitators countered using producing the many back links search engines hyperlinks. Writing in those sites will deliver contact with your website for the community forum targeted visitor for you to visit, but, zero inbound link credit..<br />
<br />
There are still loads of dofollow discussion board internet sites all around to sign up for and write-up pertaining to back-link credit rating. A thing of caution. A lot of discussion board readers think that Yahoo is in the position to make a distinction in between those that write-up only to dofollow user discussion forums and/or sites those that write-up for the dofollow plus no follow sites. Your thinking is the fact individuals publishing for you to dofollow exclusively isn't a method the actual backlinks to your site would likely of course arise. The slap might effect. My goal is to take it easy and include both for a long time regardless.<br />
<br />
It has an online site that will cards you to post information on their website and you also obtain a one way link for executing that. Through your information and facts write-up they will spot your hyperlink along with a click photo of your domain's website.<br />
<br />
I have been previously submitting on their web site to find out when doing so is very encouraging me. This web site is named Qondio. I would say the site is from the social bookmarking web page plus post website. Most likely nearer to any bookmarking internet site.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2012/01/28/pabllorch-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TorqueLookRotation &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2012/01/27/torquelookrotation-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2012/01/27/torquelookrotation-unify-wiki/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 22:26:19 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=TorqueLookRotation</guid>
		<description><![CDATA[Dtoliaferro: Created page with &#34;Category: Physics Category: MonoBehaviour Category: C# Author: Ducketts (from #unity) ==Description== This script basically implements a torque-based lookrotation....&#34;

[[Category: Physics]]
[[Category: MonoBeh...]]></description>
			<content:encoded><![CDATA[<p>Dtoliaferro: Created page with &quot;Category: Physics Category: MonoBehaviour Category: C# Author: Ducketts (from #unity) ==Description== This script basically implements a torque-based lookrotation....&quot;</p>
<hr />
<div>[[Category: Physics]]<br />
[[Category: MonoBehaviour]]<br />
[[Category: C#]]<br />
Author: Ducketts (from #unity)<br />
==Description==<br />
This script basically implements a torque-based lookrotation.<br />
<br />
==Usage==<br />
Attach the script to any gameobject with a rigidbody, set the drag desired level, set the target and away you go.<br />
<br />
==C# - TorqueLookRotation.cs==<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
// @robotduck 2011<br />
// set the object's rigidbody angular drag to a high value, like 10<br />
<br />
public class TorqueLookRotation : MonoBehaviour {<br />
<br />
	public Transform target;<br />
	public float force = 0.1f;<br />
<br />
	void FixedUpdate () {<br />
	<br />
		Vector3 targetDelta = target.position - transform.position;<br />
		<br />
		//get the angle between transform.forward and target delta<br />
		float angleDiff = Vector3.Angle(transform.forward, targetDelta);<br />
                           <br />
		// get its cross product, which is the axis of rotation to<br />
		// get from one vector to the other<br />
		Vector3 cross = Vector3.Cross(transform.forward, targetDelta);<br />
 <br />
		// apply torque along that axis according to the magnitude of the angle.<br />
		rigidbody.AddTorque(cross * angleDiff * force);<br />
	}<br />
}<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2012/01/27/torquelookrotation-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Author dreams &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2012/01/26/author-dreams-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2012/01/26/author-dreams-unify-wiki/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 19:46:41 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=Author_dreams</guid>
		<description><![CDATA[Author dreams: Created page with &#34;It has been proven time and and time again that those who write down their dreams see them come to pass. Have you ever taken the time to create a dream board or a vision board...&#34;

It has been proven time and...]]></description>
			<content:encoded><![CDATA[<p>Author dreams: Created page with &quot;It has been proven time and and time again that those who write down their dreams see them come to pass. Have you ever taken the time to create a dream board or a vision board...&quot;</p>
<hr />
<div>It has been proven time and and time again that those who write down their dreams see them come to pass. Have you ever taken the time to create a dream board or a vision board Bringing your dreams from thoughts to pen and paper attracts their entry into physical reality. The Dreams to Reality Action Plan is a three-part curriculum that teaches how to write your story to become author of your dreams, literally! Much like a [http://www.AuthorYourDreams.com vision board] , using the power of the pen combined with the Law of Attraction (popularized in “The Secret”); we take you from dream board to Dream Plan Book, a book authored and published by YOU!</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2012/01/26/author-dreams-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QuickTimer &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2012/01/26/quicktimer-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2012/01/26/quicktimer-unify-wiki/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 07:07:51 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=QuickTimer</guid>
		<description><![CDATA[Meeshoo: Created page with &#34;Category: Utility Scripts Category: C Sharp Author: Mihai Cozma   ==Overview== This C# class will allow you to mark a certain point in time and then poll it whenever y...&#34;

[[Category: Utility Scripts]]
[[Category:...]]></description>
			<content:encoded><![CDATA[<p>Meeshoo: Created page with &quot;Category: Utility Scripts Category: C Sharp Author: Mihai Cozma   ==Overview== This C# class will allow you to mark a certain point in time and then poll it whenever y...&quot;</p>
<hr />
<div>[[Category: Utility Scripts]]<br />
[[Category: C Sharp]]<br />
Author: Mihai Cozma<br />
<br />
<br />
==Overview==<br />
This C# class will allow you to mark a certain point in time and then poll it whenever you need to find out the difference between the current time and the marked time. Very useful in &quot;called on each frame&quot; methods to measure certain actions that take more than one frame.<br />
<br />
<br />
==C# - QuickTimer.cs==<br />
The script should be named QuickTimer.cs<br />
<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;using UnityEngine;<br />
using System;<br />
<br />
public class QuickTimer<br />
<br />
{<br />
	/// &lt;summary&gt;<br />
	/// Constructor <br />
	/// &lt;/summary&gt;<br />
    public QuickTimer()<br />
    {<br />
        On = false;<br />
        RecTime = 0.0f;<br />
    }<br />
<br />
	/// &lt;summary&gt;<br />
	/// Checks if timer is running <br />
	/// &lt;/summary&gt;<br />
    public bool On { get; set; }<br />
<br />
	/// &lt;summary&gt;<br />
	/// Startup time <br />
	/// &lt;/summary&gt;<br />
    public float RecTime { get; set; }<br />
<br />
	/// &lt;summary&gt;<br />
	/// Start timer <br />
	/// &lt;/summary&gt;<br />
<br />
    public void Reset()<br />
    {<br />
        RecTime = Time.time;<br />
        On = true;<br />
    }<br />
<br />
	/// &lt;summary&gt;<br />
	/// Stop timer <br />
	/// &lt;/summary&gt;<br />
    public void Stop()<br />
    {<br />
        On = false;<br />
        RecTime = 0.0f;<br />
    }<br />
<br />
	/// &lt;summary&gt;<br />
	/// Check difference between current time and startup time <br />
	/// &lt;/summary&gt;<br />
    public float Difference()<br />
    {<br />
        return Time.time - RecTime;<br />
    }<br />
}<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2012/01/26/quicktimer-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PlayerSave &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2012/01/25/playersave-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2012/01/25/playersave-unify-wiki/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 16:17:22 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=PlayerSave</guid>
		<description><![CDATA[SophieH: changed and added categories

[[Category: C_Sharp]][[Category: Scripts]][[Category: Saving]]
Author: [[User:SophieH&#124;Sophie Houlden]]

== Description ==
This class is an alternative to PlayerPrefs, it has all the same functions and behaves like...]]></description>
			<content:encoded><![CDATA[<p>SophieH: changed and added categories</p>
<hr />
<div>[[Category: C_Sharp]][[Category: Scripts]][[Category: Saving]]<br />
Author: [[User:SophieH|Sophie Houlden]]<br />
<br />
== Description ==<br />
This class is an alternative to PlayerPrefs, it has all the same functions and behaves like PlayerPrefs, except you can specify where your save files get put, on a platform by platform basis, (you can also specify which platforms the system should just use PlayerPrefs for instead).<br />
<br />
=== Usage ===<br />
Just put the code in your project, and then use the class just like you would PlayerPrefs, it's functions are the same:<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
PlayerSave.GetInt(&quot;a integer key&quot;, 99); //returns 99<br />
PlayerSave.SetInt(&quot;a integer key&quot;, 1234);<br />
PlayerSave.GetInt(&quot;a integer  key&quot;, 99); //returns 1234<br />
<br />
PlayerSave.GetFloat(&quot;a float key&quot;, 99.99f); //returns 99.99<br />
PlayerSave.SetFloat(&quot;a float key&quot;, 1234.56f);<br />
PlayerSave.GetFloat(&quot;a float key&quot;, 99.99f); //returns 1234.56<br />
<br />
PlayerSave.GetString(&quot;a string key&quot;, &quot;Ninety-nine&quot;); //returns Ninety-nine<br />
PlayerSave.SetString(&quot;a string key&quot;, &quot;One, Two, Three&quot;);<br />
PlayerSave.GetString(&quot;a string key&quot;, &quot;Ninety-nine&quot;); //returns One, Two, Three<br />
&lt;/syntaxhighlight&gt;<br />
<br />
Make sure to set each platform's save directory in the Prepare() function, and set fallback to true for any platforms you'd rather PlayerPrefs does the saving.<br />
<br />
== Code (PlayerSave.cs) ==<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;using UnityEngine;<br />
using System.Collections;<br />
using System.IO;<br />
using System;<br />
using System.Collections.Generic;<br />
<br />
<br />
/*<br />
 * <br />
 * Class works almost exactly like playerprefs, but you can specify save locations by platform<br />
 * <br />
 * ~~~ features ~~~<br />
 * - option to fall back to player prefs (this is a must for some platforms)<br />
 * - all functions of PlayerPrefs exist here, use the scripts the same way<br />
 * <br />
 * ~~~ Imperfections ~~~<br />
 * - to be able to save when the game closes (like playerprefs does), the script needs <br />
 *     to instantiate a GO called &quot;_SaveCaller&quot;<br />
 * - no scrambling/obfusimacation of the save data right now, so users can easily hack it<br />
 * - as with player prefs, there's no built in way to have seperate save 'slots' for the<br />
 *     same game and save directory, add this yourself if you want it :)<br />
 * - you might not like the way I load/save from the file, I'm no expert so<br />
 *     if you can do better feel free :)<br />
 * <br />
 * <br />
 * ~~~ Instructions ~~~<br />
 * you must go through the Prepare() function, and set all relevant stuff, for all platforms<br />
 * that you want to target.<br />
 * don't forget to change the 'gameName' variable if your path uses it, or<br />
 * you could overwrite other game's saves :P<br />
 * <br />
 * ~~~ Licence ~~~<br />
 * Licence for this is whatever I guess, do what you like with it,<br />
 * I don't care about credit either. full free use :)<br />
 * <br />
 * */<br />
static public class PlayerSave {<br />
	<br />
	//loads all data, happens first time you set or get, but can be called earlier to avoid a jump<br />
	static public void Prepare (){<br />
		if (dataLoaded) return;<br />
		dataLoaded = true;<br />
		<br />
		<br />
		//default path<br />
		savePath = Application.persistentDataPath;<br />
		saveFile = &quot;Save.sav&quot;;<br />
		gameName = &quot;Change this&quot;;<br />
		<br />
		//don't fallback by default<br />
		fallback = false;<br />
		<br />
		<br />
		<br />
		//platform dependent settings:<br />
		#if UNITY_STANDALONE_OSX<br />
	    	fallback = false;<br />
	    #endif<br />
		#if UNITY_STANDALONE_WIN<br />
			//saves to where some rockpapershotgun folk want the pc save standard to be: http://www.rockpapershotgun.com/2012/01/24/start-it-the-place-to-put-save-games<br />
	    	fallback = false;<br />
			savePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + &quot;&#92;&#92;My Games&#92;&#92;&quot; + gameName + &quot;&#92;&#92;Saves&quot;;<br />
	    #endif<br />
		#if UNITY_DASHBOARD_WIDGET<br />
	    	fallback = true;<br />
	    #endif<br />
		#if UNITY_WEBPLAYER<br />
	    	fallback = true;<br />
	    #endif<br />
		#if UNITY_WII<br />
	    	fallback = true;<br />
	    #endif<br />
		#if UNITY_IPHONE<br />
	    	fallback = true;<br />
	    #endif<br />
		#if UNITY_ANDROID<br />
	    	fallback = true;<br />
	    #endif<br />
		#if UNITY_PS3<br />
	    	fallback = true;<br />
	    #endif<br />
		#if UNITY_XBOX360<br />
	    	fallback = true;<br />
	    #endif<br />
		#if UNITY_FLASH<br />
	    	fallback = true;<br />
	    #endif<br />
		<br />
		//if we aren't going to fallback to playerprefs, let's load the data<br />
		if (!fallback){<br />
			//load from file here<br />
			LoadSavedData();<br />
			<br />
			//create empty gameobject that calls EndNow when the application quits<br />
			GameObject saveCaller = new GameObject();<br />
			saveCaller.AddComponent&lt;SaveCaller&gt;();<br />
			saveCaller.name = &quot;_SaveCaller&quot;;<br />
		}<br />
		<br />
	}<br />
<br />
	<br />
	static public void SetInt (string key, int val) {<br />
		Prepare();<br />
		<br />
		//playerprefs fallback<br />
		if (fallback){<br />
			PlayerPrefs.SetInt(key, val);<br />
			return;<br />
		}<br />
		<br />
		//set the int if it already exists<br />
		for (int i=0; i&lt;intKeys.Count; i++){<br />
			if (intKeys[i] == key){<br />
				ints[i] = val;<br />
				return;<br />
			}<br />
		}<br />
		<br />
		//int does not exist, we create it<br />
		ints.Add(val);<br />
		intKeys.Add(key);<br />
	}<br />
	static public int GetInt (string key, int defaultVal) {<br />
		Prepare();<br />
		<br />
		//playerprefs fallback<br />
		if (fallback){<br />
			return PlayerPrefs.GetInt(key, defaultVal);<br />
		}<br />
		<br />
		//return int if it exists<br />
		for (int i=0; i&lt;intKeys.Count; i++) if (intKeys[i] == key) return ints[i];<br />
			<br />
		//otherwise return default value<br />
		return defaultVal;<br />
	}<br />
	<br />
	static public void SetFloat (string key, float val) {<br />
		Prepare();<br />
		<br />
		//playerprefs fallback<br />
		if (fallback){<br />
			PlayerPrefs.SetFloat(key, val);<br />
			return;<br />
		}<br />
		<br />
		//set the float if it already exists<br />
		for (int i=0; i&lt;floatKeys.Count; i++){<br />
			if (floatKeys[i] == key){<br />
				floats[i] = val;<br />
				return;<br />
			}<br />
		}<br />
		<br />
		//float does not exist, we create it<br />
		floats.Add(val);<br />
		floatKeys.Add(key);<br />
	}<br />
	static public float  GetFloat (string key, float defaultVal) {<br />
		Prepare();<br />
		<br />
		//playerprefs fallback<br />
		if (fallback){<br />
			return PlayerPrefs.GetFloat(key, defaultVal);<br />
		}<br />
		<br />
		//return float if it exists<br />
		for (int i=0; i&lt;floatKeys.Count; i++) if (floatKeys[i] == key) return floats[i];<br />
			<br />
		//otherwise return default value<br />
		return defaultVal;<br />
	}<br />
	<br />
	static public void SetString (string key, string val) {<br />
		Prepare();<br />
		<br />
		//playerprefs fallback<br />
		if (fallback){<br />
			PlayerPrefs.SetString(key, val);<br />
			return;<br />
		}<br />
		<br />
		//set the string if it already exists<br />
		for (int i=0; i&lt;stringKeys.Count; i++){<br />
			if (stringKeys[i] == key){<br />
				strings[i] = val;<br />
				return;<br />
			}<br />
		}<br />
		<br />
		//string does not exist, we create it<br />
		strings.Add(val);<br />
		stringKeys.Add(key);<br />
	}<br />
	static public string GetString (string key, string defaultVal) {<br />
		Prepare();<br />
		<br />
		//playerprefs fallback<br />
		if (fallback){<br />
			return PlayerPrefs.GetString(key, defaultVal);<br />
		}<br />
		<br />
		//return string if it exists<br />
		for (int i=0; i&lt;stringKeys.Count; i++) if (stringKeys[i] == key) return strings[i];<br />
			<br />
		//otherwise return default value<br />
		return defaultVal;<br />
	}<br />
	<br />
	static public bool HasKey (string key) {<br />
		Prepare();<br />
		<br />
		//playerprefs fallback<br />
		if (fallback){<br />
			return PlayerPrefs.HasKey(key);<br />
		}<br />
		<br />
		for (int i=0; i&lt;intKeys.Count; i++) if (intKeys[i] == key) return true;<br />
		for (int i=0; i&lt;floatKeys.Count; i++) if (floatKeys[i] == key) return true;<br />
		for (int i=0; i&lt;stringKeys.Count; i++) if (stringKeys[i] == key) return true;<br />
		<br />
		return false;<br />
	}<br />
	<br />
	static public void DeleteKey (string key) {<br />
		Prepare();<br />
		<br />
		//playerprefs fallback<br />
		if (fallback){<br />
			PlayerPrefs.DeleteKey(key);<br />
			return;<br />
		}<br />
		<br />
		//find relevant keys and remove them<br />
		for (int i=0; i&lt;ints.Count; i++){<br />
			if (intKeys[i] == key){<br />
				ints.RemoveAt(i);<br />
				intKeys.RemoveAt(i);<br />
				i--;<br />
			}<br />
		}<br />
		for (int i=0; i&lt;floats.Count; i++){<br />
			if (floatKeys[i] == key){<br />
				floats.RemoveAt(i);<br />
				floatKeys.RemoveAt(i);<br />
				i--;<br />
			}<br />
		}<br />
		for (int i=0; i&lt;strings.Count; i++){<br />
			if (stringKeys[i] == key){<br />
				strings.RemoveAt(i);<br />
				stringKeys.RemoveAt(i);<br />
				i--;<br />
			}<br />
		}<br />
		<br />
	}<br />
	<br />
	static public void DeleteAll () {<br />
		Prepare();<br />
		<br />
		//playerprefs fallback<br />
		if (fallback){<br />
			PlayerPrefs.DeleteAll();<br />
			return;<br />
		}<br />
		<br />
		//reset all keys<br />
		ints = new List&lt;int&gt;();<br />
		intKeys = new List&lt;string&gt;();<br />
		floats = new List&lt;float&gt;();<br />
		floatKeys = new List&lt;string&gt;();<br />
		strings = new List&lt;string&gt;();<br />
		stringKeys = new List&lt;string&gt;();<br />
	}<br />
	<br />
	static public void Save () {<br />
		//playerprefs fallback<br />
		if (fallback){<br />
			PlayerPrefs.Save();<br />
			return;<br />
		}<br />
		<br />
		//only need to save if something has changed<br />
		if (!dataLoaded) return;<br />
		<br />
		<br />
		//save now<br />
		string outputString = &quot;I&#92;n&quot;;<br />
		for (int i=0; i&lt;ints.Count; i++){<br />
			outputString += intKeys[i] + &quot;&#92;n&quot; + ints[i].ToString() + &quot;&#92;n&quot;;<br />
		}<br />
		outputString += &quot;F&#92;n&quot;;<br />
		for (int i=0; i&lt;floats.Count; i++){<br />
			outputString += floatKeys[i] + &quot;&#92;n&quot; + floats[i].ToString() + &quot;&#92;n&quot;;<br />
		}<br />
		outputString += &quot;S&#92;n&quot;;<br />
		for (int i=0; i&lt;strings.Count; i++){<br />
			outputString += stringKeys[i] + &quot;&#92;n&quot; + strings[i] + &quot;&#92;n&quot;;<br />
		}<br />
		<br />
		if (!File.Exists(savePath)){<br />
			Directory.CreateDirectory(savePath);<br />
		}<br />
		File.WriteAllText(savePath + &quot;&#92;&#92;&quot; + saveFile,outputString);<br />
		<br />
		<br />
		<br />
	}<br />
	<br />
	//data and keys<br />
	static List&lt;int&gt; ints = new List&lt;int&gt;();<br />
	static List&lt;string&gt; intKeys = new List&lt;string&gt;();<br />
	static List&lt;float&gt; floats = new List&lt;float&gt;();<br />
	static List&lt;string&gt; floatKeys = new List&lt;string&gt;();<br />
	static List&lt;string&gt; strings = new List&lt;string&gt;();<br />
	static List&lt;string&gt; stringKeys = new List&lt;string&gt;();<br />
	<br />
	//have we loaded the data yet?<br />
	static bool dataLoaded = false;<br />
	<br />
	static bool fallback;<br />
	static string savePath;<br />
	static string saveFile;<br />
	static string gameName;<br />
	<br />
	<br />
	static void LoadSavedData(){<br />
		<br />
		<br />
		if (!File.Exists(savePath + &quot;&#92;&#92;&quot; + saveFile)) return;<br />
		<br />
		string[] loadedFile = File.ReadAllLines(savePath + &quot;&#92;&#92;&quot; + saveFile);<br />
		<br />
		string loadState = &quot;&quot;;<br />
		<br />
		for (int i=0; i&lt;loadedFile.Length; i++){<br />
			if (loadedFile[i] == &quot;I&quot;){<br />
				//start loading the ints<br />
				loadState = &quot;ints&quot;; <br />
			}else if (loadedFile[i] == &quot;F&quot;){<br />
				//start loading the floats<br />
				loadState = &quot;floats&quot;;<br />
			}else if (loadedFile[i] == &quot;S&quot;){<br />
				//start loading the strings<br />
				loadState = &quot;strings&quot;;<br />
			}else{<br />
				//load a key<br />
				string loadKey = loadedFile[i];<br />
				string loadVar = loadedFile[i+1];<br />
				<br />
				if (loadState == &quot;ints&quot;){<br />
					intKeys.Add(loadKey);<br />
					ints.Add(MakeInt(loadVar));<br />
				}else if (loadState == &quot;floats&quot;){<br />
					floatKeys.Add(loadKey);<br />
					floats.Add(MakeFloat(loadVar));<br />
				}else if (loadState == &quot;strings&quot;){<br />
					stringKeys.Add(loadKey);<br />
					strings.Add(loadVar);<br />
				}<br />
				<br />
				i++; //skip a line (next line is the var for this key)<br />
			}<br />
		}<br />
	}	<br />
	<br />
	static float MakeFloat(string v) {<br />
		return System.Convert.ToSingle(v.Trim(), new System.Globalization.CultureInfo(&quot;en-US&quot;));<br />
	}<br />
	<br />
	static int MakeInt(string v) {<br />
		return System.Convert.ToInt32(v.Trim(), new System.Globalization.CultureInfo(&quot;en-US&quot;));<br />
	}<br />
	<br />
}<br />
<br />
//class to go on object to let us know when the game is quitting:<br />
public class SaveCaller : MonoBehaviour {<br />
	void Start(){<br />
		DontDestroyOnLoad(gameObject);<br />
	}<br />
	void OnApplicationQuit(){<br />
		PlayerSave.Save();<br />
	}<br />
}<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2012/01/25/playersave-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Global Game Jam 2012 &#124; Unity Technologies</title>
		<link>http://www.bydesigngames.com/2012/01/25/the-global-game-jam-2012-unity-technologies/</link>
		<comments>http://www.bydesigngames.com/2012/01/25/the-global-game-jam-2012-unity-technologies/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 05:04:49 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://blogs.unity3d.com/?p=6714</guid>
		<description><![CDATA[&#160; Its that time of year again! It seems like a lifetime ago that I was attending my very first Global Game Jam back in early 2009. I doubt I could ever have imagined that in the subsequent years I would be working for the company who&#8217;s tools I was using for the 48 hour...]]></description>
			<content:encoded><![CDATA[<p><a rel="nofollow"  href="http://blogs.unity3d.com/2012/01/25/the-global-game-jam-2012/ggjbanner/"><img class="aligncenter size-full wp-image-6716" title="ggjbanner" src="http://blogs.unity3d.com/wp-content/uploads/2012/01/ggjbanner.jpg" alt="" width="654" height="103"/></a></p>
<p>&nbsp;</p>
<p>Its that time of year again!</p>
<p>It seems like a lifetime ago that I was attending my very first Global Game Jam back in early 2009.</p>
<p>I doubt I could ever have imagined that in the subsequent years I would be working for the company who&#8217;s tools I was using for the 48 hour caffeine sustained chaos.</p>
<p>So its with great joy that I&#8217;m happy to announce how we are supporting the Jam this year.</p>
<p>First and foremost we are issuing Unity Pro trials to ALL participants attending the jam. Which include iOS, Android and Asset Server. For more information please contact your local venue organizers who in turn, should be receiving information on how to get access to the trial from the global organizers.</p>
<p>In addition to that we are also supporting a small number of venues around the globe directly. These sponsorships will help keep you guys ticking over with food, drink, electricity, rental of space and all of the other costs included in setting up such a tremendous event.</p>
<p>Before I go I&#8217;d just like to wish everyone attending (or those still considering attending) the very best of luck. I&#8217;m a huge fan of Game Jams myself so I can&#8217;t wait to see what you guys come up with! (and I&#8217;m totally jealous that I won&#8217;t be able to participate this year)</p>
<p>&nbsp;</p>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2012/01/25/the-global-game-jam-2012-unity-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unity 3.5 Developer Preview: Expanding Horizons! &#124; Unity Technologies</title>
		<link>http://www.bydesigngames.com/2012/01/25/unity-3-5-developer-preview-expanding-horizons-unity-technologies/</link>
		<comments>http://www.bydesigngames.com/2012/01/25/unity-3-5-developer-preview-expanding-horizons-unity-technologies/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 00:00:51 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Rants & Raves]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://blogs.unity3d.com/?p=6571</guid>
		<description><![CDATA[The recently released Unity Developer Preview is jam-packed with new features. Among the most exciting of these features are previews of two new export options for publishing to the web: Google Native Client and Flash. In addition to leveraging users&#8217; already-installed software to get them into your games even faster, these platforms will allow Unity...]]></description>
			<content:encoded><![CDATA[<p><a rel="nofollow"  href="http://blogs.unity3d.com/2012/01/25/unity-3-5-developer-preview-expanding-horizons/angrybotsswf/"></a><a rel="nofollow"  href="http://blogs.unity3d.com/2012/01/25/unity-3-5-developer-preview-expanding-horizons/angrybotsswf-620/"><img class="alignnone size-full wp-image-6741" title="Flashy Bots!" src="http://blogs.unity3d.com/wp-content/uploads/2011/12/angrybotsswf-620.png" alt="Flashy Bots!" width="620" height="573"/></a></p>
<p>The recently released Unity Developer Preview is jam-packed with new features. Among the most exciting of these features are previews of two new export options for publishing to the web: Google Native Client and Flash.</p>
<p>In addition to leveraging users&#8217; already-installed software to get them into your games even faster, these platforms will allow Unity developers to perform for a previously unreachable audience: <strong>Linux users!</strong></p>
<h2>Wait, what?</h2>
<p>Thanks to the cross-platform nature of Google&#8217;s Native Client toolkit, Unity web players built using the <em>Enable NaCl Support</em> option will just work for Chrome users, regardless of whether they&#8217;re using Chrome on Linux, Windows, or Mac OSX. This makes the <a rel="nofollow"  href="https://chrome.google.com/webstore/category/app/3-games">Chrome Web Store</a> one of the first distribution channels to provide high-quality 3D games to all three major desktop platforms.</p>
<p>In addition, players making use of Unity&#8217;s new Flash export feature will also run in any Stage 3D-enabled browser, regardless of operating system. Linux users will take a moderate performance hit here, however, as Adobe has delayed Linux support for GPU-accelerated rasterization in Stage 3D. Nevertheless, an out-of-the-box Flash build of the Angry Bots demo looked great and ran smoothly on my Ubuntu workstation, at the cost of somewhat higher CPU usage.</p>
<p>We&#8217;re excited about these publishing options because they represent Unity&#8217;s first official support for Linux, <a rel="nofollow"  href="http://feedback.unity3d.com/forums/15792-unity/suggestions/164961-platforms-linux-player-web-player-support">an oft-requested feature.</a></p>
<h2>How many people are we talking about?</h2>
<p>Linux usage is notoriously difficult to track, since there&#8217;s no single point where cash gets exchanged for code, and is generally underreported. However, we do have a few relevant data points.</p>
<p><a rel="nofollow" title="w3schools"  href="http://w3schools.com">w3schools</a>, a comprehensive online web development reference, keeps <a rel="nofollow"  href="http://www.w3schools.com/browsers/browsers_os.asp">comprehensive statistics</a> about their visitors&#8217; operating system usage, as reported by browsers. In 2011, reported Linux usage has held steady between 5 and 6% (for comparison, reported MacOS usage is between 7 and 9%). Additionally, w3schools has been gathering these statistics for years, so it&#8217;s possible to see a general growth trend for Linux since it started with around 2% reported usage in 2003. Some have suggested that w3schools&#8217;s content biases its userbase toward more technical users who could be more likely than a random sampling of the general public to have adopted Linux, but there are clearly <a rel="nofollow" title="non-technical roads"  href="http://bit.ly/uzhLlZ">non-technical roads</a> that lead directly to w3schools.</p>
<h2>What does this mean for my game?</h2>
<p>The <a rel="nofollow" title="Humble Indie Bundle"  href="http://humblebundle.com">Humble Indie Bundle</a>, a series of pay-what-you-choose, independent game bundles that supports Linux, OSX, and Windows, reports that 20 to 35% (based on highly scientific pie chart estimation <img src='http://blogs.unity3d.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley'/> ) of each bundle&#8217;s total revenue originates from Linux users. In addition, Linux users choose to pay an average of 100%+ more than Windows users, and about 50% more than OSX users. (Current statistics for HIB4 show an average payment of $10.29 for Linux, $7.42 for OSX, and $4.57 for Windows.) Other data points include <a rel="nofollow"  href="http://2dboy.com">2D Boy</a>, who reported that 17% of the sales in their pay-what-you-choose campaign for World of Goo came from Linux users, compared to 18% on OSX, with Linux users again choosing to pay substantially more than users on other platforms. <a rel="nofollow"  href="http://frictionalgames.com/">Frictional Games</a> reported in 2010 that 12% of sales for their Penumbra series were attributable to Linux users.</p>
<p>So, this means that you can realistically gain 12-35% revenue potential just by clicking the <em>Enable NaCl Support</em> checkbox before building your webplayer.</p>
<h2>Show me the goods!</h2>
<p>The <a rel="nofollow"  href="https://chrome.google.com/webstore/detail/ibdomdppnicebcgjhcjfchbonebbjkhb">Angry Bots demo</a> has been on the Chrome Web Store for some time now &#8211; go check it out! Google also featured several Unity games (4 of the 7 games featured were built with Unity) in its recent <a rel="nofollow"  href="https://www.youtube.com/watch?v=ZHZVVJQwJLU">Chrome Web Store trailer</a>: <a rel="nofollow"  href="https://chrome.google.com/webstore/detail/dgjbkahdllcckjbjijejpmcgkkjpnnfk">Cordy</a>, Pirates of New Horizons, <a rel="nofollow"  href="https://chrome.google.com/webstore/detail/edjdoaebnejlnjknbkbacepgemnjlmfc">Sleepy Jack</a>, and Running Fred.</p>
<p>The Chrome Web Store is the first link every Chrome user sees when opening a new tab, so get your awesome games up there where <a rel="nofollow"  href="http://www.w3schools.com/browsers/browsers_chrome.asp">33.4% of all Internet users</a> can&#8217;t miss them!</p>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2012/01/25/unity-3-5-developer-preview-expanding-horizons-unity-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GUI Keyboard &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2012/01/16/gui-keyboard-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2012/01/16/gui-keyboard-unify-wiki/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 07:34:56 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=GUI_Keyboard</guid>
		<description><![CDATA[James 170482: Created page with &#34;using UnityEngine; using System.Collections; using System.Collections.Generic;  public class Virtual_Keyboard : MonoBehaviour { 	 	public GUISkin MySkin; 	 	#region Scrolling ...&#34;

using UnityEngine;
using Sys...]]></description>
			<content:encoded><![CDATA[<p>James 170482: Created page with &quot;using UnityEngine; using System.Collections; using System.Collections.Generic;  public class Virtual_Keyboard : MonoBehaviour { 	 	public GUISkin MySkin; 	 	#region Scrolling ...&quot;</p>
<hr />
<div>using UnityEngine;<br />
using System.Collections;<br />
using System.Collections.Generic;<br />
<br />
public class Virtual_Keyboard : MonoBehaviour {<br />
	<br />
	public GUISkin MySkin;<br />
	<br />
	#region Scrolling Keyboard Textures<br />
	<br />
	        public Texture2D Letter_A;<br />
		    public Texture2D Letter_B;<br />
			public Texture2D Letter_C;<br />
			public Texture2D Letter_D;<br />
			public Texture2D Letter_E;<br />
			public Texture2D Letter_F;<br />
			public Texture2D Letter_G;<br />
			public Texture2D Letter_H;<br />
			public Texture2D Letter_I;<br />
			public Texture2D Letter_J;<br />
			public Texture2D Letter_K;<br />
			public Texture2D Letter_L;<br />
			public Texture2D Letter_M;<br />
			public Texture2D Letter_N;<br />
			public Texture2D Letter_O;<br />
	        public Texture2D Letter_P;<br />
		    public Texture2D Letter_Q;<br />
			public Texture2D Letter_R;<br />
			public Texture2D Letter_S;<br />
			public Texture2D Letter_T;<br />
			public Texture2D Letter_U;<br />
			public Texture2D Letter_V;<br />
			public Texture2D Letter_W;<br />
			public Texture2D Letter_X;<br />
			public Texture2D Letter_Y;<br />
			public Texture2D Letter_Z;<br />
	        public Texture2D Number_0;<br />
	        public Texture2D Number_1;<br />
		    public Texture2D Number_2;<br />
			public Texture2D Number_3;<br />
			public Texture2D Number_4;<br />
			public Texture2D Number_5;<br />
			public Texture2D Number_6;<br />
			public Texture2D Number_7;<br />
			public Texture2D Number_8;<br />
			public Texture2D Number_9;<br />
			public Texture2D Add;<br />
			public Texture2D Subtract;<br />
	        public Texture2D Divide;<br />
	        public Texture2D Multiply;<br />
	        public Texture2D equals;<br />
			<br />
	#endregion<br />
	<br />
	//reset button texture<br />
	public Texture2D ResetButtonTexture;<br />
	<br />
	//keyboard position floats<br />
	private float offset = 10f;<br />
	<br />
	//text input stuff<br />
	public string character;   // used  as the string holder for textfield etc<br />
	<br />
	//KeyBoard<br />
	private bool displayKeyBoard = true;<br />
	private const int KEYBOARD_WINDOW_ID = 0;<br />
	private Rect KeyBoardRect = new Rect(0, 0, 0, 0);<br />
	private Vector2 KeyBoardSlider = Vector2.zero;<br />
	<br />
	//reset button<br />
	private bool ResetString = true;<br />
		<br />
	<br />
	//amount of buttons to have dependant on alphabet , numbers , symbols you want etc<br />
	private float amtButtons = 41f;<br />
	<br />
	//keyboard button sizes<br />
	private float buttonWidth = 70f;<br />
	private float buttonHeight = 70f;<br />
		<br />
	<br />
	// Use this for initialization<br />
	void Start () <br />
	{<br />
	<br />
	}<br />
	<br />
	// Update is called once per frame<br />
	void Update () <br />
	{<br />
	<br />
	}<br />
	<br />
	void OnGUI ()<br />
	{<br />
		GUI.skin = MySkin;<br />
		<br />
		if(displayKeyBoard)	<br />
		{<br />
		   KeyBoardRect = GUI.Window(KEYBOARD_WINDOW_ID, new Rect(offset, Screen.height - (offset + 125f), Screen.width - (offset * 2), 125f), KeyBoardWindow, &quot;&quot; );<br />
		}	<br />
	<br />
	    if(ResetString)<br />
		{<br />
			if(GUI.Button(new Rect(Screen.width /2, Screen.height /2, buttonWidth, buttonHeight), ResetButtonTexture))<br />
			{<br />
				character = &quot;&quot;;<br />
			}<br />
		}<br />
		<br />
	}<br />
		<br />
	private void KeyBoardWindow(int id)<br />
		{<br />
		   KeyBoardSlider = GUI.BeginScrollView(new Rect(5, 15, KeyBoardRect.width - 10, 100f), KeyBoardSlider , new Rect(-5f , -6f,  buttonWidth * amtButtons + offset * 3, buttonHeight + offset));<br />
		{<br />
			Populate();<br />
        }<br />
		    GUI.EndScrollView();<br />
		}<br />
	<br />
	<br />
<br />
	// populate buttons with textures and desired input functions if you add or delete change amtButtons float to required number of buttons<br />
	#region populate<br />
	   void Populate ()<br />
	{<br />
		<br />
		    //alphabet buttons<br />
		<br />
		<br />
	        if(GUI.Button(new Rect(offset, 0, buttonWidth, buttonHeight), Letter_A))	<br />
		{<br />
			character = character + &quot;A&quot;;<br />
		}		<br />
            if(GUI.Button(new Rect(buttonWidth * 1 + offset, 0, buttonWidth, buttonHeight), Letter_B))<br />
		{<br />
			character = character + &quot;B&quot; ;<br />
		}<br />
            if(GUI.Button(new Rect(buttonWidth * 2 + offset, 0, buttonWidth, buttonHeight), Letter_C))<br />
		{<br />
			character = character + &quot;C&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 3 + offset, 0, buttonWidth, buttonHeight), Letter_D))<br />
		{<br />
			character = character + &quot;D&quot;;<br />
		}	<br />
			if(GUI.Button(new Rect(buttonWidth * 4 + offset, 0, buttonWidth, buttonHeight), Letter_E))<br />
		{<br />
			character = character + &quot;E&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 5 + offset, 0, buttonWidth, buttonHeight), Letter_F))<br />
		{<br />
			character = character + &quot;F&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 6 + offset, 0, buttonWidth, buttonHeight), Letter_G))<br />
		{<br />
			character = character + &quot;G&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 7 + offset, 0, buttonWidth, buttonHeight), Letter_H))<br />
		{<br />
			character = character + &quot;H&quot;;<br />
		}	<br />
			if(GUI.Button(new Rect(buttonWidth * 8 + offset, 0, buttonWidth, buttonHeight), Letter_I))<br />
		{<br />
			character = character + &quot;I&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 9 + offset, 0, buttonWidth, buttonHeight), Letter_J))<br />
		{<br />
			character = character + &quot;J&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 10 + offset, 0, buttonWidth, buttonHeight), Letter_K))<br />
		{<br />
			character = character + &quot;K&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 11 + offset, 0, buttonWidth, buttonHeight), Letter_L))<br />
		{<br />
			character = character + &quot;L&quot;;<br />
		}	<br />
			if(GUI.Button(new Rect(buttonWidth * 12 + offset, 0, buttonWidth, buttonHeight), Letter_M))<br />
		{<br />
			character = character + &quot;M&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 13 + offset, 0, buttonWidth, buttonHeight), Letter_N))<br />
		{<br />
			character = character + &quot;N&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 14 + offset, 0, buttonWidth, buttonHeight), Letter_O))<br />
		{<br />
			character = character + &quot;O&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 15 + offset, 0, buttonWidth, buttonHeight), Letter_P))<br />
		{<br />
			character = character + &quot;P&quot;;<br />
		}	<br />
			if(GUI.Button(new Rect(buttonWidth * 16 + offset, 0, buttonWidth, buttonHeight), Letter_Q))<br />
		{<br />
			character = character + &quot;Q&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 17 + offset, 0, buttonWidth, buttonHeight), Letter_R))<br />
		{<br />
			character = character + &quot;R&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 18 + offset, 0, buttonWidth, buttonHeight), Letter_S))<br />
		{<br />
			character = character + &quot;S&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 19 + offset, 0, buttonWidth, buttonHeight), Letter_T))<br />
		{<br />
			character = character + &quot;T&quot;;<br />
		}<br />
			if(GUI.Button(new Rect(buttonWidth * 20 + offset, 0, buttonWidth, buttonHeight), Letter_U))<br />
		{<br />
			character = character + &quot;U&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 21 + offset, 0, buttonWidth, buttonHeight), Letter_V))<br />
		{<br />
			character = character + &quot;V&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 22 + offset, 0, buttonWidth, buttonHeight), Letter_W))<br />
		{<br />
			character = character + &quot;W&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 23 + offset, 0, buttonWidth, buttonHeight), Letter_X))<br />
		{<br />
			character = character + &quot;X&quot;;<br />
		}	<br />
			if(GUI.Button(new Rect(buttonWidth * 24 + offset, 0, buttonWidth, buttonHeight), Letter_Y))<br />
		{<br />
			character = character + &quot;Y&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 25 + offset, 0, buttonWidth, buttonHeight), Letter_Z))<br />
		{<br />
			character = character + &quot;Z&quot;;<br />
		}<br />
		    if(GUI.Button(new Rect(buttonWidth * 26 + offset, 0, buttonWidth, buttonHeight), Number_0))<br />
		{<br />
			character = character + &quot;0&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 27 + offset, 0, buttonWidth, buttonHeight), Number_1))<br />
		{<br />
			character = character + &quot;1&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 28 + offset, 0, buttonWidth, buttonHeight), Number_2))<br />
		{<br />
			character = character + &quot;2&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 29 + offset, 0, buttonWidth, buttonHeight), Number_3))<br />
		{<br />
			character = character + &quot;3&quot;;<br />
		}	<br />
			if(GUI.Button(new Rect(buttonWidth * 30 + offset, 0, buttonWidth, buttonHeight), Number_4))<br />
		{<br />
			character = character + &quot;4&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 31 + offset, 0, buttonWidth, buttonHeight), Number_5))<br />
		{<br />
			character = character + &quot;5&quot;;<br />
		}<br />
		    if(GUI.Button(new Rect(buttonWidth * 32 + offset, 0, buttonWidth, buttonHeight), Number_6))<br />
		{<br />
			character = character + &quot;6&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 33 + offset, 0, buttonWidth, buttonHeight), Number_7))<br />
		{<br />
			character = character + &quot;7&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 34 + offset, 0, buttonWidth, buttonHeight), Number_8))<br />
		{<br />
			character = character + &quot;8&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 35 + offset, 0, buttonWidth, buttonHeight), Number_9))<br />
		{<br />
			character = character + &quot;9&quot;;<br />
		}	<br />
			if(GUI.Button(new Rect(buttonWidth * 36 + offset, 0, buttonWidth, buttonHeight), Add))<br />
		{<br />
			character = character + &quot;+&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 37 + offset, 0, buttonWidth, buttonHeight), Subtract))<br />
		{<br />
			character = character + &quot;-&quot;;<br />
		}<br />
		    if(GUI.Button(new Rect(buttonWidth * 38 + offset, 0, buttonWidth, buttonHeight), Divide))<br />
		{<br />
			character = character + &quot;/&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 39 + offset, 0, buttonWidth, buttonHeight), Multiply))<br />
		{<br />
			character = character + &quot;*&quot;;<br />
		}	<br />
            if(GUI.Button(new Rect(buttonWidth * 40 + offset, 0, buttonWidth, buttonHeight), equals))<br />
		{<br />
			character = character + &quot;=&quot;;<br />
		}	<br />
	}<br />
	<br />
	#endregion<br />
}</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2012/01/16/gui-keyboard-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Union bringing games to 2012 LG smart TVs &#124; Unity Technologies</title>
		<link>http://www.bydesigngames.com/2012/01/13/union-bringing-games-to-2012-lg-smart-tvs-unity-technologies/</link>
		<comments>http://www.bydesigngames.com/2012/01/13/union-bringing-games-to-2012-lg-smart-tvs-unity-technologies/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 16:14:55 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://blogs.unity3d.com/?p=6641</guid>
		<description><![CDATA[This week at CES 2012 in Las Vegas, Unity games were playing on an exciting new platform: LG smart TVs. Union is working with LG to bring games to their impressive 2012 line of smart TVs. These aren’t run-of-the-mill TVs—LG’s Magic Remote supports motion control for games, a built-in camera enables Kinect-like gesture control for...]]></description>
			<content:encoded><![CDATA[<p>This week at CES 2012 in Las Vegas, Unity games were playing on an exciting new platform: <a rel="nofollow"  href="http://www.lg.com/us/ces/">LG smart TVs</a>.</p>
<p>Union is working with LG to bring games to their impressive 2012 line of smart TVs. These aren’t run-of-the-mill TVs—LG’s Magic Remote supports motion control for games, a built-in camera enables Kinect-like gesture control for select titles, and stereo 3D is supported right out of the box.</p>
<div id="attachment_6642" class="wp-caption alignright" style="width:310px;"><a rel="nofollow"  href="http://blogs.unity3d.com/2012/01/13/union-and-2012-lg-smart-tvs/img-20120111-00088/"><img class="size-medium wp-image-6642" title="ces-2012_lg-smart-tv" src="http://blogs.unity3d.com/wp-content/uploads/2012/01/IMG-20120111-00088-300x225.jpg" alt="Frisbee Forever LG smart TV demo at CES 2012" width="300" height="225"/></a><p class="wp-caption-text">Frisbee Forever LG smart TV demo at CES 2012</p></div>
<p>And then there’s the processing power. <a rel="nofollow"  href="http://madfingergames.com/">Madfinger</a>’s jaw-dropping shooter <em><a rel="nofollow"  href="http://itunes.apple.com/us/app/shadowgun/id440141669?mt=8">Shadowgun</a> </em>runs at a smooth 30 frames per second at 720p. <a rel="nofollow"  href="http://itunes.apple.com/us/app/frisbee-forever/id431855391?mt=8"><em>Frisbee Forever</em></a>, the multi-million selling hit iOS game from <a rel="nofollow"  href="http://www.kiloo.com/games/">Kiloo Games</a>, (which is also <a rel="nofollow"  href="http://store.ovi.com/content/215521">available for Nokia&#8217;s N9 handset</a>) soars on LG smart TV with motion control. Both were demoed in LG’s booth and received quite the response from CES attendees. These two great games are just the beginning: more Union games will debut on LG smart TV this spring.</p>
<p>As with the other platforms with which Union works—BlackBerry PlayBook, Roku, and Nokia MeeGo N9—we currently don’t have plans to support LG smart TV deployment from Unity. Instead, Unity-authored games for LG smart TV will be released through Union.</p>
<p>If you’re keen to <a rel="nofollow"  href="http://unity3d.com/union/">learn more about Union</a> and the work we’re doing with games for LG smart TV or want to submit a game to Union, <a rel="nofollow"  href="mailto:union@unity3d.com">contact us</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2012/01/13/union-bringing-games-to-2012-lg-smart-tvs-unity-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>每日提示 &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2012/01/01/%e6%af%8f%e6%97%a5%e6%8f%90%e7%a4%ba-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2012/01/01/%e6%af%8f%e6%97%a5%e6%8f%90%e7%a4%ba-unify-wiki/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 03:55:12 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=%E6%AF%8F%E6%97%A5%E6%8F%90%E7%A4%BA</guid>
		<description><![CDATA[Redcool007: 

* 按住V键,移动场景中的物体,可以快速对齐
* 蒙皮角色每帧都会更新它的顶点,甚至不播放动画.为了冻结一个蒙皮角色而不让它消失或还原到凝固姿势,将SkinnedMeshRenderer.bones设为null.
*...]]></description>
			<content:encoded><![CDATA[<p>Redcool007: </p>
<hr />
<div>* 按住V键,移动场景中的物体,可以快速对齐<br />
* 蒙皮角色每帧都会更新它的顶点,甚至不播放动画.为了冻结一个蒙皮角色而不让它消失或还原到凝固姿势,将SkinnedMeshRenderer.bones设为null.<br />
* 在检视器中有2个很好用的插入项和删掉项的快捷键,Shift+Del删除选中的项目和Ctrl+D复制项.Shift用于引用类型像GameObject[].<br />
* 如果你想打开深层次可以按住Alt键再展开项.<br />
* 当使用Debug.Log或相关的方法时,你可以点击输出记录编辑器中会选中相关的物体!<br />
* 如果你在屏幕上放置物体并想让它们对齐(对在地面上放置物体有效),可以在拖拽轴线时按住Command(windows是Control)键(对齐见[http://unity3d.com/support/documentation/Manual/Learning%20the%20Interface.html Edit-&gt;Snap Settings]).<br />
* 想在Javascript中导入类,避免写Debug.Log及SendMessageOptions.DontRequireReceiver?导入类静态成员及枚举正如导入命名空间.仅仅需要加入import UnityEngine.Debug及import UnityEngine.SendMessageOptions,之后就可以写Log(&quot;my log string&quot;)及SendMessage(&quot;ApplyDamage&quot;,2.0,DontRequireReceiver).<br />
* 删除物体.在场景,层次和项目视图中使用Command+Backspace键,在场景和层次视图中仅仅是删除选中物体的实例.在项目视图将删除选中的物体并将其放进你系统的回收站.<br />
* 如果你需要某些纹理如字体纹理,不受[http://unity3d.com/Documentation/ScriptReference/Texture-masterTextureLimit.html Texture.masterTextureLimit]影响,可以在纹理导入设置中将Mipmap关闭.当缩小文件进行渲染时,会降低清晰度.<br />
* Boo有一些方便的[http://boo.codehaus.org/Builtin+Functions+Summary 内置方法] 像 [http://boo.codehaus.org/Builtin+Functions+Summary#BuiltinFunctionsSummary-shell shell()], [http://boo.codehaus.org/Builtin+Functions+Summary#BuiltinFunctionsSummary-join join()] and [http://boo.codehaus.org/Builtin+Functions+Summary#BuiltinFunctionsSummary-reversed reversed()],在Javascript中一样使用.<br />
* 在inspector中每个内置组件在它的右侧都有一个小问号标记.这是打开组件帮助的最快的方式.你应该牢记.<br />
* 为了记住Unity中轴线的颜色.只要记住 RGB = XYZ.<br />
* 你可以使用Edit-&gt;Load Selection和Edit-&gt;Save Selection的快捷键来快速切换及记住你场景中常使用的物体.<br />
* 如果你按住option(alt)然后在层次中点击,可以将层次整个的展开或折叠.<br />
* 使用Unity你可以写Editor脚本来降低特殊项目的枯燥.跟写一个普通脚本一样,可以减少很多麻烦.见Wizard Archive中的例子.<br />
* 如果你在导入模型时遇到Vector3.up值到错误方向(或其他方向)的问题,建一个空对象放入方向错误的模型,然后在模型的局部控制调整它的方位.<br />
* 当在Inspector中为组件指定属性时,可以点击右侧的小圆圈,弹出菜单进行选择.输入需要的物体名称然后回车.这样可以比拖放更快的替换.<br />
* 当在Inspector视图中输入文字时,可以按住option-return来获取一新行,对GUIText输入多行很有帮助.<br />
* 当在unity面板中仅有一个编辑器视图并没有游戏视图,当你进入播放模式时编辑器视图将自动替换为游戏视图而点击停止时又自动切回.当你在一个小显示器中工作时这是一个相当不错的特性<br />
* 使用Tags类来为gameObject指定你自己的类型和属性.脚本可以引用到tags.如if (contact.otherCollider.tag == &quot;Enemy&quot;) 或 GameObject.FindWithTag (&quot;Enemy&quot;)<br />
* 如果你打算在一个项目中移动某文件使用Unity的Project视图来完成.unity将维护此文件的所有引用及导入设置.<br />
'''注意: 将新的技巧放置到列表的顶部,而不是底部.'''</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2012/01/01/%e6%af%8f%e6%97%a5%e6%8f%90%e7%a4%ba-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cache &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/12/31/cache-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/12/31/cache-unify-wiki/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 11:06:02 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=Cache</guid>
		<description><![CDATA[Redcool007: Created page with &#34;&#60;p&#62;The problem is when use WWW,if cached AssetBundle is exist, and you want load twice,unity will throw error. then can use this solution, if you like. &#60;/p&#62;  &#60;b&#62;AssetBundleDictio...&#34;

&#60;p&#62;...]]></description>
			<content:encoded><![CDATA[<p>Redcool007: Created page with &quot;&lt;p&gt;The problem is when use WWW,if cached AssetBundle is exist, and you want load twice,unity will throw error. then can use this solution, if you like. &lt;/p&gt;  &lt;b&gt;AssetBundleDictio...&quot;</p>
<hr />
<div>&lt;p&gt;The problem is when use WWW,if cached AssetBundle is exist, and you want load twice,unity will throw error.<br />
then can use this solution, if you like.<br />
&lt;/p&gt;<br />
<br />
&lt;b&gt;AssetBundleDictionary&lt;/b&gt;  manage the cache resource.&lt;br/&gt;<br />
&lt;pre&gt;<br />
#pragma strict<br />
import System.Collections.Generic;<br />
//////////////////////////////////////////////////////<br />
///工程,下载的资源管理<br />
///AssetBundle字典. <br />
///url为key,value:AssetBundle<br />
//////////////////////////////////////////////////////<br />
<br />
class AssetBundleDictionary{<br />
	/**资源字典.*/<br />
	private static var dict:Dictionary.&lt;String,AssetBundle&gt; = new Dictionary.&lt;String,AssetBundle&gt;();<br />
	<br />
	static function Add(url:String,go:AssetBundle){<br />
		Remove(url);<br />
		dict.Add(url,go);<br />
	}<br />
	<br />
	static function Remove(url:String){<br />
		if(Contains(url)){<br />
			dict[url].Unload(true);<br />
			dict.Remove(url);<br />
		}<br />
	}<br />
	<br />
	static function Clear(){<br />
		dict.Clear();<br />
	}<br />
	/**<br />
		根据key获取一个AssetBundle<br />
	*/<br />
	static function Get(url:String):AssetBundle{<br />
		return dict[url];<br />
	}<br />
	/**<br />
		从 字典中获取 mainAsset<br />
	*/<br />
	static function GetMainAsset(url:String):Object{<br />
		if(Contains(url)){<br />
			return dict[url].mainAsset;<br />
		}<br />
		return null;<br />
	}<br />
	/**<br />
		字典中是否包含key<br />
	*/<br />
	static function Contains(url:String):boolean{<br />
		return dict.ContainsKey(url);<br />
	}<br />
}<br />
&lt;/pre&gt;<br />
&lt;b&gt;2 LoadComponent&lt;/b&gt; , manage loading.<br />
<br />
&lt;pre&gt;<br />
#pragma strict<br />
//////////////////////////////////////////////////////<br />
///一个下载组件,下载时附加到GameObject<br />
//////////////////////////////////////////////////////<br />
/** www */<br />
var www:WWW;<br />
/** loading function */<br />
var progressFun:Function;<br />
<br />
/**<br />
	载入素材<br />
	@param url<br />
	@param version,为-1时,不从缓存载入.<br />
	@param onOk : function(prefab:Game):void<br />
*/<br />
function Load(url:String,version:int,onOk:Function){<br />
	if(version == -1){<br />
		www = WWW(url);<br />
	}else{<br />
		AssetBundleDictionary.Remove(url);<br />
		www = WWW.LoadFromCacheOrDownload(url,version);<br />
	}<br />
	yield WaitForLoading();<br />
	AssetBundleDictionary.Add(url, www.assetBundle);<br />
	onOk(AssetBundleDictionary.GetMainAsset(url));<br />
}<br />
/**载入文本.*/<br />
function LoadText(url:String,onOk:Function){<br />
	www = WWW(url);<br />
	yield WaitForLoading();<br />
	onOk(www.text);<br />
}<br />
<br />
/**等待完成.*/<br />
private function WaitForLoading(){<br />
	while(! www.isDone){<br />
		if(www.error){<br />
			Debug.Log(www.error);<br />
			break;<br />
		}<br />
		if(progressFun)<br />
			progressFun(www.progress);<br />
		yield;<br />
	}<br />
}<br />
&lt;/pre&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/31/cache-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unity 3.5 Developer Preview &#124; Unity Technologies</title>
		<link>http://www.bydesigngames.com/2011/12/22/unity-3-5-developer-preview-unity-technologies/</link>
		<comments>http://www.bydesigngames.com/2011/12/22/unity-3-5-developer-preview-unity-technologies/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 22:09:09 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://blogs.unity3d.com/?p=6614</guid>
		<description><![CDATA[Yesterday marked a huge milestone for Unity &#8211; releasing a public beta preview of our upcoming version 3.5 (Okay so you&#8217;re excited, you somehow missed the home page &#8211; go download it here http://unity3d.com/unity/preview). With a huge feature set to show off, and new export targets such as the much talked about Flash and Google...]]></description>
			<content:encoded><![CDATA[<p><img src="http://blogs.unity3d.com/wp-content/uploads/2011/12/dearsantaUnity-226x300.jpg" alt="" title="dearsantaUnity" width="226" height="300" class="alignright size-medium wp-image-6616"/>Yesterday marked a huge milestone for Unity &#8211; releasing a public beta preview of our upcoming version 3.5 (Okay so you&#8217;re excited, you somehow missed the home page &#8211; go download it here <a rel="nofollow"  href="http://unity3d.com/unity/preview">http://unity3d.com/unity/preview</a>). </p>
<p>With a huge feature set to show off, and new export targets such as the much talked about Flash and Google Native Client support, this developer preview is something of an early christmas gift we hope you&#8217;ll get a kick out of playing with. As if the carrot of previewing the features of 3.5 wasn&#8217;t enough, we are also running a <a rel="nofollow"  href="http://unity3d.com/unity/preview/contest">contest for those of you interested in deploying Unity content to Flash</a>, which could land you the awesome prize of $20,000 dollars. </p>
<p>Keep in mind that the preview of the Flash export support is just that &#8211; a preview, but we felt that we had hit a milestone that meant the feature was stable enough to let you guys get hands on and help us put it through its paces, as we&#8217;re sure you will! There are some limitations of our existing Unity feature set however, and you can jump onto the beta preview page and read the <a rel="nofollow"  href="http://unity3d.com/unity/preview/faq">FAQ</a> for more information, something we&#8217;ll be updating as time progresses so that you keep abreast of the latest information.</p>
<p>We have created a new section of the forum to help you discuss and organize your thoughts on any issues arising from the developer preview, so why not join in the debate now as you give Unity 3.5 a spin for yourself? </p>
<p><a rel="nofollow"  href="http://forum.unity3d.com/forums/33-Developer-Preview">http://forum.unity3d.com/forums/33-Developer-Preview</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/22/unity-3-5-developer-preview-unity-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The reason why Individuals Are Filing For A Zoloft Legal action &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/12/17/the-reason-why-individuals-are-filing-for-a-zoloft-legal-action-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/12/17/the-reason-why-individuals-are-filing-for-a-zoloft-legal-action-unify-wiki/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 11:33:18 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=The_reason_why_Individuals_Are_Filing_For_A_Zoloft_Legal_action</guid>
		<description><![CDATA[MagdaUBowerman6: Created page with &#34;Zoloft is one of the frequently used drugs for the cure of various mental disorders such as depression and stress. It is manufactured by the Pfizer Corporation. It spotted a boos...&#34;

Zoloft is one of the f...]]></description>
			<content:encoded><![CDATA[<p>MagdaUBowerman6: Created page with &quot;Zoloft is one of the frequently used drugs for the cure of various mental disorders such as depression and stress. It is manufactured by the Pfizer Corporation. It spotted a boos...&quot;</p>
<hr />
<div>Zoloft is one of the frequently used drugs for the cure of various mental disorders such as depression and stress. It is manufactured by the Pfizer Corporation. It spotted a boost within the demands during the past several years, however some people have began filing grievances. A longer utilization of the Zoloft drug can create serious negative effects which may cause extreme birth abnormalities and could be dangerous for expectant women. This year has observed a number of legal measures up against the Pfizer Corporation for deliberately concealing the important points concerning the Zoloft drug. A [http://zoloftlawsuitz.com Zoloft lawsuit] has been arranged for those who have suffered or perhaps seen a loved one endure the dangerous negative effects of this medicine. <br />
<br />
There are a number of side effects towards the use of Zoloft. Aside from the health related complications in expectant women, there have been many complications in newborn babies as well. Serious medical conditions including high blood pressure and skin problems are already observed in babies. <br />
<br />
Some other serious side effects include suicidal tendencies and bone loss in grown ups. Small babies also have formed birth complications and also suffer from some other severe problem soon after delivery. <br />
It's a serious matter and requires legal attention to produce awareness in increasingly more people who've been making use of this pill for a long time with no knowledge of the particular negative effects. <br />
The main problem here is the fact that a lot of patients who have currently suffered with these dangerous negative effects were not even told by the firms about these serious health abnormalities till they submitted a Zoloft lawsuit to assert settlement for the grave loss that they suffered. It is an alarming sign and requires serious attention from the administration. <br />
Oftentimes doctors are aware of the suicidal effects of anti-depressants along with their particular ethical duty to provide detailed information regarding the medicines they provide to patients. <br />
<br />
It should also be mentioned that a warning is always mentioned on drugs and a physician should know about the side effects of varied medicines. He or she must prescribe the drugs to patients according to their conditions and must also expose the possible risks of a particular medicine. Nevertheless, so far the severe birth defects by using Zoloft are not admitted by the manufacturing team. It's also in media that the Pfizer group didn't point out the risks to physicians and also didn't discharge any kind of alerts. <br />
<br />
After knowing these facts it is difficult to file a Zoloft lawsuit up against the makers simply because by doing this not merely manufacturers but also doctors will be brought for questioning due to their irresponsibility. <br />
<br />
Nevertheless, these facts compelled people coming from different parts of the society to start a marketing campaign against this company due to which more and more people are now filing Zoloft lawsuits to retrieve losing from the Zoloft medicine. A claim has been submitted by many people all over the world through these Zoloft lawsuits. A lot of awareness has developed within the modern society regarding the serious negative effects of the Zoloft drug and also doctors also have become much more precautious than they were before.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/17/the-reason-why-individuals-are-filing-for-a-zoloft-legal-action-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Effexor Is Recommended For As Well As The Side Effects It Could Bring &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/12/17/what-effexor-is-recommended-for-as-well-as-the-side-effects-it-could-bring-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/12/17/what-effexor-is-recommended-for-as-well-as-the-side-effects-it-could-bring-unify-wiki/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 11:07:53 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=What_Effexor_Is_Recommended_For_As_Well_As_The_Side_Effects_It_Could_Bring</guid>
		<description><![CDATA[AndrewPBaggett3: Created page with &#34;Effexor is a medical drug that's mostly intended for depressive disorders. Doctors prescribe this drug for severe depression cases. It's used as an anti depressant agent. But, af...&#34;

Effexor is a medical d...]]></description>
			<content:encoded><![CDATA[<p>AndrewPBaggett3: Created page with &quot;Effexor is a medical drug that's mostly intended for depressive disorders. Doctors prescribe this drug for severe depression cases. It's used as an anti depressant agent. But, af...&quot;</p>
<hr />
<div>Effexor is a medical drug that's mostly intended for depressive disorders. Doctors prescribe this drug for severe depression cases. It's used as an anti depressant agent. But, after its' creation and application, many people began making complaints due to its growing adverse reactions. <br />
<br />
Effexor is more strongly associated with birth defects which is the result of certain adverse reactions due to the usage of Effexor. Many women who used this medicine suffered from a lot of side effects that affected their pregnancy situations. There were many diseases as well as side effects that are diagnosed with the newborn babies. This has become a serious problem and more and more people have started filling law suits to assert settlement. <br />
<br />
It's absolutely advised to those individuals who have seen their loved ones experience the intense negative effects of Effexor drugs to file for an [http://effexorlawsuitz.com Effexor lawsuit] within the oversight of a lawyer. If you happen to be the individual who has suffered from these adverse reactions then don't misuse any opportunity and consider legal action versus the Effexor company. Effexor drug is part to a large group of businesses that are referred to as SSNRI group. An Effexor drug performs as an antidepressant agent and is frequently used against many psychological conditions including stress, depression, phobia, anxiety, restlessness and a lot of other similar situations. <br />
<br />
In the US, it is among the greatly utilized medicines and has millions of users. Over a million prescription medications are recommended for patients for different health conditions every year. <br />
During the past couple of years this pill has initiated a major controversy. The main objective of this debate is around the increasing side effects which are brought on by the usage of Effexor. The main element of such side effects is they attack the chemicals in brain and can make some severe psychological complications. These effects haven't only afflicted the expectant women but may also affect young people as well as adults. <br />
<br />
A longer utilization of Effexor can make a serious psychological condition which could increase the aggressiveness in nature and can also encourage suicidal attempts and efforts of self harm. <br />
For those who have confronted this kind of situation then it is the proper time to submit an Effexor claim. Get an aid of a professional lawyer and find out a little more about the legal proceedings. You can declare compensation from the company and will be able to reveal the realities that usually remain concealed by these companies and can result in death through severe side effects. <br />
<br />
You might need to go through several procedures to be able to figure out the requirements for filing an Effexor lawsuit. With a bit of basic steps, if you are proclaimed to be eligible, then your lawyers are going to get in touch with you and also will guide you with the remainder of the legal stage. It is an excellent way to claim the settlements coming from the business that ruined the world of households. Even though it may not be sufficient at the very least it's going to reveal the causes.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/17/what-effexor-is-recommended-for-as-well-as-the-side-effects-it-could-bring-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why You Should File A Fosamax Legal action &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/12/17/why-you-should-file-a-fosamax-legal-action-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/12/17/why-you-should-file-a-fosamax-legal-action-unify-wiki/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 10:41:26 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Why_You_Should_File_A_Fosamax_Legal_action</guid>
		<description><![CDATA[MaryTHardin9: Created page with &#34;Fosamax is a pill that's given for different conditions due to menopause. One such conditions is osteoporosis or weakening of the bones, that's caused by particular menopause sid...&#34;

Fosamax is a pill that's ...]]></description>
			<content:encoded><![CDATA[<p>MaryTHardin9: Created page with &quot;Fosamax is a pill that's given for different conditions due to menopause. One such conditions is osteoporosis or weakening of the bones, that's caused by particular menopause sid...&quot;</p>
<hr />
<div>Fosamax is a pill that's given for different conditions due to menopause. One such conditions is osteoporosis or weakening of the bones, that's caused by particular menopause side effects. There are some adverse reactions which go with using Fosamax. These types of adverse reactions can certainly, over time, produce serious health problems. If you are somebody who is suffering from these kinds of adverse reactions due to using Fosamax then you are well over eligible of filing a Fosamax lawsuit versus Fosamax maker. <br />
<br />
Research indicates that after having a Fosamax medicine, several adverse reactions occur at some point which include skin rash, tooth pain, numbness and also many more. Among the adverse reactions is actually associated with bone malfunction. In other words a bone fracture can occur following a specific amount of Fosamax usage. It is a severe health complication which has forced people around the world to file a [http://fosamaxlawsuitz.com Fosamax lawsuit] against the manufacturing company. <br />
<br />
A lot of people who're recommended for using Fosamax are likely not aware of its adverse reactions. Since the physicians suggest taking Fosamax for the management of osteoporosis, they may provide you with a look on its side effects. The point here is that you should have in-depth knowledge regarding these effects because initially you may not see any changes in the body and typically a lengthier use can result in some serious side effects to different areas of your body especially the bones. <br />
<br />
For those who have already challenged any form of side effects associated with the use of Fosamax then you can very well ask for compensation through a lawsuit. Additionally it is very important to remember that not everyone can file this type of suit because there is a preset criterion for determining the qualification for making a Fosamax lawsuit. Regardless of whether you are dishonest within the eligibility requirements is to be determined by the legal experts.<br />
<br />
In case you have any concerns then it is encouraged to visit a lawyer to know more concerning the legal criteria for attaining settlement. You may be advised to fill a form at first. It is done to check the qualification of a person and also to determine if an individual can claim settlement or otherwise. The health conditions resulting from the negative effects of Fosamax are the basis for identifying the eligibility of the clients. <br />
<br />
The evaluation form is an easy method to know about eligibility. You're essentially needed to submit your private information by means of email ID, name, medical background, contact number, etc. Right after completing the form you'll get a phone call within a time period of 24 hours declaring if you are eligible for a Fosamax lawsuit or otherwise. It's a fairly easy process and may basically respond to the queries of individuals in a short span of time. If you are qualified for settlement then the legal professionals will contact you as well as provide the information on the legal process that helps one to go even further with proceedings.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/17/why-you-should-file-a-fosamax-legal-action-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Boyama oyunu &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/12/16/boyama-oyunu-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/12/16/boyama-oyunu-unify-wiki/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 00:59:41 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Boyama_oyunu</guid>
		<description><![CDATA[Oyunoyna: Created page with &#34;En güzel ve en güncel flash barbie oyunlari oyun kedisi sitesinde sizleri bekliyor. Barbie disari çikmadan önce sizin zevkinize göre giyinecek, dilerseniz barbie yapbozu par...&#34;

En güzel ve en güncel flash...]]></description>
			<content:encoded><![CDATA[<p>Oyunoyna: Created page with &quot;En güzel ve en güncel flash barbie oyunlari oyun kedisi sitesinde sizleri bekliyor. Barbie disari çikmadan önce sizin zevkinize göre giyinecek, dilerseniz barbie yapbozu par...&quot;</p>
<hr />
<div>En güzel ve en güncel flash barbie oyunlari oyun kedisi sitesinde sizleri bekliyor. Barbie disari çikmadan önce sizin zevkinize göre giyinecek, dilerseniz barbie yapbozu parçalayarak yeniden parçalari toplayabilirsiniz. <br />
 [http://www.oyunkedisi.com online oyun oynasana<br />
]<br />
En güzel ve kaliteli  adresi oyun kedisinde. Mutlaka ziyaret ediniz <br />
<br />
en iyi oyunlari bulmak icin<br />
[http://www.oyunkedisi.com  oyunlari oynasana<br />
]  oyun kedisini ziyaret edin</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/16/boyama-oyunu-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ArcBall &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/12/14/arcball-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/12/14/arcball-unify-wiki/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 11:48:17 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=ArcBall</guid>
		<description><![CDATA[Racocvr: 

[[Category: General Purpose Effect Scripts]]
[[Category: C Sharp]]
Author: [[User:Racocvr&#124;Vlad Chifor]]
== Description ==
Use this script to rotate an object in an intuitive way. The mouse input is used to compute a rotation axis and an angu...]]></description>
			<content:encoded><![CDATA[<p>Racocvr: </p>
<hr />
<div>[[Category: General Purpose Effect Scripts]]<br />
[[Category: C Sharp]]<br />
Author: [[User:Racocvr|Vlad Chifor]]<br />
== Description ==<br />
Use this script to rotate an object in an intuitive way. The mouse input is used to compute a rotation axis and an angular velocity. This idea is based on the ArcBall Rotation Control technique presented in the book Graphics Gems IV by Ken Shoemake.<br />
<br />
== Usage ==<br />
Attach this script and a sphere collider to the object. Adjust the sphere radius to your needs. Use the speed and damping variables to tweak the rotation speed.<br />
<br />
== C Sharp - ArcBall.cs ==<br />
&lt;csharp&gt;// Attach this script and a sphere collider to the object. Adjust the sphere radius to your needs. Use the speed and damping variables to tweak the rotation speed.<br />
//<br />
// Author: Vlad Chifor - racocvr@gmail.com<br />
<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
public class ArcBall : MonoBehaviour<br />
{<br />
	public float damping = 0.9f;<br />
	public float speed = 0.1f;<br />
	<br />
	private Vector3 vDown;<br />
	private Vector3 vDrag;<br />
	private bool dragging;<br />
	private float angularVelocity;<br />
	private Vector3 rotationAxis;<br />
	<br />
	void Start ()<br />
	{<br />
		dragging = false;<br />
		angularVelocity = 0;<br />
		rotationAxis = Vector3.zero;<br />
	}<br />
<br />
	void Update ()<br />
	{	<br />
		// on mouse down<br />
		if( Input.GetMouseButton(0) ) <br />
		{<br />
			Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);<br />
			RaycastHit hit;<br />
			<br />
			// if the object was clicked<br />
			if( Physics.Raycast(ray, out hit) ) <br />
			{<br />
				if( !dragging )<br />
				{<br />
					// extract vDown from the RaycastHit<br />
					vDown = hit.point - transform.position;<br />
				<br />
					// start dragging<br />
					dragging = true;<br />
				}<br />
				else<br />
				{<br />
					// extract vDrag from the RaycastHit<br />
					vDrag = hit.point - transform.position;<br />
			<br />
					// compute the rotation axis and angular velocity from vDown and vDrag<br />
					rotationAxis = Vector3.Cross( vDown, vDrag );<br />
					angularVelocity = Vector3.Angle( vDown, vDrag ) * speed;<br />
				}<br />
			}<br />
			else<br />
				dragging = false;<br />
		}<br />
		<br />
		// on mouse up stop dragging<br />
		if( Input.GetMouseButtonUp(0) )<br />
			dragging = false;<br />
		<br />
		// apply the angular velocity<br />
		if( angularVelocity &gt; 0 )<br />
		{<br />
			transform.RotateAround( rotationAxis, angularVelocity * Time.deltaTime );<br />
			angularVelocity = ( angularVelocity &gt; 0.01f ) ? angularVelocity * damping : 0;<br />
		}<br />
	}<br />
}&lt;/csharp&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/14/arcball-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ArcBall &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/12/14/arcball-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/12/14/arcball-unify-wiki-2/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 11:48:17 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=ArcBall</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/csharp&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

[[Category: General Purpose Effect Scripts]]
[[Category: C Sharp]]
Author: [[User:Racocvr&#124;Vlad Chifor]]
== Description ==
Use this script to rotate an object i...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/csharp&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>[[Category: General Purpose Effect Scripts]]<br />
[[Category: C Sharp]]<br />
Author: [[User:Racocvr|Vlad Chifor]]<br />
== Description ==<br />
Use this script to rotate an object in an intuitive way. The mouse input is used to compute a rotation axis and an angular velocity. This idea is based on the ArcBall Rotation Control technique presented in the book Graphics Gems IV by Ken Shoemake.<br />
<br />
== Usage ==<br />
Attach this script and a sphere collider to the object. Adjust the sphere radius to your needs. Use the speed and damping variables to tweak the rotation speed.<br />
<br />
== C Sharp - ArcBall.cs ==<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;// Attach this script and a sphere collider to the object. Adjust the sphere radius to your needs. Use the speed and damping variables to tweak the rotation speed.<br />
//<br />
// Author: Vlad Chifor - racocvr@gmail.com<br />
<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
public class ArcBall : MonoBehaviour<br />
{<br />
	public float damping = 0.9f;<br />
	public float speed = 0.1f;<br />
	<br />
	private Vector3 vDown;<br />
	private Vector3 vDrag;<br />
	private bool dragging;<br />
	private float angularVelocity;<br />
	private Vector3 rotationAxis;<br />
	<br />
	void Start ()<br />
	{<br />
		dragging = false;<br />
		angularVelocity = 0;<br />
		rotationAxis = Vector3.zero;<br />
	}<br />
<br />
	void Update ()<br />
	{	<br />
		// on mouse down<br />
		if( Input.GetMouseButton(0) ) <br />
		{<br />
			Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);<br />
			RaycastHit hit;<br />
			<br />
			// if the object was clicked<br />
			if( Physics.Raycast(ray, out hit) ) <br />
			{<br />
				if( !dragging )<br />
				{<br />
					// extract vDown from the RaycastHit<br />
					vDown = hit.point - transform.position;<br />
				<br />
					// start dragging<br />
					dragging = true;<br />
				}<br />
				else<br />
				{<br />
					// extract vDrag from the RaycastHit<br />
					vDrag = hit.point - transform.position;<br />
			<br />
					// compute the rotation axis and angular velocity from vDown and vDrag<br />
					rotationAxis = Vector3.Cross( vDown, vDrag );<br />
					angularVelocity = Vector3.Angle( vDown, vDrag ) * speed;<br />
				}<br />
			}<br />
			else<br />
				dragging = false;<br />
		}<br />
		<br />
		// on mouse up stop dragging<br />
		if( Input.GetMouseButtonUp(0) )<br />
			dragging = false;<br />
		<br />
		// apply the angular velocity<br />
		if( angularVelocity &gt; 0 )<br />
		{<br />
			transform.RotateAround( rotationAxis, angularVelocity * Time.deltaTime );<br />
			angularVelocity = ( angularVelocity &gt; 0.01f ) ? angularVelocity * damping : 0;<br />
		}<br />
	}<br />
}&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/14/arcball-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Assets to bring detail &amp; fidelity to your game worlds &#124; Unity Technologies</title>
		<link>http://www.bydesigngames.com/2011/12/06/assets-to-bring-detail-fidelity-to-your-game-worlds-unity-technologies/</link>
		<comments>http://www.bydesigngames.com/2011/12/06/assets-to-bring-detail-fidelity-to-your-game-worlds-unity-technologies/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 21:07:15 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://blogs.unity3d.com/?p=6493</guid>
		<description><![CDATA[When creating compelling video game levels, the idiom &#8216;God is in the Details&#8217; couldn&#8217;t be more true. Detail in your world design is a sign of artistry and aptitude that motivates players to invest interest (and money!) in your game. Often we find that the lush and detailed worlds themselves are as much the star...]]></description>
			<content:encoded><![CDATA[<p>When creating compelling video game levels, the idiom &#8216;God is in the Details&#8217; couldn&#8217;t be more true.  Detail in your world design is a sign of artistry and aptitude that motivates players to invest interest (and money!) in your game.  Often we find that the lush and detailed worlds themselves are as much the star of the game as the player!  Outdoor settings, in particular, are really important to get right.  You&#8217;ll find mediocre foliage even in AAA games, foliage that reveals flaws when examined closely, like aliasing and alpha sorting glitches.  Since modelling nature well takes a special kind of eye, while at the same time is considered less mission-critical than core game assets, designers often re-use plants from previous games.  Generally these tend to be simple stem or trunk structures with transparent quads for leaves&#8211; but now there&#8217;s a more elegant solution.</p>
<p><strong><a rel="nofollow"  href="http://u3d.as/content/3d-attack/green-stash-mesh-plants/2up">Green Stash Mesh Plants</a></strong><br />
<img class="alignnone size-full wp-image-6499" title="greenstash" src="http://blogs.unity3d.com/wp-content/uploads/2011/12/greenstash.jpg" alt="" width="640" height="352"/></p>
<p>As graphic cards, game engines and mobile platform capabilities evolve, so must natural detail.   That&#8217;s why we&#8217;re especially thrilled about 3DAttack&#8217;s mesh plant package, <a rel="nofollow"  href="http://u3d.as/content/3d-attack/green-stash-mesh-plants/2up">Green Stash Mesh Plants</a>, now on the <a rel="nofollow"  href="http://unity3d.com/unity/asset-store/">Asset Store</a>.  With 3-4 level of detail meshes, the highest levels of detail are entirely mesh:  not a transparent texture on a quad among them.  While the lower poly LODs have conventional quad leaves, the highest versions are glorious mesh reproductions of existing species of appealing plant life.  With Green Stash, 3DAttack sets a new standard for years to come.</p>
<p><a rel="nofollow" title="Assets to bring detail &amp; fidelity to your game worlds"  href="http://api.cld.me/2D383g0i0G0A1k07083j">See for yourself!</a></p>
<p><strong><a rel="nofollow"  href="http://u3d.as/content/ziboo/geo-painter/2ux">GeoPainter</a></strong><br />
<img class="alignnone size-full wp-image-6500" title="geopainter" src="http://blogs.unity3d.com/wp-content/uploads/2011/12/geopainter.jpg" alt="" width="640" height="401"/><br />
If you&#8217;re working on a terrain with Unity Terrain&#8217;s detail mesh feature, it&#8217;s not at all difficult to quickly populate a terrain environment with Green Stash plants and other detail meshes. But imagine you are working on complex mesh surfaces too.. like huge mesh boulders, mesas, middle-earth style rooftops, roads, whatever&#8211; all which should have plant life, rocks, debris and other details atop them too!  What to do?  Hurry to the Asset Store, get your copy of <a rel="nofollow"  href="http://u3d.as/content/ziboo/geo-painter/2ux">GeoPainter</a>, and place game objects into your scene by simply painting them on!  Need to make a messy pile of bricks or logs on the floor?  Normally this kind of thing is surprisingly time consuming, but GeoPainter makes messes easy!  Instead of manually placing each piece one by one, use GeoPainter to instantiate and position them in your scene with a single brush stroke.  With built-in parameters for randomization, you can easily add chaos and irregularity for a more organic feel.   While you&#8217;re at it,  use GeoPainter to plant bunches and rows of great new Dexsoft <a rel="nofollow"  href="http://u3d.as/content/dexsoft-games/garden-vegetable-plants/2uG">vegetables</a> in your field or garden.  Just be sure to keep the <a rel="nofollow"  href="http://u3d.as/content/bsr/animals-raven/1CR">crows</a> and <a rel="nofollow"  href="http://u3d.as/content/atlas-studio/as-poisonous-skitterer/2uP">bugs</a> away!  One of <a rel="nofollow"  href="http://u3d.as/content/mixamo/the-mutant/2rX">these</a> should do the trick!</p>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/06/assets-to-bring-detail-fidelity-to-your-game-worlds-unity-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EnumExtensions &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/12/05/enumextensions-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/12/05/enumextensions-unify-wiki-2/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 09:27:48 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=EnumExtensions</guid>
		<description><![CDATA[Jmpp: Created page with &#34;Category: Extension Scripts Category: C Sharp  Author: Juan Manuel Palacios  ==Overview== This script provides an instance TryParse method for .Net's System...&#34;

[[Category: Extension Scripts]]
[[Category: C Sharp]]

...]]></description>
			<content:encoded><![CDATA[<p>Jmpp: Created page with &quot;Category: Extension Scripts Category: C Sharp  Author: Juan Manuel Palacios  ==Overview== This script provides an instance TryParse method for .Net's System...&quot;</p>
<hr />
<div>[[Category: Extension Scripts]]<br />
[[Category: C Sharp]]<br />
<br />
Author: [[User:Jmpp|Juan Manuel Palacios]]<br />
<br />
==Overview==<br />
This script provides an instance TryParse method for .Net's System.Enum class, analogous to the non-exception-throwing TryParse methods that other .Net built-in types provide. As opposed to those, though, this extension method is an instance method, due to the very nature of C# extension methods themselves.<br />
<br />
Note that .Net 4.0 does provide an out-of-the-box Enum.TryParse method, but that's currently not available to Unity users as of its 3.4.2 release.<br />
<br />
==Usage==<br />
Put the EnumExtensions.cs script in the Extensions folder in your Unity project and use the resulting instance TryParse method according to the code sample below.<br />
<br />
<br />
==Sample==<br />
&lt;csharp&gt;SomeEnum parsedState;<br />
if (parsedState.TryParse&lt;SomeEnum&gt;(aString, out parsedState))<br />
{<br />
    /* The parsed string matches an enum state, proceed successfully here. */<br />
}<br />
else<br />
{<br />
    /* The parsed  string does not match any enum state, handle failure here. */<br />
}<br />
&lt;/csharp&gt;<br />
<br />
==EnumExtensions.cs==<br />
&lt;csharp&gt;using UnityEngine;<br />
using System;<br />
using System.ComponentModel;<br />
<br />
<br />
public static class EnumExtensions<br />
{<br />
    <br />
    public static bool TryParse&lt;T&gt;(this Enum theEnum, string valueToParse, out T returnValue)<br />
    {<br />
        returnValue = default(T);    <br />
        if (Enum.IsDefined(typeof(T), valueToParse))<br />
        {<br />
            TypeConverter converter = TypeDescriptor.GetConverter(typeof(T));<br />
            returnValue = (T)converter.ConvertFromString(valueToParse);<br />
            return true;<br />
        }<br />
        return false;<br />
    }<br />
    <br />
    <br />
}<br />
&lt;/csharp&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/05/enumextensions-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EnumExtensions &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/12/05/enumextensions-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/12/05/enumextensions-unify-wiki/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 09:27:48 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=EnumExtensions</guid>
		<description><![CDATA[Jmpp: Created page with &#34;Category: Extension Scripts Category: C Sharp  Author: Juan Manuel Palacios  ==Overview== This script provides an instance TryParse method for .Net's System...&#34;

[[Category: Extension Scripts]]
[[Category: C Sharp]]

...]]></description>
			<content:encoded><![CDATA[<p>Jmpp: Created page with &quot;Category: Extension Scripts Category: C Sharp  Author: Juan Manuel Palacios  ==Overview== This script provides an instance TryParse method for .Net's System...&quot;</p>
<hr />
<div>[[Category: Extension Scripts]]<br />
[[Category: C Sharp]]<br />
<br />
Author: [[User:Jmpp|Juan Manuel Palacios]]<br />
<br />
==Overview==<br />
This script provides an instance TryParse method for .Net's System.Enum class, analogous to the non-exception-throwing TryParse methods that other .Net built-in types provide. As opposed to those, though, this extension method is an instance method, due to the very nature of C# extension methods themselves.<br />
<br />
Note that .Net 4.0 does provide an out-of-the-box Enum.TryParse method, but that's currently not available to Unity users as of its 3.4.2 release.<br />
<br />
==Usage==<br />
Put the EnumExtensions.cs script in the Extensions folder in your Unity project and use the resulting instance TryParse method according to the code sample below.<br />
<br />
<br />
==Sample==<br />
&lt;csharp&gt;SomeEnum parsedState;<br />
if (parsedState.TryParse&lt;SomeEnum&gt;(aString, out parsedState))<br />
{<br />
    /* The parsed string matches an enum state, proceed successfully here. */<br />
}<br />
else<br />
{<br />
    /* The parsed  string does not match any enum state, handle failure here. */<br />
}<br />
&lt;/csharp&gt;<br />
<br />
==EnumExtensions.cs==<br />
&lt;csharp&gt;using UnityEngine;<br />
using System;<br />
using System.ComponentModel;<br />
<br />
<br />
public static class EnumExtensions<br />
{<br />
    <br />
    public static bool TryParse&lt;T&gt;(this Enum theEnum, string valueToParse, out T returnValue)<br />
    {<br />
        returnValue = default(T);    <br />
        if (Enum.IsDefined(typeof(T), valueToParse))<br />
        {<br />
            TypeConverter converter = TypeDescriptor.GetConverter(typeof(T));<br />
            returnValue = (T)converter.ConvertFromString(valueToParse);<br />
            return true;<br />
        }<br />
        return false;<br />
    }<br />
    <br />
    <br />
}<br />
&lt;/csharp&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/05/enumextensions-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EnumExtensions &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/12/05/enumextensions-unify-wiki-3/</link>
		<comments>http://www.bydesigngames.com/2011/12/05/enumextensions-unify-wiki-3/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 09:27:48 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=EnumExtensions</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/csharp&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

[[Category: Extension Scripts]]
[[Category: C Sharp]]

Author: [[User:Jmpp&#124;Juan Manuel Palacios]]

==Overview==
This script provides an instance TryParse metho...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/csharp&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>[[Category: Extension Scripts]]<br />
[[Category: C Sharp]]<br />
<br />
Author: [[User:Jmpp|Juan Manuel Palacios]]<br />
<br />
==Overview==<br />
This script provides an instance TryParse method for .Net's System.Enum class, analogous to the non-exception-throwing TryParse methods that other .Net built-in types provide. As opposed to those, though, this extension method is an instance method, due to the very nature of C# extension methods themselves.<br />
<br />
Note that .Net 4.0 does provide an out-of-the-box Enum.TryParse method, but that's currently not available to Unity users as of its 3.4.2 release.<br />
<br />
==Usage==<br />
Put the EnumExtensions.cs script in the Extensions folder in your Unity project and use the resulting instance TryParse method according to the code sample below.<br />
<br />
<br />
==Sample==<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;SomeEnum parsedState;<br />
if (parsedState.TryParse&lt;SomeEnum&gt;(aString, out parsedState))<br />
{<br />
    /* The parsed string matches an enum state, proceed successfully here. */<br />
}<br />
else<br />
{<br />
    /* The parsed  string does not match any enum state, handle failure here. */<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
==EnumExtensions.cs==<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;using UnityEngine;<br />
using System;<br />
using System.ComponentModel;<br />
<br />
<br />
public static class EnumExtensions<br />
{<br />
    <br />
    public static bool TryParse&lt;T&gt;(this Enum theEnum, string valueToParse, out T returnValue)<br />
    {<br />
        returnValue = default(T);    <br />
        if (Enum.IsDefined(typeof(T), valueToParse))<br />
        {<br />
            TypeConverter converter = TypeDescriptor.GetConverter(typeof(T));<br />
            returnValue = (T)converter.ConvertFromString(valueToParse);<br />
            return true;<br />
        }<br />
        return false;<br />
    }<br />
    <br />
    <br />
}<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/05/enumextensions-unify-wiki-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alcohol withdrawal wiki &#8211; Tobacco And Alcohol Withdrawal Symptoms 34 &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/12/05/alcohol-withdrawal-wiki-tobacco-and-alcohol-withdrawal-symptoms-34-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/12/05/alcohol-withdrawal-wiki-tobacco-and-alcohol-withdrawal-symptoms-34-unify-wiki/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 03:36:24 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Alcohol_withdrawal_wiki_-_Tobacco_And_Alcohol_Withdrawal_Symptoms_34</guid>
		<description><![CDATA[DorianAvilavhi: Created page with &#34;Massaging  &#60;strong&#62; [http://www.thealcoholwithdrawalsymptoms.info alcohol recovery programs]&#60;/strong&#62; is very effective to recover excel of many of the home accessories, furnishi...&#34;

Massaging  ...]]></description>
			<content:encoded><![CDATA[<p>DorianAvilavhi: Created page with &quot;Massaging  &lt;strong&gt; [http://www.thealcoholwithdrawalsymptoms.info alcohol recovery programs]&lt;/strong&gt; is very effective to recover excel of many of the home accessories, furnishi...&quot;</p>
<hr />
<div>Massaging  &lt;strong&gt; [http://www.thealcoholwithdrawalsymptoms.info alcohol recovery programs]&lt;/strong&gt; is very effective to recover excel of many of the home accessories, furnishings and system. It might be highly effective in evading the aggravating fruit jigs at the same time. Let to one side these variables and benefits of chaffing  &lt;strong&gt;alcohol&lt;/strong&gt;, the purpose of discussion is, with all the chaffing  &lt;strong&gt;alcohol&lt;/strong&gt; utilizes, does chaffing  &lt;strong&gt;alcohol&lt;/strong&gt; do away with zits?<br />
<br />
Sometimes folks have a hereditary condition in which we have an alteration while in the ALDH enzyme known as polymorphism present in their health. This molecule brings about the ALDH enzyme to get inactive and then the digesting of  &lt;strong&gt; [http://i.pku.edu.cn/trac/zephy/ticket/41894 side effects of alcohol withdrawal]&lt;/strong&gt; becomes difficult, ultimately causing the varied  &lt;strong&gt;alcohol&lt;/strong&gt; hypersensitivity  &lt;strong&gt;symptoms&lt;/strong&gt;.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/05/alcohol-withdrawal-wiki-tobacco-and-alcohol-withdrawal-symptoms-34-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pivot point mover &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/12/01/pivot-point-mover-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/12/01/pivot-point-mover-unify-wiki/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 02:04:20 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Pivot_point_mover</guid>
		<description><![CDATA[NCarter: Reply to misplaced question

Is there a pivot point mover for UNITY3d?

Moray has it as a local button in the parameters panel. It makes drawing SO powerful.

: The wiki isn't a good place to ask questions.  You'd be better off going to the [h...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Reply to misplaced question</p>
<hr />
<div>Is there a pivot point mover for UNITY3d?<br />
<br />
Moray has it as a local button in the parameters panel. It makes drawing SO powerful.<br />
<br />
: The wiki isn't a good place to ask questions.  You'd be better off going to the [http://forum.unity3d.com/ forum] or [http://answers.unity3d.com/ Answers] instead. --[[User:NCarter|NCarter]] 13:38, 1 December 2011 (PST)</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/01/pivot-point-mover-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pivot point mover &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/12/01/pivot-point-mover-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/12/01/pivot-point-mover-unify-wiki-2/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 02:04:20 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=Pivot_point_mover</guid>
		<description><![CDATA[NCarter: Reply to misplaced question

Is there a pivot point mover for UNITY3d?

Moray has it as a local button in the parameters panel. It makes drawing SO powerful.

: The wiki isn't a good place to ask questions.  You'd be better off going to the [h...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Reply to misplaced question</p>
<hr />
<div>Is there a pivot point mover for UNITY3d?<br />
<br />
Moray has it as a local button in the parameters panel. It makes drawing SO powerful.<br />
<br />
: The wiki isn't a good place to ask questions.  You'd be better off going to the [http://forum.unity3d.com/ forum] or [http://answers.unity3d.com/ Answers] instead. --[[User:NCarter|NCarter]] 13:38, 1 December 2011 (PST)</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/12/01/pivot-point-mover-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why the Telomerase Anti-Aging Product Is Most Efficient &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/30/why-the-telomerase-anti-aging-product-is-most-efficient-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/30/why-the-telomerase-anti-aging-product-is-most-efficient-unify-wiki/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 05:20:54 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Why_the_Telomerase_Anti-Aging_Product_Is_Most_Efficient</guid>
		<description><![CDATA[JeffreyBMerwin9: Created page with &#34;What is telomere? In case you will look on Wikipedia, telomeres are the repeated region of DNA on chromosome ends. Their functionality is protection of cells and chromosomes from...&#34;

What is telomere? In c...]]></description>
			<content:encoded><![CDATA[<p>JeffreyBMerwin9: Created page with &quot;What is telomere? In case you will look on Wikipedia, telomeres are the repeated region of DNA on chromosome ends. Their functionality is protection of cells and chromosomes from...&quot;</p>
<hr />
<div>What is telomere? In case you will look on Wikipedia, telomeres are the repeated region of DNA on chromosome ends. Their functionality is protection of cells and chromosomes from harm and decline. The mechanism basically regulates the aging process. Every single DNA has it. That’s why you should be aware of the way telomere strength affects the vitality and also rigidness of your cells in the skin. If the cells are strong, they refrain from dividing in an unnatural manner and showing wrinkles. However, when time goes by, the cells will separate naturally and regenerate novel cells underneath them. At this point, the quantity of times they separate becomes limited. At some point, they will cease multiplying and dividing. This is the time that your skin becomes to be weakened. That’s where manufactured [http://www.antiagingexperiment.com telomerase] comes in.<br />
<br />
The key to maintenance of these chromosome strings is retaining your telomeres well-defined and robust. Wrinkle will appear once these are weakened. The symptoms of aging will become inescapable. With that said, your skin will look saggy and dull. Obviously, no one wants to have wrinkles.<br />
In caring for the skin, you must take notice of the tips below:<br />
<br />
1. Care for your DNA levels. An average commercialized anti-aging cream can only good for short-term treatment. Frankly, this isn’t sufficient. If you are with limited funds, it might be tough to obtain the results that you desire. You should be ready to overspend a bit in the name of looking young. Renovage anti-aging creams might be of fantastic help. This is a trademark component that’s known to help strike DNA levels directly, especially in promotion of growth and activity. <br />
<br />
2. Exfoliate. With this, low-cost exfoliating products will give you all you require. When skin is exfoliated, the top cell layer is removed. That is made up of weakened, dry, and dead skin cells. This makes additional space for re-generation. The new and fresh skin cells beneath are revealed. It is suggested once per week. <br />
<br />
3. Always bear in mind to put on the sunblock. You’ve most likely heard this one tons of times. Even it’s winter, the sun still shines and emits UV rays. This could have permanent effects on the skin. Extreme damage from sun exposure may cut short your telomeres’ life span considerably. As mentioned previously, this could provide you with poor skin for life.<br />
<br />
Of course, if you know how to deal with the damages it might cause you; you can take care of cell telomeres. Not a lot of individuals are very keen regarding the details of how aging works and why telomeres even exist. If you understand how telomeres are taken care of, you are on the right path to fight the signs of aging. Anti-aging treatment is not necessarily the myth or overpriced therapy it once used to be. Progression in technology and sensible economies of scale have now made the telomerase [http://www.antiagingexperiment.com/ anti-aging medicine] something that each and every average individual can use and take advantage of. http://www.curebum.com/reneuve-telomerase-enzyme/</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/30/why-the-telomerase-anti-aging-product-is-most-efficient-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Anti-Aging Products Along With Healthy Tips For The Skin &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/30/anti-aging-products-along-with-healthy-tips-for-the-skin-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/30/anti-aging-products-along-with-healthy-tips-for-the-skin-unify-wiki/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 04:55:16 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Anti-Aging_Products_Along_With_Healthy_Tips_For_The_Skin</guid>
		<description><![CDATA[JeffreyBMerwin9: Created page with &#34;To start with, let's determine the actual meaning of ‘telomere.’ According to recent Wikipedia entries, telomeres are the recurring region of DNA on chromosome ends. Their fu...&#34;

To start with, let's d...]]></description>
			<content:encoded><![CDATA[<p>JeffreyBMerwin9: Created page with &quot;To start with, let's determine the actual meaning of ‘telomere.’ According to recent Wikipedia entries, telomeres are the recurring region of DNA on chromosome ends. Their fu...&quot;</p>
<hr />
<div>To start with, let's determine the actual meaning of ‘telomere.’ According to recent Wikipedia entries, telomeres are the recurring region of DNA on chromosome ends. Their functionality is protection of cells and chromosomes from harm and deterioration. The mechanism essentially handles the aging process. It exists in just about every human’s DNA. That’s why you should know about the way telomere strength impacts the vitality and also rigidness of your cells in the skin. The appearance of facial lines and wrinkles can be decreased when you have stronger cells. Having said that, when time passes, the cells will separate naturally and replenish novel cells underneath them. At this point, the quantity of times they break down becomes limited. At some point, they will quit spreading and dividing. Then, your skin is helpless. Just the perfect time to look for [http://www.antiagingexperiment.com telomerase].<br />
<br />
Chromosome strings preservation would aid keep telomeres stronger. Wrinkle can appear once these are damaged. The signs of aging becomes inevitable. Having said that, your skin will look saggy and dull. No one on this planet purposefully wants a face full of wrinkles!<br />
As a way for best safety of your last line in protection, it’s crucial that you take heed of these useful guidelines for skin care:<br />
<br />
1. Proper care for your DNA levels. A typical commercialized anti-aging cream can only good for short-term treatment. These can only create false claims. If you are on a budget, it may be difficult to obtain the results that you wish. Paying a little more could be beneficial to acheive the youthful glow that you always wished for. Look Renovage anti-aging creams. A great product that is confirmed to have a direct impact on DNA levels to stimulate its activity and growth. <br />
<br />
2. Exfoliate. You don't need to invest a lot because cost-effective products can provide beneficial results. If skin is exfoliated, the top cell layer is removed. That includes damaged, dry, and dead skin cells. Thus, regeneration starts. Great looking and healthy cells can appear. Attempt doing it at least once every week. <br />
<br />
3. Always bear in mind to put on the sunblock. I understand you’ve learned about this approach once or twice now. Even it’s winter, the sun also shines and produces UV rays. And yes, it may enormously affect the skin. The telomere’s lifespan can be decreased due to intense sun exposure. As mentioned previously, this could provide you with harmful skin for life.<br />
<br />
Of course, if you know how to cope with the damages it may cause you; you can take good care of cell telomeres. Only a few folks know about the existence of telomeres and how getting older occurs. However, knowledge is crucial. Knowing how to preserve the telomeres through these simple methods will keep you miles on top of others as far as the skin care competition is involved. Anti-aging medication is not anymore the myth or expensive therapy it once used to be. Introducing [http://www.curebum.com/reneuve-telomerase-enzyme/ anti-aging supplement] that anyone can take benefit from. http://www.curebum.com/reneuve-telomerase-enzyme/</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/30/anti-aging-products-along-with-healthy-tips-for-the-skin-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Help Guide To Selecting A Good ADSL Service &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/30/help-guide-to-selecting-a-good-adsl-service-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/30/help-guide-to-selecting-a-good-adsl-service-unify-wiki/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 03:27:30 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Help_Guide_To_Selecting_A_Good_ADSL_Service</guid>
		<description><![CDATA[AlmaLAlvarado10: Created page with &#34;The usage of internet use continues to be rising day by day. Web has changed into a necessity and you simply can't consider not being connected to the internet any longer. Some o...&#34;

The usage of internet ...]]></description>
			<content:encoded><![CDATA[<p>AlmaLAlvarado10: Created page with &quot;The usage of internet use continues to be rising day by day. Web has changed into a necessity and you simply can't consider not being connected to the internet any longer. Some o...&quot;</p>
<hr />
<div>The usage of internet use continues to be rising day by day. Web has changed into a necessity and you simply can't consider not being connected to the internet any longer. Some of the services that online users start using these days is the ADSL service. ADSL refers to asymmetric digital subscriber line. With this particular technology, you can use your phone in addition to internet concurrently, as opposed to the earlier dial-up connections making it possible to use either the telephone or perhaps the internet. You'll need only a modem for ADSL service. It's one of many speediest and convenient to use online connections in the present day. <br />
<br />
Together with the demand for ADSL improving each day, an extremely aggressive environment among the many internet suppliers has been produced. ISP with a very qualified price and in addition there are a variety of offers on ADSL that you can find by different carrier's networks. Consequently, it's important that you just try several offers and make use of [http://www.adsl-comparativa.com/ comparativa adsl] so you can get the best deal. <br />
<br />
For evaluating adsl services, you need to keep a number of things in your mind. Here are some tips on what you'll want to consider and assess among various adsl services. The vital thing is definitely the longevity of the service. It will be the very first thing that you must take into account while comparing adsl services. A good adsl service provider assures that an uptime of 100%. Service that has more outages won't be a great service, specifically if you are utilizing the link in a commercial business. <br />
<br />
Additionally, while comparative adsl services, you need to bear in mind the speed of the connection. It is an area which usually distinguishes a fantastic issuer from an unsatisfactory one. The rate of the adsl is scheduled in terms of mbps. It's a way of measuring in terms of time consumed in sending and receiving data. You have to be watchful while comparative adsl speed. Many service providers claim a really good speed, but usually you just get to operated with a speed much minimal as opposed to promised speed. You must test the lines as well as the connection, whenever possible before arriving at a completion in this connection. <br />
<br />
Next is to compare adsl services rates. You will find usually many [http://www.adsl-comparativa.com/comparativa-adsl adsl ofertas] the companies offer. Typically, to contest with the competitor company, the service providers develop packages that adsl services at inexpensive rates. These internet offers can make you have a wonderful deal for you internet. <br />
<br />
The last and also a really important thing that you have to take into account is the customer support which the service providers offer. It is very important in comparartive adsl services. An effective customer care is needed, as there is a predisposition of the adsl services being down or you dealing with a technical trouble with your connection. It is important that you receive an effective and hassle free service.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/30/help-guide-to-selecting-a-good-adsl-service-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Pick An ADSL Service? &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/30/how-to-pick-an-adsl-service-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/30/how-to-pick-an-adsl-service-unify-wiki/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 02:59:07 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=How_To_Pick_An_ADSL_Service%3F</guid>
		<description><![CDATA[AlmaLAlvarado10: Created page with &#34;The usage of internet use continues to be escalating daily. World wide web has turned into a need also, you can't think of not being attached to the web nowadays. Some of the ser...&#34;

The usage of internet ...]]></description>
			<content:encoded><![CDATA[<p>AlmaLAlvarado10: Created page with &quot;The usage of internet use continues to be escalating daily. World wide web has turned into a need also, you can't think of not being attached to the web nowadays. Some of the ser...&quot;</p>
<hr />
<div>The usage of internet use continues to be escalating daily. World wide web has turned into a need also, you can't think of not being attached to the web nowadays. Some of the services that online users utilize these days may be the ADSL service. ADSL means asymmetric digital subscriber line. With this particular technological innovation, you can use your phone as well as internet concurrently, unlike the earlier dial up connections making it possible to use either the cell phone or even the internet. You need only a modem for ADSL service. It really is among the speediest and convenient to use internet connections nowadays. <br />
<br />
With all the requirement for ADSL growing each day, a very aggressive environment amongst the internet suppliers has been produced. Internet service provider with a very competent price and also there are a variety of offers on ADSL that you can find by different carriers. Hence, it is necessary that you simply check out several offers and use [http://www.adsl-comparativa.com/ comparativa adsl] so you can get the best offer. <br />
<br />
For contrasting adsl services, you have to keep several things in mind. Below are great tips of what you have to consider and assess among various adsl services. The first thing will be the toughness for the service. It's the most important factor that you need to take into account while comparing adsl services. A fantastic adsl service provider assures that an uptime of 100 per cent. Service containing more down time are not a perfect service, especially if you are using the connection in a commercial business. <br />
<br />
Additionally, while comparative adsl services, you have to take into account the velocity of the connection. This is one sector that separates an excellent service provider from a bad one. The speed of the adsl is scheduled in terms of mbps. It is a measurement in terms of time ingested in sending and receiving data. You should be mindful while comparative adsl speed. Many service providers claim a very good speed, but actually you simply get to run on a speed much inferior than the offered speed. You ought to test the lines along with the connection, if possible before arriving at a graduation in connection with this. <br />
<br />
Another is to assess adsl services rates. You'll find usually many [http://www.adsl-comparativa.com/comparativa-adsl adsl ofertas] that the companies offer. Generally, to contest with the competitor company, the service providers put together packages that adsl services at really cheap rates. These internet offers will make you have a really good package for you internet. <br />
<br />
The last and a very important thing that you must take into account is the customer care that your service providers offer. It is vital in comparartive adsl services. An effective customer support is essential, as there is a disposition of the adsl services being down or you going through a technical issue with your connection. It is important that you receive an easy and straight forward service.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/30/how-to-pick-an-adsl-service-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Sure Your Wedding Invitation Has Got The Right Terminology and wording &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/30/making-sure-your-wedding-invitation-has-got-the-right-terminology-and-wording-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/30/making-sure-your-wedding-invitation-has-got-the-right-terminology-and-wording-unify-wiki/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 00:28:06 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Making_Sure_Your_Wedding_Invitation_Has_Got_The_Right_Terminology_and_wording</guid>
		<description><![CDATA[Steamyshiner: *Marking as spam* Don't know if this is helpful :)

[[Category:Spam]]

== &#092;/Spam&#092;/ ==

 &#60;s&#62;''The wedding months tends to bring a bunch of entertainment. Even though a wedding can be an exciting function, it has also got its...]]></description>
			<content:encoded><![CDATA[<p>Steamyshiner: *Marking as spam* Don't know if this is helpful :)</p>
<hr />
<div>[[Category:Spam]]<br />
<br />
== &#92;/Spam&#92;/ ==<br />
<br />
 &lt;s&gt;''The wedding months tends to bring a bunch of entertainment. Even though a wedding can be an exciting function, it has also got its’ challenging times. These days must be managed accordingly or else it can be very demanding and can spoil the entertainment of the event. Among the significant responsibilities in preparing a wedding would be the designing of envelopes along with their addressing. These are generally among the vital aspects of the wedding preparing process and therefore are frequently termed as wedding invitations etiquettes. There are various [http://www.983wedding.com/etiquette/wedding-invitation-wording-samples Wedding Invitation Wording] which you can relate to on the internet. <br />
<br />
One significant factor here would be to take care of the envelopes when you get rid of some other work. In some cases addressing the envelopes becomes the very last concern because of lack of moment or possibly a long set of other important information. Several wedding couples finish the job of addressing the envelopes nearly a month before the wedding ceremony. This can be a sensible effort and may decrease lots of stress which is evolved when the wedding approaches around. <br />
<br />
It is usually important to adhere to the methods of [http://www.983wedding.com/etiquette/ Wedding Invitations Etiquette] to be able to develop a very good impression. Another way of reaching effectiveness is always to keep two envelopes for the invitations. The true secret here would be to make the outer envelop have the specifics of the person who must be contacted and the inner one should have the cards that you want to send. The inner cover must also have details about the guests that you plan to invite to your wedding ceremony. It shouldn't always have the address of the receiver.<br />
<br />
Writing the envelopes is not always always easy specifically when the pressure from other task begins to raise. Among the primary elements of the wedding invitations etiquette would be to target various individuality. For example a divorced female invitee should be addressed as Miss or Ms., in the same way like we address an unmarried lady.<br />
 These are several essential factors that must be covered with a present mind since if by accident you address a separated lady by Mrs., then it might be an offensive word and this is the factor which you don't want to happen. Furthermore, a young boy is referenced as ‘Master’ and a grown up as ‘Mr.’ To help keep these factors in mind is quite vital as they make a lasting impression on the vision of the guests. <br />
<br />
You can even add the names of those people who can go along with your guests like friends, family members, relatives and colleagues. Youngsters could even be contained in the guests list. It is typically implemented to offer a proper regard to youngsters who then feel happy to become part of the family. <br />
Another essential point to take into consideration for the wedding invitations etiquette would be to be sure that you mention the names on the envelopes distinctly and to not utilize abbreviations or nicknames since it won't make uncertainty but it will also make a poor impact.<br />
'' &lt;/s&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/30/making-sure-your-wedding-invitation-has-got-the-right-terminology-and-wording-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customary And Trendy Style Asian Wedding Invites &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/30/customary-and-trendy-style-asian-wedding-invites-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/30/customary-and-trendy-style-asian-wedding-invites-unify-wiki/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 00:01:54 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Customary_And_Trendy_Style_Asian_Wedding_Invites</guid>
		<description><![CDATA[MarlanaPCrabtree9: Created page with &#34;Asia can be described as a territory sheltering various ethnicities, each of which is abundant with its customs. To set an Asian theme in your wedding signifies that you'll have ...&#34;

Asia can be describe...]]></description>
			<content:encoded><![CDATA[<p>MarlanaPCrabtree9: Created page with &quot;Asia can be described as a territory sheltering various ethnicities, each of which is abundant with its customs. To set an Asian theme in your wedding signifies that you'll have ...&quot;</p>
<hr />
<div>Asia can be described as a territory sheltering various ethnicities, each of which is abundant with its customs. To set an Asian theme in your wedding signifies that you'll have a range of colorful and cheerful options to choose from. Be it Oriental or Indian you could turn your big day into an elegant, classic and traditional occasion which you as well as your attendees will remember.<br />
<br />
Planning a wedding usually means you must prepare a lot of things at the same time. When you have elected your concept, the other points follows. To obtain a flawless wedding you may want every thing including the gown, tunes, cake, decorations, cuisine, Invitation cards and place holders in accordance with the design. <br />
<br />
There are various suggestions for [http://www.983wedding.com/showroom/asian-wedding-invitations/ Asian Wedding Invitations] and whether you need to make them made or create them by hand you could allow your ingenuity go wild. That is the fun if you are creating Asian wedding invitations. You could have lots of space to become inventive and experiment with colors and concepts. <br />
<br />
Below are a few ideas you can use while planning your Asian wedding invitations. Whenever you picture Asia, you might think of China and whenever you think of China, a lot of things get to your mind. If you don't do other things and just make use of a Chinese font in the middle of your greeting card saying for example “you are invited” then handwrite or print the other invite, your card will appear splendidly asian. <br />
<br />
Bear in mind, colors carry out an essential part. Beige or possibly a cream color card that has a cherry blossom in it will have a smartly trendy look. You can be imaginative and style the card in a way that it has two flaps which unwrap in the middle. The cherry blossoms are printed out on the upper flaps and when the attendees open these flaps they could read through your wedding invitation. <br />
<br />
Bamboos can also be the theme on your card. And this can also grant you plenty of space to play around when doing decorations and making place cards. A classy bamboo drawn against a single cream card may certainly seem exotic. The selection of the font will make a lot of difference as well.<br />
<br />
If you need something entirely and thoroughly timeless, one thing you would like your wedding guests to recollect for a long time, go for the scroll. A stylish piece of parchment in a hot color folded and attached with a lace of your choice. As soon as the attendees open it up they can read the invite in vibrant golden font. <br />
<br />
An ecru single card with a happiness mark as a concept could be low-cost yet stylish and may encompass the actual Asian spirit. Also, you can astonish your invited guests by simply placing silk red rose flower petals in your wedding invitation. <br />
<br />
If you have a small number of people to invite you can even customize the fortune cookie to a wedding cookie. Your guests will likely be pleasantly surprised to receive a cookie holding your wedding invitation. In case you still would like to take a look at more ideas you could find [http://www.983wedding.com/showroom/free-wedding-invitation-templates/ Free Wedding Invitation Templates] easily on the net.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/30/customary-and-trendy-style-asian-wedding-invites-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MeshCreationGrid &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/29/meshcreationgrid-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/29/meshcreationgrid-unify-wiki/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 06:34:53 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=MeshCreationGrid</guid>
		<description><![CDATA[Jdsmith2816: 

The below script generates a mesh for use in a tile based game.  In order to utilize it simply attach it t a gameobject, populate the public variables, and hit play.  You should be greeted with a grid of the size you chose with randomly ...]]></description>
			<content:encoded><![CDATA[<p>Jdsmith2816: </p>
<hr />
<div>The below script generates a mesh for use in a tile based game.  In order to utilize it simply attach it t a gameobject, populate the public variables, and hit play.  You should be greeted with a grid of the size you chose with randomly changing tiles.<br />
<br />
Make sure that under the properties of your Texture you have FilterMode: Point and WrapMode: Clamp otherwise you will see artifacts as you move the map around. Also ensure that your texture is Power of 2 height and width..  256x256, 512x512,  512x256, 1024x512 etc..<br />
<br />
In order for this to actually be useful you will need to write the logic that calls UpdateGrid() elsewhere in your code to render your level.. And obviously turn off the code in Update() that randomly sets tiles. :)<br />
<br />
There is a unitypackage attached to the forum thread linked here[http://forum.unity3d.com/threads/115892-VERY-basic-script-for-creating-a-2d-tile-grid];  it shows an example modification of the code below to load a simple level file from resource and draw it to the grid.<br />
<br />
<br />
&lt;javascript&gt;<br />
using System.Collections.Generic;<br />
using UnityEngine;<br />
<br />
[RequireComponent(typeof(MeshFilter))]<br />
[RequireComponent(typeof(MeshRenderer))]<br />
public class CreateMesh : MonoBehaviour<br />
{<br />
    public int TileWidth = 16;<br />
    public int TileHeight = 16;<br />
    public int NumTilesX = 16;<br />
    public int NumTilesY = 16;<br />
    public int TileGridWidth = 100;<br />
    public int TileGridHeight = 100;<br />
    public int DefaultTileX;<br />
    public int DefaultTileY;<br />
    public Texture2D Texture;<br />
<br />
    void OnEnable()<br />
    {<br />
        CreatePlane(TileWidth, TileHeight, TileGridWidth, TileGridHeight);<br />
    }<br />
<br />
    void Update()<br />
    {<br />
        var tileColumn = Random.Range(0, NumTilesX);<br />
        var tileRow = Random.Range(0, NumTilesY);<br />
<br />
        var x = Random.Range(0, TileGridWidth);<br />
        var y = Random.Range(0, TileGridHeight);<br />
<br />
        UpdateGrid(new Vector2(x, y), new Vector2(tileColumn, tileRow), TileWidth, TileHeight, TileGridWidth);<br />
    }<br />
<br />
    public void UpdateGrid(Vector2 gridIndex, Vector2 tileIndex, int tileWidth, int tileHeight, int gridWidth)<br />
    {<br />
        var mesh = GetComponent&lt;MeshFilter&gt;().mesh;<br />
        var uvs = mesh.uv;<br />
<br />
        var tileSizeX = 1.0f / NumTilesX;<br />
        var tileSizeY = 1.0f / NumTilesY;<br />
<br />
        mesh.uv = uvs;<br />
<br />
        uvs[(int)(gridWidth * gridIndex.x + gridIndex.y) * 4 + 0] = new Vector2(tileIndex.x * tileSizeX, tileIndex.y * tileSizeY);<br />
        uvs[(int)(gridWidth * gridIndex.x + gridIndex.y) * 4 + 1] = new Vector2((tileIndex.x + 1) * tileSizeX, tileIndex.y * tileSizeY);<br />
        uvs[(int)(gridWidth * gridIndex.x + gridIndex.y) * 4 + 2] = new Vector2((tileIndex.x + 1) * tileSizeX, (tileIndex.y + 1) * tileSizeY);<br />
        uvs[(int)(gridWidth * gridIndex.x + gridIndex.y) * 4 + 3] = new Vector2(tileIndex.x * tileSizeX, (tileIndex.y + 1) * tileSizeY);<br />
<br />
        mesh.uv = uvs;<br />
    }<br />
<br />
    void CreatePlane(int tileHeight, int tileWidth, int gridHeight, int gridWidth)<br />
    {<br />
        var mesh = new Mesh();<br />
        var mf = GetComponent&lt;MeshFilter&gt;();<br />
        mf.renderer.material.SetTexture(&quot;_MainTex&quot;, Texture);<br />
        mf.mesh = mesh;<br />
<br />
        var tileSizeX = 1.0f / NumTilesX;<br />
        var tileSizeY = 1.0f / NumTilesY;<br />
<br />
        var vertices = new List&lt;Vector3&gt;();<br />
        var triangles = new List&lt;int&gt;();<br />
        var normals = new List&lt;Vector3&gt;();<br />
        var uvs = new List&lt;Vector2&gt;();<br />
<br />
        var index = 0;<br />
        for (var x = 0; x &lt; gridWidth; x++) {<br />
            for (var y = 0; y &lt; gridHeight; y++) {<br />
                AddVertices(tileHeight, tileWidth, y, x, vertices);<br />
                index = AddTriangles(index, triangles);<br />
                AddNormals(normals);<br />
                AddUvs(DefaultTileX, tileSizeY, tileSizeX, uvs, DefaultTileY);<br />
            }<br />
        }<br />
<br />
        mesh.vertices = vertices.ToArray();<br />
        mesh.normals = normals.ToArray();<br />
        mesh.triangles = triangles.ToArray();<br />
        mesh.uv = uvs.ToArray();<br />
        mesh.RecalculateNormals();<br />
    }<br />
<br />
    private static void AddVertices(int tileHeight, int tileWidth, int y, int x, ICollection&lt;Vector3&gt; vertices)<br />
    {<br />
        vertices.Add(new Vector3((x * tileWidth), (y * tileHeight), 0));<br />
        vertices.Add(new Vector3((x * tileWidth) + tileWidth, (y * tileHeight), 0));<br />
        vertices.Add(new Vector3((x * tileWidth) + tileWidth, (y * tileHeight) + tileHeight, 0));<br />
        vertices.Add(new Vector3((x * tileWidth), (y * tileHeight) + tileHeight, 0));<br />
    }<br />
<br />
    private static int AddTriangles(int index, ICollection&lt;int&gt; triangles)<br />
    {<br />
        triangles.Add(index + 2);<br />
        triangles.Add(index + 1);<br />
        triangles.Add(index);<br />
        triangles.Add(index);<br />
        triangles.Add(index + 3);<br />
        triangles.Add(index + 2);<br />
        index += 4;<br />
        return index;<br />
    }<br />
<br />
    private static void AddNormals(ICollection&lt;Vector3&gt; normals)<br />
    {<br />
        normals.Add(Vector3.forward);<br />
        normals.Add(Vector3.forward);<br />
        normals.Add(Vector3.forward);<br />
        normals.Add(Vector3.forward);<br />
    }<br />
<br />
    private static void AddUvs(int tileRow, float tileSizeY, float tileSizeX, ICollection&lt;Vector2&gt; uvs, int tileColumn)<br />
    {<br />
        uvs.Add(new Vector2(tileColumn * tileSizeX, tileRow * tileSizeY));<br />
        uvs.Add(new Vector2((tileColumn + 1) * tileSizeX, tileRow * tileSizeY));<br />
        uvs.Add(new Vector2((tileColumn + 1) * tileSizeX, (tileRow + 1) * tileSizeY));<br />
        uvs.Add(new Vector2(tileColumn * tileSizeX, (tileRow + 1) * tileSizeY));<br />
    }<br />
}<br />
&lt;/javascript&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/29/meshcreationgrid-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MeshCreationGrid &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/29/meshcreationgrid-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/29/meshcreationgrid-unify-wiki-2/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 06:34:53 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=MeshCreationGrid</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/javascript&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

The below script generates a mesh for use in a tile based game.  In order to utilize it simply attach it t a gameobject, populate the public variables, and...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/javascript&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>The below script generates a mesh for use in a tile based game.  In order to utilize it simply attach it t a gameobject, populate the public variables, and hit play.  You should be greeted with a grid of the size you chose with randomly changing tiles.<br />
<br />
Make sure that under the properties of your Texture you have FilterMode: Point and WrapMode: Clamp otherwise you will see artifacts as you move the map around. Also ensure that your texture is Power of 2 height and width..  256x256, 512x512,  512x256, 1024x512 etc..<br />
<br />
In order for this to actually be useful you will need to write the logic that calls UpdateGrid() elsewhere in your code to render your level.. And obviously turn off the code in Update() that randomly sets tiles. :)<br />
<br />
There is a unitypackage attached to the forum thread linked here[http://forum.unity3d.com/threads/115892-VERY-basic-script-for-creating-a-2d-tile-grid];  it shows an example modification of the code below to load a simple level file from resource and draw it to the grid.<br />
<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
using System.Collections.Generic;<br />
using UnityEngine;<br />
<br />
[RequireComponent(typeof(MeshFilter))]<br />
[RequireComponent(typeof(MeshRenderer))]<br />
public class CreateMesh : MonoBehaviour<br />
{<br />
    public int TileWidth = 16;<br />
    public int TileHeight = 16;<br />
    public int NumTilesX = 16;<br />
    public int NumTilesY = 16;<br />
    public int TileGridWidth = 100;<br />
    public int TileGridHeight = 100;<br />
    public int DefaultTileX;<br />
    public int DefaultTileY;<br />
    public Texture2D Texture;<br />
<br />
    void OnEnable()<br />
    {<br />
        CreatePlane(TileWidth, TileHeight, TileGridWidth, TileGridHeight);<br />
    }<br />
<br />
    void Update()<br />
    {<br />
        var tileColumn = Random.Range(0, NumTilesX);<br />
        var tileRow = Random.Range(0, NumTilesY);<br />
<br />
        var x = Random.Range(0, TileGridWidth);<br />
        var y = Random.Range(0, TileGridHeight);<br />
<br />
        UpdateGrid(new Vector2(x, y), new Vector2(tileColumn, tileRow), TileWidth, TileHeight, TileGridWidth);<br />
    }<br />
<br />
    public void UpdateGrid(Vector2 gridIndex, Vector2 tileIndex, int tileWidth, int tileHeight, int gridWidth)<br />
    {<br />
        var mesh = GetComponent&lt;MeshFilter&gt;().mesh;<br />
        var uvs = mesh.uv;<br />
<br />
        var tileSizeX = 1.0f / NumTilesX;<br />
        var tileSizeY = 1.0f / NumTilesY;<br />
<br />
        mesh.uv = uvs;<br />
<br />
        uvs[(int)(gridWidth * gridIndex.x + gridIndex.y) * 4 + 0] = new Vector2(tileIndex.x * tileSizeX, tileIndex.y * tileSizeY);<br />
        uvs[(int)(gridWidth * gridIndex.x + gridIndex.y) * 4 + 1] = new Vector2((tileIndex.x + 1) * tileSizeX, tileIndex.y * tileSizeY);<br />
        uvs[(int)(gridWidth * gridIndex.x + gridIndex.y) * 4 + 2] = new Vector2((tileIndex.x + 1) * tileSizeX, (tileIndex.y + 1) * tileSizeY);<br />
        uvs[(int)(gridWidth * gridIndex.x + gridIndex.y) * 4 + 3] = new Vector2(tileIndex.x * tileSizeX, (tileIndex.y + 1) * tileSizeY);<br />
<br />
        mesh.uv = uvs;<br />
    }<br />
<br />
    void CreatePlane(int tileHeight, int tileWidth, int gridHeight, int gridWidth)<br />
    {<br />
        var mesh = new Mesh();<br />
        var mf = GetComponent&lt;MeshFilter&gt;();<br />
        mf.renderer.material.SetTexture(&quot;_MainTex&quot;, Texture);<br />
        mf.mesh = mesh;<br />
<br />
        var tileSizeX = 1.0f / NumTilesX;<br />
        var tileSizeY = 1.0f / NumTilesY;<br />
<br />
        var vertices = new List&lt;Vector3&gt;();<br />
        var triangles = new List&lt;int&gt;();<br />
        var normals = new List&lt;Vector3&gt;();<br />
        var uvs = new List&lt;Vector2&gt;();<br />
<br />
        var index = 0;<br />
        for (var x = 0; x &lt; gridWidth; x++) {<br />
            for (var y = 0; y &lt; gridHeight; y++) {<br />
                AddVertices(tileHeight, tileWidth, y, x, vertices);<br />
                index = AddTriangles(index, triangles);<br />
                AddNormals(normals);<br />
                AddUvs(DefaultTileX, tileSizeY, tileSizeX, uvs, DefaultTileY);<br />
            }<br />
        }<br />
<br />
        mesh.vertices = vertices.ToArray();<br />
        mesh.normals = normals.ToArray();<br />
        mesh.triangles = triangles.ToArray();<br />
        mesh.uv = uvs.ToArray();<br />
        mesh.RecalculateNormals();<br />
    }<br />
<br />
    private static void AddVertices(int tileHeight, int tileWidth, int y, int x, ICollection&lt;Vector3&gt; vertices)<br />
    {<br />
        vertices.Add(new Vector3((x * tileWidth), (y * tileHeight), 0));<br />
        vertices.Add(new Vector3((x * tileWidth) + tileWidth, (y * tileHeight), 0));<br />
        vertices.Add(new Vector3((x * tileWidth) + tileWidth, (y * tileHeight) + tileHeight, 0));<br />
        vertices.Add(new Vector3((x * tileWidth), (y * tileHeight) + tileHeight, 0));<br />
    }<br />
<br />
    private static int AddTriangles(int index, ICollection&lt;int&gt; triangles)<br />
    {<br />
        triangles.Add(index + 2);<br />
        triangles.Add(index + 1);<br />
        triangles.Add(index);<br />
        triangles.Add(index);<br />
        triangles.Add(index + 3);<br />
        triangles.Add(index + 2);<br />
        index += 4;<br />
        return index;<br />
    }<br />
<br />
    private static void AddNormals(ICollection&lt;Vector3&gt; normals)<br />
    {<br />
        normals.Add(Vector3.forward);<br />
        normals.Add(Vector3.forward);<br />
        normals.Add(Vector3.forward);<br />
        normals.Add(Vector3.forward);<br />
    }<br />
<br />
    private static void AddUvs(int tileRow, float tileSizeY, float tileSizeX, ICollection&lt;Vector2&gt; uvs, int tileColumn)<br />
    {<br />
        uvs.Add(new Vector2(tileColumn * tileSizeX, tileRow * tileSizeY));<br />
        uvs.Add(new Vector2((tileColumn + 1) * tileSizeX, tileRow * tileSizeY));<br />
        uvs.Add(new Vector2((tileColumn + 1) * tileSizeX, (tileRow + 1) * tileSizeY));<br />
        uvs.Add(new Vector2(tileColumn * tileSizeX, (tileRow + 1) * tileSizeY));<br />
    }<br />
}<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/29/meshcreationgrid-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EditorUndoManager &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/27/editorundomanager-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/27/editorundomanager-unify-wiki/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 17:42:35 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=EditorUndoManager</guid>
		<description><![CDATA[Izitmee: /* C# Example - Window with multiple sources */

[[Category: C Sharp]]
[[Category: Editor]]
[[Category: Editor Scripts]]
[[Category: Utility]]
[[Category: Class]]
[[Category: Undo]]
Author: Daniele Giardini (Holoville)
==Description==
This cla...]]></description>
			<content:encoded><![CDATA[<p>Izitmee: /* C# Example - Window with multiple sources */</p>
<hr />
<div>[[Category: C Sharp]]<br />
[[Category: Editor]]<br />
[[Category: Editor Scripts]]<br />
[[Category: Utility]]<br />
[[Category: Class]]<br />
[[Category: Undo]]<br />
Author: Daniele Giardini (Holoville)<br />
==Description==<br />
This class allows to manage undo/redo inside any Unity Inspector or Window in an effortless and functional way. It stores undo snapshots only when they're needed (taking into account also TAB field changes and sliders), so that using Unity's undo/redo system correctly undoes/redoes the effective changes that took place.<br />
<br />
Works also with windows who manage multiple sources (see examples).<br />
<br />
==Usage==<br />
This is an Editor class, thus you have to place it inside an '''Editor folder''', then:<br />
* Inside your Inspector/Window class, create a HOEditorUndoManager variable.<br />
* Instantiate HOEditorUndoManager inside the OnEnable method.<br />
* Inside OnGUI/OnInspectorGUI, call [undoManagerInstance].CheckUndo() BEFORE the first UnityGUI code.<br />
* Inside OnGUI/OnInspectorGUI, call [undoManagerInstance].CheckDirty() AFTER all the UnityGUI code.<br />
<br />
==C# - HOEditorUndoManager.cs==<br />
&lt;csharp&gt;// Created by Daniele Giardini - 2011 - Holoville - http://www.holoville.com<br />
<br />
using UnityEditor;<br />
using UnityEngine;<br />
<br />
/// &lt;summary&gt;<br />
/// Undo manager.<br />
/// To use it:<br />
/// &lt;list type=&quot;number&quot;&gt;<br />
/// &lt;item&gt;<br />
/// &lt;description&gt;Store an instance in the related Editor Class (instantiate it inside the &lt;code&gt;OnEnable&lt;/code&gt; method).&lt;/description&gt;<br />
/// &lt;/item&gt;<br />
/// &lt;item&gt;<br />
/// &lt;description&gt;Call &lt;code&gt;undoManagerInstance.CheckUndo()&lt;/code&gt; BEFORE the first UnityGUI call in &lt;code&gt;OnInspectorGUI&lt;/code&gt;.&lt;/description&gt;<br />
/// &lt;/item&gt;<br />
/// &lt;item&gt;<br />
/// &lt;description&gt;Call &lt;code&gt;undoManagerInstance.CheckDirty()&lt;/code&gt; AFTER the last UnityGUI call in &lt;code&gt;OnInspectorGUI&lt;/code&gt;.&lt;/description&gt;<br />
/// &lt;/item&gt;<br />
/// &lt;/list&gt;<br />
/// &lt;/summary&gt;<br />
public class HOEditorUndoManager<br />
{<br />
	// VARS ///////////////////////////////////////////////////<br />
<br />
	private		Object				defTarget;<br />
	private		string				defName;<br />
	private		bool				autoSetDirty;<br />
	private		bool				listeningForGuiChanges;<br />
	<br />
<br />
	// ***********************************************************************************<br />
	// CONSTRUCTOR<br />
	// ***********************************************************************************<br />
<br />
	/// &lt;summary&gt;<br />
	/// Creates a new HOEditorUndoManager,<br />
	/// setting it so that the target is marked as dirty each time a new undo is stored. <br />
	/// &lt;/summary&gt;<br />
	/// &lt;param name=&quot;p_target&quot;&gt;<br />
	/// The default &lt;see cref=&quot;Object&quot;/&gt; you want to save undo info for.<br />
	/// &lt;/param&gt;<br />
	/// &lt;param name=&quot;p_name&quot;&gt;<br />
	/// The default name of the thing to undo (displayed as &quot;Undo [name]&quot; in the main menu).<br />
	/// &lt;/param&gt;<br />
	public HOEditorUndoManager( Object p_target, string p_name ) : this( p_target, p_name, true ) {}<br />
	/// &lt;summary&gt;<br />
	/// Creates a new HOEditorUndoManager. <br />
	/// &lt;/summary&gt;<br />
	/// &lt;param name=&quot;p_target&quot;&gt;<br />
	/// The default &lt;see cref=&quot;Object&quot;/&gt; you want to save undo info for.<br />
	/// &lt;/param&gt;<br />
	/// &lt;param name=&quot;p_name&quot;&gt;<br />
	/// The default name of the thing to undo (displayed as &quot;Undo [name]&quot; in the main menu).<br />
	/// &lt;/param&gt;<br />
	/// &lt;param name=&quot;p_autoSetDirty&quot;&gt;<br />
	/// If TRUE, marks the target as dirty each time a new undo is stored.<br />
	/// &lt;/param&gt;<br />
	public HOEditorUndoManager( Object p_target, string p_name, bool p_autoSetDirty )<br />
	{<br />
		defTarget = p_target;<br />
		defName = p_name;<br />
		autoSetDirty = p_autoSetDirty;<br />
	}<br />
<br />
	// ===================================================================================<br />
	// METHODS ---------------------------------------------------------------------------<br />
	<br />
	/// &lt;summary&gt;<br />
	/// Call this method BEFORE any undoable UnityGUI call.<br />
	/// Manages undo for the default target, with the default name.<br />
	/// &lt;/summary&gt;<br />
	public void CheckUndo() { CheckUndo( defTarget, defName ); }<br />
	/// &lt;summary&gt;<br />
	/// Call this method BEFORE any undoable UnityGUI call.<br />
	/// Manages undo for the given target, with the default name.<br />
	/// &lt;/summary&gt;<br />
	/// &lt;param name=&quot;p_target&quot;&gt;<br />
	/// The &lt;see cref=&quot;Object&quot;/&gt; you want to save undo info for.<br />
	/// &lt;/param&gt;<br />
	public void CheckUndo( Object p_target ) { CheckUndo( p_target, defName ); }<br />
	/// &lt;summary&gt;<br />
	/// Call this method BEFORE any undoable UnityGUI call.<br />
	/// Manages undo for the given target, with the given name.<br />
	/// &lt;/summary&gt;<br />
	/// &lt;param name=&quot;p_target&quot;&gt;<br />
	/// The &lt;see cref=&quot;Object&quot;/&gt; you want to save undo info for.<br />
	/// &lt;/param&gt;<br />
	/// &lt;param name=&quot;p_name&quot;&gt;<br />
	/// The name of the thing to undo (displayed as &quot;Undo [name]&quot; in the main menu).<br />
	/// &lt;/param&gt;<br />
	public void CheckUndo( Object p_target, string p_name )<br />
	{<br />
		Event e = Event.current;<br />
		<br />
		if ( ( e.type == EventType.MouseDown &amp;&amp; e.button == 0 ) || ( e.type == EventType.KeyUp &amp;&amp; e.keyCode == KeyCode.Tab ) ) {<br />
			// When the LMB is pressed or the TAB key is released,<br />
			// store a snapshot, but don't register it as an undo<br />
			// (so that if nothing changes we avoid storing a useless undo).<br />
			Undo.SetSnapshotTarget( p_target, p_name );<br />
			Undo.CreateSnapshot();<br />
			Undo.ClearSnapshotTarget(); // Not sure if this is necessary.<br />
			listeningForGuiChanges = true;<br />
		}<br />
	}<br />
	<br />
	/// &lt;summary&gt;<br />
	/// Call this method AFTER any undoable UnityGUI call.<br />
	/// Manages undo for the default target, with the default name.<br />
	/// &lt;/summary&gt;<br />
	public void CheckDirty() { CheckDirty( defTarget, defName ); }<br />
	/// &lt;summary&gt;<br />
	/// Call this method AFTER any undoable UnityGUI call.<br />
	/// Manages undo for the given target, with the default name.<br />
	/// &lt;/summary&gt;<br />
	/// &lt;param name=&quot;p_target&quot;&gt;<br />
	/// The &lt;see cref=&quot;Object&quot;/&gt; you want to save undo info for.<br />
	/// &lt;/param&gt;<br />
	public void CheckDirty( Object p_target ) { CheckDirty( p_target, defName ); }<br />
	/// &lt;summary&gt;<br />
	/// Call this method AFTER any undoable UnityGUI call.<br />
	/// Manages undo for the given target, with the given name.<br />
	/// &lt;/summary&gt;<br />
	/// &lt;param name=&quot;p_target&quot;&gt;<br />
	/// The &lt;see cref=&quot;Object&quot;/&gt; you want to save undo info for.<br />
	/// &lt;/param&gt;<br />
	/// &lt;param name=&quot;p_name&quot;&gt;<br />
	/// The name of the thing to undo (displayed as &quot;Undo [name]&quot; in the main menu).<br />
	/// &lt;/param&gt;<br />
	public void CheckDirty( Object p_target, string p_name )<br />
	{<br />
		if ( listeningForGuiChanges &amp;&amp; GUI.changed ) {<br />
			// Some GUI value changed after pressing the mouse<br />
			// or releasing the TAB key.<br />
			// Register the previous snapshot as a valid undo.<br />
			Undo.SetSnapshotTarget( p_target, p_name );<br />
			Undo.RegisterSnapshot();<br />
			Undo.ClearSnapshotTarget(); // Not sure if this is necessary.<br />
			if ( autoSetDirty )		EditorUtility.SetDirty( p_target );<br />
			listeningForGuiChanges = false;<br />
		}<br />
	}<br />
}<br />
&lt;/csharp&gt;<br />
<br />
==C# Example - Inspector with single source==<br />
How to use HOEditorUndoManager with a single source Inspector.<br />
<br />
&lt;csharp&gt;using UnityEditor;<br />
<br />
[CustomEditor( typeof( SampleClass) )]<br />
<br />
public class HOSampleClassInspector: Editor<br />
{<br />
	// VARS ///////////////////////////////////////////////////<br />
	<br />
	private		SampleClass			src;<br />
	private		HOEditorUndoManager		undoManager;<br />
	<br />
	// ===================================================================================<br />
	// UNITY METHODS ---------------------------------------------------------------------<br />
	<br />
	private void OnEnable()<br />
	{<br />
		src = target as SampleClass;<br />
		<br />
		// Instantiate undoManager<br />
		undoManager = new HOEditorUndoManager( src, &quot;SampleName&quot; );<br />
	}<br />
	<br />
	override public void OnInspectorGUI()<br />
	{<br />
		undoManager.CheckUndo(); // Check undo BEFORE GUI code.<br />
		<br />
		src.sampleProperty1 = EditorGUILayout.TextField( &quot;Text&quot;, src.sampleProperty1 );<br />
		src.sampleProperty2 = EditorGUILayout.TextField( &quot;Text&quot;, src.sampleProperty2 );<br />
		src.sampleProperty3 = EditorGUILayout.TextField( &quot;Text&quot;, src.sampleProperty3 );<br />
		<br />
		undoManager.CheckDirty(); // Check dirty  AFTER all GUI code.<br />
	}<br />
}<br />
&lt;/csharp&gt;<br />
<br />
==C# Example - Window with multiple sources==<br />
How to use HOEditorUndoManager with a single window that controls two different objects/sources.<br />
<br />
&lt;csharp&gt;using UnityEditor;<br />
<br />
public class HOSampleWindow: EditorWindow<br />
{<br />
	[MenuItem( &quot;Sample Window&quot; )]<br />
	static void ShowWindow()<br />
	{<br />
		EditorWindow.GetWindow( typeof( HOSampleWindow ), false, &quot;Sample Window&quot; );<br />
	}<br />
	<br />
	// VARS ///////////////////////////////////////////////////<br />
	<br />
	private		SampleClass1			src1;<br />
	private		SampleClass2			src2;<br />
	private		HOEditorUndoManager		undoManager;<br />
	<br />
	// ===================================================================================<br />
	// UNITY METHODS ---------------------------------------------------------------------<br />
	<br />
	private void OnEnable()<br />
	{<br />
		src1 = AssetDatabase.LoadAssetAtPath( Assets/Resources/SampleObj1.prefab, typeof( SampleClass1 ) ) as SampleClass1;<br />
		src2 = AssetDatabase.LoadAssetAtPath( Assets/Resources/SampleObj2.prefab, typeof( SampleClass2 ) ) as SampleClass2;<br />
		<br />
		// Instantiate undoManager (setting the default source and the default name that will appear in the undo menu for all undos related to this window)<br />
		undoManager = new HOEditorUndoManager( src1, &quot;SampleName&quot; );<br />
	}<br />
	<br />
	override public void OnGUI()<br />
	{<br />
		// GUI code related to each source must be separated,<br />
		// so that we can encapsulate it within each CheckUndo and CheckDirty.<br />
		<br />
		// src1 undo management and GUI.<br />
		// No need to specify CheckUndo and CheckDirty target here because we have set it as default during instantiation.<br />
		undoManager.CheckUndo(); // Check undo for default source BEFORE its GUI code.<br />
		src1.sampleProperty1 = EditorGUILayout.TextField( &quot;Text&quot;, src1.sampleProperty1 );<br />
		src1.sampleProperty2 = EditorGUILayout.TextField( &quot;Text&quot;, src1.sampleProperty2 );<br />
		src1.sampleProperty3 = EditorGUILayout.TextField( &quot;Text&quot;, src1.sampleProperty3 );<br />
		undoManager.CheckDirty(); // Check dirty for default source AFTER all its GUI code.<br />
		<br />
		// src2 undo management and GUI.<br />
		undoManager.CheckUndo( src2 ); // Check undo for other source BEFORE its GUI code.<br />
		src2.sampleProperty1 = EditorGUILayout.TextField( &quot;Text&quot;, src2.sampleProperty1 );<br />
		src2.sampleProperty2 = EditorGUILayout.TextField( &quot;Text&quot;, src2.sampleProperty2 );<br />
		src2.sampleProperty3 = EditorGUILayout.TextField( &quot;Text&quot;, src2.sampleProperty3 );<br />
		undoManager.CheckDirty( src2 ); // Check dirty for other source AFTER all its GUI code.<br />
	}<br />
}<br />
&lt;/csharp&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/27/editorundomanager-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EditorUndoManager &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/27/editorundomanager-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/27/editorundomanager-unify-wiki-2/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 17:42:35 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=EditorUndoManager</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/csharp&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

[[Category: C Sharp]]
[[Category: Editor]]
[[Category: Editor Scripts]]
[[Category: Utility]]
[[Category: Class]]
[[Category: Undo]]
Author: Daniele Giardini (...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/csharp&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>[[Category: C Sharp]]<br />
[[Category: Editor]]<br />
[[Category: Editor Scripts]]<br />
[[Category: Utility]]<br />
[[Category: Class]]<br />
[[Category: Undo]]<br />
Author: Daniele Giardini (Holoville)<br />
==Description==<br />
This class allows to manage undo/redo inside any Unity Inspector or Window in an effortless and functional way. It stores undo snapshots only when they're needed (taking into account also TAB field changes and sliders), so that using Unity's undo/redo system correctly undoes/redoes the effective changes that took place.<br />
<br />
Works also with windows who manage multiple sources (see examples).<br />
<br />
==Usage==<br />
This is an Editor class, thus you have to place it inside an '''Editor folder''', then:<br />
* Inside your Inspector/Window class, create a HOEditorUndoManager variable.<br />
* Instantiate HOEditorUndoManager inside the OnEnable method.<br />
* Inside OnGUI/OnInspectorGUI, call [undoManagerInstance].CheckUndo() BEFORE the first UnityGUI code.<br />
* Inside OnGUI/OnInspectorGUI, call [undoManagerInstance].CheckDirty() AFTER all the UnityGUI code.<br />
<br />
==C# - HOEditorUndoManager.cs==<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;// Created by Daniele Giardini - 2011 - Holoville - http://www.holoville.com<br />
<br />
using UnityEditor;<br />
using UnityEngine;<br />
<br />
/// &lt;summary&gt;<br />
/// Undo manager.<br />
/// To use it:<br />
/// &lt;list type=&quot;number&quot;&gt;<br />
/// &lt;item&gt;<br />
/// &lt;description&gt;Store an instance in the related Editor Class (instantiate it inside the &lt;code&gt;OnEnable&lt;/code&gt; method).&lt;/description&gt;<br />
/// &lt;/item&gt;<br />
/// &lt;item&gt;<br />
/// &lt;description&gt;Call &lt;code&gt;undoManagerInstance.CheckUndo()&lt;/code&gt; BEFORE the first UnityGUI call in &lt;code&gt;OnInspectorGUI&lt;/code&gt;.&lt;/description&gt;<br />
/// &lt;/item&gt;<br />
/// &lt;item&gt;<br />
/// &lt;description&gt;Call &lt;code&gt;undoManagerInstance.CheckDirty()&lt;/code&gt; AFTER the last UnityGUI call in &lt;code&gt;OnInspectorGUI&lt;/code&gt;.&lt;/description&gt;<br />
/// &lt;/item&gt;<br />
/// &lt;/list&gt;<br />
/// &lt;/summary&gt;<br />
public class HOEditorUndoManager<br />
{<br />
	// VARS ///////////////////////////////////////////////////<br />
<br />
	private		Object				defTarget;<br />
	private		string				defName;<br />
	private		bool				autoSetDirty;<br />
	private		bool				listeningForGuiChanges;<br />
	<br />
<br />
	// ***********************************************************************************<br />
	// CONSTRUCTOR<br />
	// ***********************************************************************************<br />
<br />
	/// &lt;summary&gt;<br />
	/// Creates a new HOEditorUndoManager,<br />
	/// setting it so that the target is marked as dirty each time a new undo is stored. <br />
	/// &lt;/summary&gt;<br />
	/// &lt;param name=&quot;p_target&quot;&gt;<br />
	/// The default &lt;see cref=&quot;Object&quot;/&gt; you want to save undo info for.<br />
	/// &lt;/param&gt;<br />
	/// &lt;param name=&quot;p_name&quot;&gt;<br />
	/// The default name of the thing to undo (displayed as &quot;Undo [name]&quot; in the main menu).<br />
	/// &lt;/param&gt;<br />
	public HOEditorUndoManager( Object p_target, string p_name ) : this( p_target, p_name, true ) {}<br />
	/// &lt;summary&gt;<br />
	/// Creates a new HOEditorUndoManager. <br />
	/// &lt;/summary&gt;<br />
	/// &lt;param name=&quot;p_target&quot;&gt;<br />
	/// The default &lt;see cref=&quot;Object&quot;/&gt; you want to save undo info for.<br />
	/// &lt;/param&gt;<br />
	/// &lt;param name=&quot;p_name&quot;&gt;<br />
	/// The default name of the thing to undo (displayed as &quot;Undo [name]&quot; in the main menu).<br />
	/// &lt;/param&gt;<br />
	/// &lt;param name=&quot;p_autoSetDirty&quot;&gt;<br />
	/// If TRUE, marks the target as dirty each time a new undo is stored.<br />
	/// &lt;/param&gt;<br />
	public HOEditorUndoManager( Object p_target, string p_name, bool p_autoSetDirty )<br />
	{<br />
		defTarget = p_target;<br />
		defName = p_name;<br />
		autoSetDirty = p_autoSetDirty;<br />
	}<br />
<br />
	// ===================================================================================<br />
	// METHODS ---------------------------------------------------------------------------<br />
	<br />
	/// &lt;summary&gt;<br />
	/// Call this method BEFORE any undoable UnityGUI call.<br />
	/// Manages undo for the default target, with the default name.<br />
	/// &lt;/summary&gt;<br />
	public void CheckUndo() { CheckUndo( defTarget, defName ); }<br />
	/// &lt;summary&gt;<br />
	/// Call this method BEFORE any undoable UnityGUI call.<br />
	/// Manages undo for the given target, with the default name.<br />
	/// &lt;/summary&gt;<br />
	/// &lt;param name=&quot;p_target&quot;&gt;<br />
	/// The &lt;see cref=&quot;Object&quot;/&gt; you want to save undo info for.<br />
	/// &lt;/param&gt;<br />
	public void CheckUndo( Object p_target ) { CheckUndo( p_target, defName ); }<br />
	/// &lt;summary&gt;<br />
	/// Call this method BEFORE any undoable UnityGUI call.<br />
	/// Manages undo for the given target, with the given name.<br />
	/// &lt;/summary&gt;<br />
	/// &lt;param name=&quot;p_target&quot;&gt;<br />
	/// The &lt;see cref=&quot;Object&quot;/&gt; you want to save undo info for.<br />
	/// &lt;/param&gt;<br />
	/// &lt;param name=&quot;p_name&quot;&gt;<br />
	/// The name of the thing to undo (displayed as &quot;Undo [name]&quot; in the main menu).<br />
	/// &lt;/param&gt;<br />
	public void CheckUndo( Object p_target, string p_name )<br />
	{<br />
		Event e = Event.current;<br />
		<br />
		if ( ( e.type == EventType.MouseDown &amp;&amp; e.button == 0 ) || ( e.type == EventType.KeyUp &amp;&amp; e.keyCode == KeyCode.Tab ) ) {<br />
			// When the LMB is pressed or the TAB key is released,<br />
			// store a snapshot, but don't register it as an undo<br />
			// (so that if nothing changes we avoid storing a useless undo).<br />
			Undo.SetSnapshotTarget( p_target, p_name );<br />
			Undo.CreateSnapshot();<br />
			Undo.ClearSnapshotTarget(); // Not sure if this is necessary.<br />
			listeningForGuiChanges = true;<br />
		}<br />
	}<br />
	<br />
	/// &lt;summary&gt;<br />
	/// Call this method AFTER any undoable UnityGUI call.<br />
	/// Manages undo for the default target, with the default name.<br />
	/// &lt;/summary&gt;<br />
	public void CheckDirty() { CheckDirty( defTarget, defName ); }<br />
	/// &lt;summary&gt;<br />
	/// Call this method AFTER any undoable UnityGUI call.<br />
	/// Manages undo for the given target, with the default name.<br />
	/// &lt;/summary&gt;<br />
	/// &lt;param name=&quot;p_target&quot;&gt;<br />
	/// The &lt;see cref=&quot;Object&quot;/&gt; you want to save undo info for.<br />
	/// &lt;/param&gt;<br />
	public void CheckDirty( Object p_target ) { CheckDirty( p_target, defName ); }<br />
	/// &lt;summary&gt;<br />
	/// Call this method AFTER any undoable UnityGUI call.<br />
	/// Manages undo for the given target, with the given name.<br />
	/// &lt;/summary&gt;<br />
	/// &lt;param name=&quot;p_target&quot;&gt;<br />
	/// The &lt;see cref=&quot;Object&quot;/&gt; you want to save undo info for.<br />
	/// &lt;/param&gt;<br />
	/// &lt;param name=&quot;p_name&quot;&gt;<br />
	/// The name of the thing to undo (displayed as &quot;Undo [name]&quot; in the main menu).<br />
	/// &lt;/param&gt;<br />
	public void CheckDirty( Object p_target, string p_name )<br />
	{<br />
		if ( listeningForGuiChanges &amp;&amp; GUI.changed ) {<br />
			// Some GUI value changed after pressing the mouse<br />
			// or releasing the TAB key.<br />
			// Register the previous snapshot as a valid undo.<br />
			Undo.SetSnapshotTarget( p_target, p_name );<br />
			Undo.RegisterSnapshot();<br />
			Undo.ClearSnapshotTarget(); // Not sure if this is necessary.<br />
			if ( autoSetDirty )		EditorUtility.SetDirty( p_target );<br />
			listeningForGuiChanges = false;<br />
		}<br />
	}<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
==C# Example - Inspector with single source==<br />
How to use HOEditorUndoManager with a single source Inspector.<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;using UnityEditor;<br />
<br />
[CustomEditor( typeof( SampleClass) )]<br />
<br />
public class HOSampleClassInspector: Editor<br />
{<br />
	// VARS ///////////////////////////////////////////////////<br />
	<br />
	private		SampleClass			src;<br />
	private		HOEditorUndoManager		undoManager;<br />
	<br />
	// ===================================================================================<br />
	// UNITY METHODS ---------------------------------------------------------------------<br />
	<br />
	private void OnEnable()<br />
	{<br />
		src = target as SampleClass;<br />
		<br />
		// Instantiate undoManager<br />
		undoManager = new HOEditorUndoManager( src, &quot;SampleName&quot; );<br />
	}<br />
	<br />
	override public void OnInspectorGUI()<br />
	{<br />
		undoManager.CheckUndo(); // Check undo BEFORE GUI code.<br />
		<br />
		src.sampleProperty1 = EditorGUILayout.TextField( &quot;Text&quot;, src.sampleProperty1 );<br />
		src.sampleProperty2 = EditorGUILayout.TextField( &quot;Text&quot;, src.sampleProperty2 );<br />
		src.sampleProperty3 = EditorGUILayout.TextField( &quot;Text&quot;, src.sampleProperty3 );<br />
		<br />
		undoManager.CheckDirty(); // Check dirty  AFTER all GUI code.<br />
	}<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
==C# Example - Window with multiple sources==<br />
How to use HOEditorUndoManager with a single window that controls two different objects/sources.<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;using UnityEditor;<br />
<br />
public class HOSampleWindow: EditorWindow<br />
{<br />
	[MenuItem( &quot;Sample Window&quot; )]<br />
	static void ShowWindow()<br />
	{<br />
		EditorWindow.GetWindow( typeof( HOSampleWindow ), false, &quot;Sample Window&quot; );<br />
	}<br />
	<br />
	// VARS ///////////////////////////////////////////////////<br />
	<br />
	private		SampleClass1			src1;<br />
	private		SampleClass2			src2;<br />
	private		HOEditorUndoManager		undoManager;<br />
	<br />
	// ===================================================================================<br />
	// UNITY METHODS ---------------------------------------------------------------------<br />
	<br />
	private void OnEnable()<br />
	{<br />
		src1 = AssetDatabase.LoadAssetAtPath( Assets/Resources/SampleObj1.prefab, typeof( SampleClass1 ) ) as SampleClass1;<br />
		src2 = AssetDatabase.LoadAssetAtPath( Assets/Resources/SampleObj2.prefab, typeof( SampleClass2 ) ) as SampleClass2;<br />
		<br />
		// Instantiate undoManager (setting the default source and the default name that will appear in the undo menu for all undos related to this window)<br />
		undoManager = new HOEditorUndoManager( src1, &quot;SampleName&quot; );<br />
	}<br />
	<br />
	override public void OnGUI()<br />
	{<br />
		// GUI code related to each source must be separated,<br />
		// so that we can encapsulate it within each CheckUndo and CheckDirty.<br />
		<br />
		// src1 undo management and GUI.<br />
		// No need to specify CheckUndo and CheckDirty target here because we have set it as default during instantiation.<br />
		undoManager.CheckUndo(); // Check undo for default source BEFORE its GUI code.<br />
		src1.sampleProperty1 = EditorGUILayout.TextField( &quot;Text&quot;, src1.sampleProperty1 );<br />
		src1.sampleProperty2 = EditorGUILayout.TextField( &quot;Text&quot;, src1.sampleProperty2 );<br />
		src1.sampleProperty3 = EditorGUILayout.TextField( &quot;Text&quot;, src1.sampleProperty3 );<br />
		undoManager.CheckDirty(); // Check dirty for default source AFTER all its GUI code.<br />
		<br />
		// src2 undo management and GUI.<br />
		undoManager.CheckUndo( src2 ); // Check undo for other source BEFORE its GUI code.<br />
		src2.sampleProperty1 = EditorGUILayout.TextField( &quot;Text&quot;, src2.sampleProperty1 );<br />
		src2.sampleProperty2 = EditorGUILayout.TextField( &quot;Text&quot;, src2.sampleProperty2 );<br />
		src2.sampleProperty3 = EditorGUILayout.TextField( &quot;Text&quot;, src2.sampleProperty3 );<br />
		undoManager.CheckDirty( src2 ); // Check dirty for other source AFTER all its GUI code.<br />
	}<br />
}<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/27/editorundomanager-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Partake in Backgammon Internet &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/27/partake-in-backgammon-internet-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/27/partake-in-backgammon-internet-unify-wiki/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 12:47:47 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Partake_in_Backgammon_Internet</guid>
		<description><![CDATA[NgocOlsenw: Created page with &#34;The heritage of backgammon, [http://www.avatargame.org Avatar Games] the older known game, is a unique one that will began nearly 5, 000 issue in Mesopotamia. [http://narutogames...&#34;

The heritage of backgammon,...]]></description>
			<content:encoded><![CDATA[<p>NgocOlsenw: Created page with &quot;The heritage of backgammon, [http://www.avatargame.org Avatar Games] the older known game, is a unique one that will began nearly 5, 000 issue in Mesopotamia. [http://narutogames...&quot;</p>
<hr />
<div>The heritage of backgammon, [http://www.avatargame.org Avatar Games] the older known game, is a unique one that will began nearly 5, 000 issue in Mesopotamia. [http://narutogames.grou.ps/wiki/item/about-great-manga-naruto Naruto] Numerous variations within the game had been adopted simply by other cultures through the history for backgammon. Archaeologists pursue to discover numerous similar games while in the ruins regarding ancient civilizations as they quite simply explore your intriguing record of backgammon.<br />
<br />
The authentic name intended for backgammon derives from a Welsh time period meaning wee struggle. Having said that, the heritage of backgammon reflects a lot of names and also versions. The aristocracy in addition to slave populace of Egypt as well as Greece played an equivalent game named, senat. The actual Romans changed the sheer numbers of dice from 2-3 and known as it bac gamen or perhaps back activity. Within the Roman the world, backgammon migrated to Persia, where it turned out again used two dice inside of a game named Takhteh Nard&quot; or simply &quot;Battle for Wood. &quot; Before the Crusades, the Anglo Saxon military and investors played just another version referred to as Tables and also Tabula. <br />
<br />
Throughout a brief history of backgammon, the School attempted many times to ban the overall game, but often failed. Cardinal Woolsey, in the actual 16th 100 years, ordered every one of the boards burned up, calling the overall game the devils folly. Burning up the panels was unproductive, however, since just about any board could possibly be drawn throughout dirt or even sand and tinkered with small gravel. Dice ended up often hand made and were definitely small enough being easily concealed with a person or maybe hidden inside someones dwelling. Furthermore, the Language were really clever and thought to disguise any backgammon board like a folding ebook. Their impressive craftsmanship holds evident during the board we all use these days.<br />
<br />
Edmund Hoyle, the prominent writer along with gamesman, documented the guidelines and a brief history of backgammon inside the mid 1700s. Colonists via England helped bring backgammon on their homes for many, along along with chess and also other board games of your times. Although the experience of backgammon shed some popularity during the Victorian times, it swiftly reappeared and also gained strength while in the 20th a single. At these times, an unidentified inventor made the doubling dice, which delivers players the chance to increase in numbers their preliminary wager by way of the amount within the doubling dice. Of system, some program and experience should be used before while using doubling dice.<br />
<br />
Tournaments, books, magazines, and clubs are actually section of the heritage of these [http://en.netlog.com/arcadeangel/blog/ Addicting Games]. The introduction of your game over the internet has greater its level of popularity to a much better [http://www.avatargame.org Avatar Games]. Backgammon is actually a fast-paced, challenging, and fun game involving skill along with luck.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/27/partake-in-backgammon-internet-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MakeQuad &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/24/makequad-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/24/makequad-unify-wiki/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 23:05:28 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=MakeQuad</guid>
		<description><![CDATA[Tenebrous: Created page with &#34;== Description == This is a simple function that creates a quad mesh for you (with two triangles), and sets up the vertices, UVs and triangles appropriately.  It returns a Mesh o...&#34;

== Description ==
This is a ...]]></description>
			<content:encoded><![CDATA[<p>Tenebrous: Created page with &quot;== Description == This is a simple function that creates a quad mesh for you (with two triangles), and sets up the vertices, UVs and triangles appropriately.  It returns a Mesh o...&quot;</p>
<hr />
<div>== Description ==<br />
This is a simple function that creates a quad mesh for you (with two triangles), and sets up the vertices, UVs and triangles appropriately.  It returns a Mesh object.<br />
<br />
== Usage ==<br />
<br />
&lt;csharp&gt;<br />
Mesh myQuad = MeshUtils.MakeQuad( 0, 0, 10, 10 );<br />
&lt;/csharp&gt;<br />
<br />
== Code ==<br />
<br />
=== CSharp - MakeQuad.cs ===<br />
<br />
&lt;csharp&gt;<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
public class MeshUtils<br />
{<br />
    public static Mesh MakeQuad( float originX, float originZ, float sizeX, float sizeZ )<br />
    {<br />
        Mesh newMesh = new Mesh();<br />
<br />
        Vector3[] vertices = new Vector3[]<br />
        {<br />
            new Vector3( originX,         0, originZ ),<br />
            new Vector3( originX + sizeX, 0, originZ ),<br />
            new Vector3( originX + sizeX, 0, originZ + sizeZ ),<br />
            new Vector3( originX,         0, originZ + sizeZ )<br />
        };<br />
<br />
        int[] triangles = new int[]<br />
        {<br />
            2, 1, 0,<br />
            0, 3, 2<br />
        };<br />
<br />
        Vector2[] uvs = new Vector2[]<br />
        {<br />
            new Vector2( 0, 0 ),<br />
            new Vector2( 1, 0 ),<br />
            new Vector2( 1, 1 ),<br />
            new Vector2( 0, 1 )<br />
        };<br />
<br />
        newMesh.vertices = vertices;<br />
        newMesh.triangles = triangles;<br />
        newMesh.uv = uvs;<br />
<br />
        return ( newMesh );<br />
    }<br />
}<br />
&lt;/csharp&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/24/makequad-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MakeQuad &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/24/makequad-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/24/makequad-unify-wiki-2/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 23:05:28 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=MakeQuad</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/csharp&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

== Description ==
This is a simple function that creates a quad mesh for you (with two triangles), and sets up the vertices, UVs and triangles appropriately.  ...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/csharp&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>== Description ==<br />
This is a simple function that creates a quad mesh for you (with two triangles), and sets up the vertices, UVs and triangles appropriately.  It returns a Mesh object.<br />
<br />
== Usage ==<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
Mesh myQuad = MeshUtils.MakeQuad( 0, 0, 10, 10 );<br />
&lt;/syntaxhighlight&gt;<br />
<br />
== Code ==<br />
<br />
=== CSharp - MakeQuad.cs ===<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
public class MeshUtils<br />
{<br />
    public static Mesh MakeQuad( float originX, float originZ, float sizeX, float sizeZ )<br />
    {<br />
        Mesh newMesh = new Mesh();<br />
<br />
        Vector3[] vertices = new Vector3[]<br />
        {<br />
            new Vector3( originX,         0, originZ ),<br />
            new Vector3( originX + sizeX, 0, originZ ),<br />
            new Vector3( originX + sizeX, 0, originZ + sizeZ ),<br />
            new Vector3( originX,         0, originZ + sizeZ )<br />
        };<br />
<br />
        int[] triangles = new int[]<br />
        {<br />
            2, 1, 0,<br />
            0, 3, 2<br />
        };<br />
<br />
        Vector2[] uvs = new Vector2[]<br />
        {<br />
            new Vector2( 0, 0 ),<br />
            new Vector2( 1, 0 ),<br />
            new Vector2( 1, 1 ),<br />
            new Vector2( 0, 1 )<br />
        };<br />
<br />
        newMesh.vertices = vertices;<br />
        newMesh.triangles = triangles;<br />
        newMesh.uv = uvs;<br />
<br />
        return ( newMesh );<br />
    }<br />
}<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/24/makequad-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DetectTouchMovement &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/22/detecttouchmovement-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/22/detecttouchmovement-unify-wiki/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 19:12:48 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=DetectTouchMovement</guid>
		<description><![CDATA[Caue.rego: /* Usage */ fixing code

[[Category: Controller]]
[[Category: CSharp]]
Author: Caue Rego (cawas)

== Description ==
Simple script to detect pinch and/or turning with 2 fingers.

== Usage ==
Easier to explain by example. Attach this to the ca...]]></description>
			<content:encoded><![CDATA[<p>Caue.rego: /* Usage */ fixing code</p>
<hr />
<div>[[Category: Controller]]<br />
[[Category: CSharp]]<br />
Author: Caue Rego (cawas)<br />
<br />
== Description ==<br />
Simple script to detect pinch and/or turning with 2 fingers.<br />
<br />
== Usage ==<br />
Easier to explain by example. Attach this to the camera:<br />
<br />
&lt;csharp&gt;<br />
void LateUpdate() {<br />
	float pinchAmount = 0;<br />
	Quaternion desiredRotation = transform.rotation;<br />
<br />
	DetectTouchMovement.Calculate();<br />
<br />
	if (Mathf.Abs(DetectTouchMovement.pinchDistanceDelta) &gt; 0) { // zoom<br />
		pinchAmount = DetectTouchMovement.pinchDistanceDelta;<br />
	}<br />
<br />
	if (Mathf.Abs(DetectTouchMovement.turnAngleDelta) &gt; 0) { // rotate<br />
		Vector3 rotationDeg = Vector3.zero;<br />
		rotationDeg.z = -DetectTouchMovement.turnAngleDelta;<br />
		desiredRotation *= Quaternion.Euler(rotationDeg);<br />
	}<br />
<br />
	<br />
	// not so sure those will work:<br />
	transform.rotation = desiredRotation;<br />
	transform.position += Vector3.forward * pinchAmount;<br />
}<br />
&lt;/csharp&gt;<br />
<br />
== DetectTouchMovement.cs ==<br />
<br />
&lt;csharp&gt;<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
public class DetectTouchMovement : MonoBehaviour {<br />
	const float pinchTurnRatio = Mathf.PI / 2;<br />
	const float minTurnAngle = 0;<br />
	<br />
	const float pinchRatio = 1;<br />
	const float minPinchDistance = 0;<br />
	<br />
	const float panRatio = 1;<br />
	const float minPanDistance = 0;<br />
	<br />
	/// &lt;summary&gt;<br />
	///   The delta of the angle between two touch points<br />
	/// &lt;/summary&gt;<br />
	static public float turnAngleDelta;<br />
	/// &lt;summary&gt;<br />
	///   The angle between two touch points<br />
	/// &lt;/summary&gt;<br />
	static public float turnAngle;<br />
<br />
	/// &lt;summary&gt;<br />
	///   The delta of the distance between two touch points that were distancing from each other<br />
	/// &lt;/summary&gt;<br />
	static public float pinchDistanceDelta;<br />
	/// &lt;summary&gt;<br />
	///   The distance between two touch points that were distancing from each other<br />
	/// &lt;/summary&gt;<br />
	static public float pinchDistance;<br />
	<br />
	/// &lt;summary&gt;<br />
	///   Calculates Pinch and Turn - This should be used inside LateUpdate<br />
	/// &lt;/summary&gt;<br />
	static public void Calculate () {<br />
		pinchDistance = pinchDistanceDelta = 0;<br />
		turnAngle = turnAngleDelta = 0;<br />
		<br />
		// if two fingers are touching the screen at the same time ...<br />
		if (Input.touchCount == 2) {<br />
			Touch touch1 = Input.touches[0];<br />
			Touch touch2 = Input.touches[1];<br />
			<br />
			// ... if at least one of them moved ...<br />
			if (touch1.phase == TouchPhase.Moved || touch2.phase == TouchPhase.Moved) {<br />
				// ... check the delta distance between them ...<br />
				pinchDistance = Vector2.Distance(touch1.position, touch2.position);<br />
				float prevDistance = Vector2.Distance(touch1.position - touch1.deltaPosition,<br />
				                                      touch2.position - touch2.deltaPosition);<br />
				pinchDistanceDelta = pinchDistance - prevDistance;<br />
				<br />
				// ... if it's greater than a minimum threshold, it's a pinch!<br />
				if (Mathf.Abs(pinchDistanceDelta) &gt; minPinchDistance) {<br />
					pinchDistanceDelta *= pinchRatio;<br />
				} else {<br />
					pinchDistance = pinchDistanceDelta = 0;<br />
				}<br />
				<br />
				// ... or check the delta angle between them ...<br />
				turnAngle = Angle(touch1.position, touch2.position);<br />
				float prevTurn = Angle(touch1.position - touch1.deltaPosition,<br />
				                       touch2.position - touch2.deltaPosition);<br />
				turnAngleDelta = Mathf.DeltaAngle(prevTurn, turnAngle);<br />
				<br />
				// ... if it's greater than a minimum threshold, it's a turn!<br />
				if (Mathf.Abs(turnAngleDelta) &gt; minTurnAngle) {<br />
					turnAngleDelta *= pinchTurnRatio;<br />
				} else {<br />
					turnAngle = turnAngleDelta = 0;<br />
				}<br />
			}<br />
		}<br />
	}<br />
	<br />
	static private float Angle (Vector2 pos1, Vector2 pos2) {<br />
		Vector2 from = pos2 - pos1;<br />
		Vector2 to = new Vector2(1, 0);<br />
		<br />
		float result = Vector2.Angle( from, to );<br />
		Vector3 cross = Vector3.Cross( from, to );<br />
		<br />
		if (cross.z &gt; 0) {<br />
			result = 360f - result;<br />
		}<br />
		<br />
		return result;<br />
	}<br />
}<br />
&lt;/csharp&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/22/detecttouchmovement-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DetectTouchMovement &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/22/detecttouchmovement-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/22/detecttouchmovement-unify-wiki-2/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 19:12:48 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=DetectTouchMovement</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/csharp&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

[[Category: Controller]]
[[Category: C Sharp]]
Author: Caue Rego (cawas)

== Description ==
Simple script to detect pinch and/or turning with 2 fingers.

== Us...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/csharp&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>[[Category: Controller]]<br />
[[Category: C Sharp]]<br />
Author: Caue Rego (cawas)<br />
<br />
== Description ==<br />
Simple script to detect pinch and/or turning with 2 fingers.<br />
<br />
== Usage ==<br />
Easier to explain by example. Attach this to the camera:<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
void LateUpdate() {<br />
	float pinchAmount = 0;<br />
	Quaternion desiredRotation = transform.rotation;<br />
<br />
	DetectTouchMovement.Calculate();<br />
<br />
	if (Mathf.Abs(DetectTouchMovement.pinchDistanceDelta) &gt; 0) { // zoom<br />
		pinchAmount = DetectTouchMovement.pinchDistanceDelta;<br />
	}<br />
<br />
	if (Mathf.Abs(DetectTouchMovement.turnAngleDelta) &gt; 0) { // rotate<br />
		Vector3 rotationDeg = Vector3.zero;<br />
		rotationDeg.z = -DetectTouchMovement.turnAngleDelta;<br />
		desiredRotation *= Quaternion.Euler(rotationDeg);<br />
	}<br />
<br />
	<br />
	// not so sure those will work:<br />
	transform.rotation = desiredRotation;<br />
	transform.position += Vector3.forward * pinchAmount;<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
== DetectTouchMovement.cs ==<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
public class DetectTouchMovement : MonoBehaviour {<br />
	const float pinchTurnRatio = Mathf.PI / 2;<br />
	const float minTurnAngle = 0;<br />
	<br />
	const float pinchRatio = 1;<br />
	const float minPinchDistance = 0;<br />
	<br />
	const float panRatio = 1;<br />
	const float minPanDistance = 0;<br />
	<br />
	/// &lt;summary&gt;<br />
	///   The delta of the angle between two touch points<br />
	/// &lt;/summary&gt;<br />
	static public float turnAngleDelta;<br />
	/// &lt;summary&gt;<br />
	///   The angle between two touch points<br />
	/// &lt;/summary&gt;<br />
	static public float turnAngle;<br />
<br />
	/// &lt;summary&gt;<br />
	///   The delta of the distance between two touch points that were distancing from each other<br />
	/// &lt;/summary&gt;<br />
	static public float pinchDistanceDelta;<br />
	/// &lt;summary&gt;<br />
	///   The distance between two touch points that were distancing from each other<br />
	/// &lt;/summary&gt;<br />
	static public float pinchDistance;<br />
	<br />
	/// &lt;summary&gt;<br />
	///   Calculates Pinch and Turn - This should be used inside LateUpdate<br />
	/// &lt;/summary&gt;<br />
	static public void Calculate () {<br />
		pinchDistance = pinchDistanceDelta = 0;<br />
		turnAngle = turnAngleDelta = 0;<br />
		<br />
		// if two fingers are touching the screen at the same time ...<br />
		if (Input.touchCount == 2) {<br />
			Touch touch1 = Input.touches[0];<br />
			Touch touch2 = Input.touches[1];<br />
			<br />
			// ... if at least one of them moved ...<br />
			if (touch1.phase == TouchPhase.Moved || touch2.phase == TouchPhase.Moved) {<br />
				// ... check the delta distance between them ...<br />
				pinchDistance = Vector2.Distance(touch1.position, touch2.position);<br />
				float prevDistance = Vector2.Distance(touch1.position - touch1.deltaPosition,<br />
				                                      touch2.position - touch2.deltaPosition);<br />
				pinchDistanceDelta = pinchDistance - prevDistance;<br />
				<br />
				// ... if it's greater than a minimum threshold, it's a pinch!<br />
				if (Mathf.Abs(pinchDistanceDelta) &gt; minPinchDistance) {<br />
					pinchDistanceDelta *= pinchRatio;<br />
				} else {<br />
					pinchDistance = pinchDistanceDelta = 0;<br />
				}<br />
				<br />
				// ... or check the delta angle between them ...<br />
				turnAngle = Angle(touch1.position, touch2.position);<br />
				float prevTurn = Angle(touch1.position - touch1.deltaPosition,<br />
				                       touch2.position - touch2.deltaPosition);<br />
				turnAngleDelta = Mathf.DeltaAngle(prevTurn, turnAngle);<br />
				<br />
				// ... if it's greater than a minimum threshold, it's a turn!<br />
				if (Mathf.Abs(turnAngleDelta) &gt; minTurnAngle) {<br />
					turnAngleDelta *= pinchTurnRatio;<br />
				} else {<br />
					turnAngle = turnAngleDelta = 0;<br />
				}<br />
			}<br />
		}<br />
	}<br />
	<br />
	static private float Angle (Vector2 pos1, Vector2 pos2) {<br />
		Vector2 from = pos2 - pos1;<br />
		Vector2 to = new Vector2(1, 0);<br />
		<br />
		float result = Vector2.Angle( from, to );<br />
		Vector3 cross = Vector3.Cross( from, to );<br />
		<br />
		if (cross.z &gt; 0) {<br />
			result = 360f - result;<br />
		}<br />
		<br />
		return result;<br />
	}<br />
}<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/22/detecttouchmovement-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ShootingWeaponScript &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/22/shootingweaponscript-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/22/shootingweaponscript-unify-wiki/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 19:06:01 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=ShootingWeaponScript</guid>
		<description><![CDATA[Unlogick: Weapon Script that spawns bullets.

[[Category:C Sharp]]
[[Category: MonoBehaviour]]
[[Category: Shooter]]

Author: Markus Davey

==Description==
This script lets a weapon spawn bullets and propel them forward. It supports ballistic bullets a...]]></description>
			<content:encoded><![CDATA[<p>Unlogick: Weapon Script that spawns bullets.</p>
<hr />
<div>[[Category:C Sharp]]<br />
[[Category: MonoBehaviour]]<br />
[[Category: Shooter]]<br />
<br />
Author: Markus Davey<br />
<br />
==Description==<br />
This script lets a weapon spawn bullets and propel them forward. It supports ballistic bullets and straight bullets. It supports random scatter of bullets. But have no off switch! Its a very early draft that was submitted to the forums. I felt that it would be a shame if it got lost in the swamp of forum posts.<br />
<br />
==Usage==<br />
Attach this script to a weapon. <br />
<br />
== CSharp weaponScript.cs ==<br />
&lt;csharp&gt;<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
/// &lt;summary&gt;<br />
/// created by Markus Davey 22/11/2011<br />
/// Basic weapon script<br />
/// Skype: Markus.Davey<br />
/// Unity forums: MarkusDavey<br />
/// &lt;/summary&gt;<br />
<br />
<br />
public class weaponScript : MonoBehaviour <br />
{<br />
    // public<br />
    public float projMuzzleVelocity; // in metres per second<br />
    public GameObject projPrefab;<br />
    public float RateOfFire;<br />
    public float Inaccuracy;<br />
    <br />
    // private<br />
    private float fireTimer;<br />
    <br />
    // Use this for initialization<br />
    void Start () <br />
    {<br />
        fireTimer = Time.time + RateOfFire;<br />
    }<br />
    <br />
    // Update is called once per frame<br />
    void Update () <br />
    {<br />
        Debug.DrawLine(transform.position, transform.position + transform.forward, Color.red);<br />
        if (Time.time &gt; fireTimer)<br />
        {<br />
            GameObject projectile;<br />
            Vector3 muzzlevelocity = transform.forward;<br />
            <br />
            if (Inaccuracy != 0)<br />
            {<br />
                Vector2 rand = Random.insideUnitCircle;<br />
                muzzlevelocity += new Vector3(rand.x, rand.y, 0) * Inaccuracy;<br />
            }<br />
            <br />
            muzzlevelocity = muzzlevelocity.normalized * projMuzzleVelocity;<br />
            <br />
            projectile = Instantiate(projPrefab, transform.position, transform.rotation) as GameObject;<br />
            projectile.GetComponent&lt;projectileScript&gt;().muzzleVelocity = muzzlevelocity;<br />
            fireTimer = Time.time + RateOfFire;<br />
        }<br />
        else<br />
            return;<br />
    }<br />
}  <br />
&lt;/csharp&gt;<br />
<br />
<br />
<br />
== CSharp projectileScript.cs ==<br />
&lt;csharp&gt;<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
/// &lt;summary&gt;<br />
/// created by Markus Davey 22/11/2011<br />
/// Basic projectile script<br />
/// Skype: Markus.Davey<br />
/// Unity forums: MarkusDavey<br />
/// &lt;/summary&gt;<br />
<br />
public class projectileScript : MonoBehaviour <br />
{<br />
    public Vector3 muzzleVelocity;<br />
    <br />
    public float TTL;<br />
    <br />
    public bool isBallistic;<br />
    public float Drag; // in metres/s lost per second.<br />
    <br />
    // Use this for initialization<br />
    void Start () <br />
    {<br />
        if (TTL == 0)<br />
            TTL = 5;<br />
        print(TTL);<br />
        Invoke(&quot;projectileTimeout&quot;, TTL);<br />
    }<br />
    <br />
    // Update is called once per frame<br />
    void Update () <br />
    {<br />
        if (Drag != 0)<br />
            muzzleVelocity += muzzleVelocity * (-Drag * Time.deltaTime);<br />
        <br />
        if (isBallistic)<br />
            muzzleVelocity += Physics.gravity * Time.deltaTime;<br />
        <br />
        if (muzzleVelocity == Vector3.zero)<br />
            return;<br />
        else<br />
            transform.position += muzzleVelocity * Time.deltaTime;<br />
        transform.LookAt(transform.position + muzzleVelocity.normalized);<br />
        Debug.DrawLine(transform.position, transform.position + muzzleVelocity.normalized, Color.red);<br />
    }<br />
    <br />
    void projectileTimeout()<br />
    {<br />
        DestroyObject(gameObject);<br />
    }<br />
    <br />
}  <br />
&lt;/csharp&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/22/shootingweaponscript-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ShootingWeaponScript &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/22/shootingweaponscript-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/22/shootingweaponscript-unify-wiki-2/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 19:06:01 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=ShootingWeaponScript</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/csharp&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

[[Category:C Sharp]]
[[Category: MonoBehaviour]]
[[Category: Shooter]]

Author: Markus Davey

==Description==
This script lets a weapon spawn bullets and prope...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/csharp&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>[[Category:C Sharp]]<br />
[[Category: MonoBehaviour]]<br />
[[Category: Shooter]]<br />
<br />
Author: Markus Davey<br />
<br />
==Description==<br />
This script lets a weapon spawn bullets and propel them forward. It supports ballistic bullets and straight bullets. It supports random scatter of bullets. But have no off switch! Its a very early draft that was submitted to the forums. I felt that it would be a shame if it got lost in the swamp of forum posts.<br />
<br />
==Usage==<br />
Attach this script to a weapon. <br />
<br />
== CSharp weaponScript.cs ==<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
/// &lt;summary&gt;<br />
/// created by Markus Davey 22/11/2011<br />
/// Basic weapon script<br />
/// Skype: Markus.Davey<br />
/// Unity forums: MarkusDavey<br />
/// &lt;/summary&gt;<br />
<br />
<br />
public class weaponScript : MonoBehaviour <br />
{<br />
    // public<br />
    public float projMuzzleVelocity; // in metres per second<br />
    public GameObject projPrefab;<br />
    public float RateOfFire;<br />
    public float Inaccuracy;<br />
    <br />
    // private<br />
    private float fireTimer;<br />
    <br />
    // Use this for initialization<br />
    void Start () <br />
    {<br />
        fireTimer = Time.time + RateOfFire;<br />
    }<br />
    <br />
    // Update is called once per frame<br />
    void Update () <br />
    {<br />
        Debug.DrawLine(transform.position, transform.position + transform.forward, Color.red);<br />
        if (Time.time &gt; fireTimer)<br />
        {<br />
            GameObject projectile;<br />
            Vector3 muzzlevelocity = transform.forward;<br />
            <br />
            if (Inaccuracy != 0)<br />
            {<br />
                Vector2 rand = Random.insideUnitCircle;<br />
                muzzlevelocity += new Vector3(rand.x, rand.y, 0) * Inaccuracy;<br />
            }<br />
            <br />
            muzzlevelocity = muzzlevelocity.normalized * projMuzzleVelocity;<br />
            <br />
            projectile = Instantiate(projPrefab, transform.position, transform.rotation) as GameObject;<br />
            projectile.GetComponent&lt;projectileScript&gt;().muzzleVelocity = muzzlevelocity;<br />
            fireTimer = Time.time + RateOfFire;<br />
        }<br />
        else<br />
            return;<br />
    }<br />
}  <br />
&lt;/syntaxhighlight&gt;<br />
<br />
<br />
<br />
== CSharp projectileScript.cs ==<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
/// &lt;summary&gt;<br />
/// created by Markus Davey 22/11/2011<br />
/// Basic projectile script<br />
/// Skype: Markus.Davey<br />
/// Unity forums: MarkusDavey<br />
/// &lt;/summary&gt;<br />
<br />
public class projectileScript : MonoBehaviour <br />
{<br />
    public Vector3 muzzleVelocity;<br />
    <br />
    public float TTL;<br />
    <br />
    public bool isBallistic;<br />
    public float Drag; // in metres/s lost per second.<br />
    <br />
    // Use this for initialization<br />
    void Start () <br />
    {<br />
        if (TTL == 0)<br />
            TTL = 5;<br />
        print(TTL);<br />
        Invoke(&quot;projectileTimeout&quot;, TTL);<br />
    }<br />
    <br />
    // Update is called once per frame<br />
    void Update () <br />
    {<br />
        if (Drag != 0)<br />
            muzzleVelocity += muzzleVelocity * (-Drag * Time.deltaTime);<br />
        <br />
        if (isBallistic)<br />
            muzzleVelocity += Physics.gravity * Time.deltaTime;<br />
        <br />
        if (muzzleVelocity == Vector3.zero)<br />
            return;<br />
        else<br />
            transform.position += muzzleVelocity * Time.deltaTime;<br />
        transform.LookAt(transform.position + muzzleVelocity.normalized);<br />
        Debug.DrawLine(transform.position, transform.position + muzzleVelocity.normalized, Color.red);<br />
    }<br />
    <br />
    void projectileTimeout()<br />
    {<br />
        DestroyObject(gameObject);<br />
    }<br />
    <br />
}  <br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/22/shootingweaponscript-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SecondsToText &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/22/secondstotext-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/22/secondstotext-unify-wiki/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 18:17:57 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=SecondsToText</guid>
		<description><![CDATA[Steamyshiner: Categorising

[[Category:Scripts]]
[[Category:JavaScript]]
[[Category:C Sharp]]
[[Category:ReallySimpleScripts]]
== Summary ==

This is a simple script which can be used to convert a time value in seconds into a readable text string. e.g....]]></description>
			<content:encoded><![CDATA[<p>Steamyshiner: Categorising</p>
<hr />
<div>[[Category:Scripts]]<br />
[[Category:JavaScript]]<br />
[[Category:C Sharp]]<br />
[[Category:ReallySimpleScripts]]<br />
== Summary ==<br />
<br />
This is a simple script which can be used to convert a time value in seconds into a readable text string. e.g. 15 =&gt; 15 seconds, or 3601 =&gt; 1 hour etc...<br />
<br />
== Script (Javascript) ==<br />
&lt;javascript&gt;<br />
function textTime (seconds : int)<br />
{<br />
    if (seconds &lt; 0) {<br />
        return '0';<br />
    }<br />
    if (seconds &lt; 60) {<br />
        n = seconds;<br />
        return n + ' second' + s(n);<br />
    }<br />
    if (seconds &lt; 60 * 60) {<br />
        n = Mathf.Floor(seconds/60);<br />
        return n + ' minute' + s(n);<br />
    }<br />
    if (seconds &lt; 60 * 60 * 24) {<br />
        n = Mathf.Floor(seconds/60/60);<br />
        return n + ' hour' + s(n);<br />
    }<br />
    if (seconds &lt; 60 * 60 * 24 * 7) {<br />
        n = Mathf.Floor(seconds/60/60/24);<br />
        return n + ' day' + s(n);<br />
    }<br />
    if (seconds &lt; 60 * 60 * 24 * 31) {<br />
        n = Mathf.Floor(seconds/60/60/24/7);<br />
        return n + ' week' + s(n);<br />
    }<br />
    if (seconds &lt; 60 * 60 * 24 * 365) {<br />
        n = Mathf.Floor(seconds/60/60/24/31);<br />
        return n + ' month' + s(n);<br />
    }<br />
    n = Mathf.Floor(seconds/60/60/24/365);<br />
    return n + ' year' + s(n);<br />
}<br />
 <br />
function s (n : float) {<br />
    return n == 1 ? '' : 's';<br />
}<br />
&lt;/javascript&gt;<br />
<br />
== Script (CSharp) ==<br />
&lt;csharp&gt;<br />
string s (int n) {<br />
    	if (n == 1) {<br />
    		return (&quot; &quot;);<br />
    	} else {<br />
    		return (&quot;s&quot;);<br />
    	}<br />
}<br />
	<br />
string textTime (float seconds) {<br />
		int n = 0;<br />
		string outString = &quot;error&quot;;<br />
    	if (seconds &lt; 0) {<br />
        	return &quot;0 seconds&quot;;<br />
    	}<br />
    	if (seconds &lt; 60) {<br />
    	    n = (int)Mathf.Floor(seconds);<br />
    	    outString = n + &quot; second&quot; + s(n);<br />
    	    return outString;<br />
    	}<br />
    	if (seconds &lt; 60 * 60) {<br />
    	    n = (int)Mathf.Floor(seconds/60);<br />
    	    outString = n + &quot; minute&quot; + s(n);<br />
    	    return outString;<br />
    	}<br />
    	if (seconds &lt; 60 * 60 * 24) {<br />
    	    n = (int)Mathf.Floor(seconds/60/60);<br />
    	    outString = n + &quot; hour&quot; + s(n);<br />
    	    return outString;<br />
    	}<br />
    	if (seconds &lt; 60 * 60 * 24 * 7) {<br />
     	    n = (int)Mathf.Floor(seconds/60/60/24);<br />
    	    outString = n + &quot; day&quot; + s(n);<br />
    	    return outString;<br />
    	}<br />
    	if (seconds &lt; 60 * 60 * 24 * 31) {<br />
    	    n = (int)Mathf.Floor(seconds/60/60/24/7);<br />
    	    outString = n + &quot; week&quot; + s(n);<br />
    	    return outString;<br />
    	}<br />
    	if (seconds &lt; 60 * 60 * 24 * 365) {<br />
    	    n = (int)Mathf.Floor(seconds/60/60/24/31);<br />
    	    outString = n + &quot; month&quot; + s(n);<br />
    	    return outString;<br />
    	}<br />
    	n = (int)Mathf.Floor(seconds/60/60/24/365);<br />
    	outString = n + &quot; year&quot; + s(n);<br />
    	return outString;<br />
}<br />
&lt;/csharp&gt;<br />
<br />
== Usage ==<br />
Place anywhere in your monobehaviour and call using something similar to:<br />
<br />
JS:<br />
&lt;javascript&gt;<br />
var timeAsText : String = textTime(Time.time);<br />
&lt;/javascript&gt;<br />
C#<br />
&lt;csharp&gt;<br />
string timeAsText = textTime(Time.time);<br />
&lt;/csharp&gt;<br />
<br />
Time.time being replaced by your own variable in seconds.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/22/secondstotext-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SecondsToText &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/22/secondstotext-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/22/secondstotext-unify-wiki-2/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 18:17:57 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=SecondsToText</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/javascript&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

[[Category:Scripts]]
[[Category:JavaScript]]
[[Category:C Sharp]]
[[Category:ReallySimpleScripts]]
== Summary ==

This is a simple script which can be used...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/javascript&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>[[Category:Scripts]]<br />
[[Category:JavaScript]]<br />
[[Category:C Sharp]]<br />
[[Category:ReallySimpleScripts]]<br />
== Summary ==<br />
<br />
This is a simple script which can be used to convert a time value in seconds into a readable text string. e.g. 15 =&gt; 15 seconds, or 3601 =&gt; 1 hour etc...<br />
<br />
== Script (Javascript) ==<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
function textTime (seconds : int)<br />
{<br />
    if (seconds &lt; 0) {<br />
        return '0';<br />
    }<br />
    if (seconds &lt; 60) {<br />
        n = seconds;<br />
        return n + ' second' + s(n);<br />
    }<br />
    if (seconds &lt; 60 * 60) {<br />
        n = Mathf.Floor(seconds/60);<br />
        return n + ' minute' + s(n);<br />
    }<br />
    if (seconds &lt; 60 * 60 * 24) {<br />
        n = Mathf.Floor(seconds/60/60);<br />
        return n + ' hour' + s(n);<br />
    }<br />
    if (seconds &lt; 60 * 60 * 24 * 7) {<br />
        n = Mathf.Floor(seconds/60/60/24);<br />
        return n + ' day' + s(n);<br />
    }<br />
    if (seconds &lt; 60 * 60 * 24 * 31) {<br />
        n = Mathf.Floor(seconds/60/60/24/7);<br />
        return n + ' week' + s(n);<br />
    }<br />
    if (seconds &lt; 60 * 60 * 24 * 365) {<br />
        n = Mathf.Floor(seconds/60/60/24/31);<br />
        return n + ' month' + s(n);<br />
    }<br />
    n = Mathf.Floor(seconds/60/60/24/365);<br />
    return n + ' year' + s(n);<br />
}<br />
 <br />
function s (n : float) {<br />
    return n == 1 ? '' : 's';<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
== Script (CSharp) ==<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
string s (int n) {<br />
    	if (n == 1) {<br />
    		return (&quot; &quot;);<br />
    	} else {<br />
    		return (&quot;s&quot;);<br />
    	}<br />
}<br />
	<br />
string textTime (float seconds) {<br />
		int n = 0;<br />
		string outString = &quot;error&quot;;<br />
    	if (seconds &lt; 0) {<br />
        	return &quot;0 seconds&quot;;<br />
    	}<br />
    	if (seconds &lt; 60) {<br />
    	    n = (int)Mathf.Floor(seconds);<br />
    	    outString = n + &quot; second&quot; + s(n);<br />
    	    return outString;<br />
    	}<br />
    	if (seconds &lt; 60 * 60) {<br />
    	    n = (int)Mathf.Floor(seconds/60);<br />
    	    outString = n + &quot; minute&quot; + s(n);<br />
    	    return outString;<br />
    	}<br />
    	if (seconds &lt; 60 * 60 * 24) {<br />
    	    n = (int)Mathf.Floor(seconds/60/60);<br />
    	    outString = n + &quot; hour&quot; + s(n);<br />
    	    return outString;<br />
    	}<br />
    	if (seconds &lt; 60 * 60 * 24 * 7) {<br />
     	    n = (int)Mathf.Floor(seconds/60/60/24);<br />
    	    outString = n + &quot; day&quot; + s(n);<br />
    	    return outString;<br />
    	}<br />
    	if (seconds &lt; 60 * 60 * 24 * 31) {<br />
    	    n = (int)Mathf.Floor(seconds/60/60/24/7);<br />
    	    outString = n + &quot; week&quot; + s(n);<br />
    	    return outString;<br />
    	}<br />
    	if (seconds &lt; 60 * 60 * 24 * 365) {<br />
    	    n = (int)Mathf.Floor(seconds/60/60/24/31);<br />
    	    outString = n + &quot; month&quot; + s(n);<br />
    	    return outString;<br />
    	}<br />
    	n = (int)Mathf.Floor(seconds/60/60/24/365);<br />
    	outString = n + &quot; year&quot; + s(n);<br />
    	return outString;<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
== Usage ==<br />
Place anywhere in your monobehaviour and call using something similar to:<br />
<br />
JS:<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
var timeAsText : String = textTime(Time.time);<br />
&lt;/syntaxhighlight&gt;<br />
C#<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
string timeAsText = textTime(Time.time);<br />
&lt;/syntaxhighlight&gt;<br />
<br />
Time.time being replaced by your own variable in seconds.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/22/secondstotext-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advanced CSharp Messenger &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/19/advanced-csharp-messenger-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/19/advanced-csharp-messenger-unify-wiki/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 07:28:47 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Advanced_CSharp_Messenger</guid>
		<description><![CDATA[Ilya.s: Improved logging system; Fixed a silent bug with MessengerHelper;

[[Category:Design Patterns]]
[[Category:Messaging]]
[[Category:C Sharp]]
Author: Ilya Suzdalnitski


== Description ==
This is an advanced version of a messaging system for C#.
...]]></description>
			<content:encoded><![CDATA[<p>Ilya.s: Improved logging system; Fixed a silent bug with MessengerHelper;</p>
<hr />
<div>[[Category:Design Patterns]]<br />
[[Category:Messaging]]<br />
[[Category:C Sharp]]<br />
Author: Ilya Suzdalnitski<br />
<br />
<br />
== Description ==<br />
This is an advanced version of a messaging system for C#.<br />
It will automatically clean up its event table after a new level has been loaded. This will prevent the programmer from accidentally invoking destroyed methods and thus will help prevent many MissingReferenceExceptions.<br />
This messaging system is based on Rod Hyde's [[CSharpMessenger]] and Magnus Wolffelt's [[CSharpMessenger Extended]].<br />
<br />
== Foreword ==<br />
Upon introduction of a messaging system into our project ([[CSharpMessenger Extended]]) we started facing very strange bugs. Unity3d would throw MissingReferenceExceptions every time a message was broadcasted. It would say that the class, where the message handler was declared in, was destroyed. The problem came out of nowhere and there was not a reasonable explanation behind it. However placing the message handler code within try-catch blocks solved the problem. We understood that it was not a good solution to have hundreds of try-catch blocks in our code.<br />
It took us some time to finally figure out where was the problem.<br />
<br />
=== Cause behind the MissingReferenceException and solution ===<br />
It turned out, that the MissingReferenceException bug appeared, when a new level was loaded (or current one was reloaded). For example, we have a message '''''&quot;start game&quot;''''', declared as follows:<br />
&lt;csharp&gt;<br />
public class MainMenu : MonoBehaviour {	<br />
	void Start ()<br />
	{<br />
		Messenger.AddListener(&quot;start game&quot;, StartGame);<br />
	}<br />
<br />
	void StartGame()<br />
	{<br />
		Debug.Log(&quot;StartGame called in&quot; + gameObject);  //This is the line that would throw an exception<br />
	}<br />
	<br />
	void StartGameButtonPressed()<br />
	{<br />
		Messenger.Broadcast(&quot;start game&quot;);<br />
	}<br />
}<br />
&lt;/csharp&gt;<br />
<br />
At first glance, there's no problem at all, but after the level has been reloaded, Unity3d will throw an exception, saying that MainMenu has been destroyed. However there's no code that would EVER destroy the MainMenu script.<br />
<br />
What actually happened is:<br />
# We added a &quot;start game&quot; message listener to our Messenger.<br />
# StartGameButtonPressed was called which in turn broadcasted the &quot;start game&quot; message.<br />
# We reloaded the level with Application.LoadLevel.<br />
# Step 1 repeated.<br />
# Step 2 repeated.<br />
<br />
Here's how eventTable of the messenger looks like at corresponding steps:<br />
* At step 1: { '''''&quot;start game&quot;, mainMenu1- &gt; StartGame();''''' }<br />
* At step 4: { '''''&quot;start game&quot;, mainMenu1- &gt; StartGame();''''' } { '''''&quot;start game&quot;, mainMenu2- &gt; StartGame();''''' }<br />
<br />
So at step 4 we have two message handler for the same '''''&quot;start game&quot;''''' message - the first one is for the destroyed MainMenu object (got destroyed when reloaded a level), and the second one it for the current valid MainMenu object.<br />
It turns out that when we broadcast the '''''&quot;start game&quot;''''' message after reloading the level, the messenger invokes both - the destroyed and the valid message handlers. This is where the MissingReferenceException came from.<br />
<br />
So the solution is obvious - clear the '''''eventTable''''' after unloading a level. There's nothing else the programmer has to do on his side to clean up the table, it's being done automatically.<br />
<br />
= The Messenger =<br />
We're happy to present you an advanced version of C# messaging system.<br />
== Usage ==<br />
=== Event listener ===<br />
&lt;csharp&gt;<br />
void OnPropCollected( PropType propType ) {<br />
	if (propType == PropType.Life)<br />
		livesAmount++;<br />
}<br />
&lt;/csharp&gt;<br />
<br />
=== Registering an event listener ===<br />
&lt;csharp&gt;<br />
void Start() {<br />
	Messenger.AddListener&lt; Prop &gt;( &quot;prop collected&quot;, OnPropCollected );<br />
}<br />
&lt;/csharp&gt;<br />
<br />
=== Unregistering an event listener ===<br />
&lt;csharp&gt;<br />
	Messenger.RemoveListener&lt; Prop &gt; ( &quot;prop collected&quot;, OnPropCollected );<br />
&lt;/csharp&gt;<br />
<br />
=== Broadcasting an event ===<br />
&lt;csharp&gt;<br />
public void OnTriggerEnter(Collider _collider) <br />
{<br />
	Messenger.Broadcast&lt; PropType &gt; ( &quot;prop collected&quot;, _collider.gameObject.GetComponent&lt;Prop&gt;().propType );<br />
}<br />
&lt;/csharp&gt;<br />
<br />
== Cleaning up the messenger ==<br />
The messenger cleans up its eventTable automatically when a new level loads. This will ensure that the eventTable of the messenger gets cleaned up and will save us from unexpected MissingReferenceExceptions.<br />
In case you want to clean up manager's eventTable manually, there's such an option by calling Messenger.Cleanup();<br />
<br />
=== Permanent messages ===<br />
If you want a certain message to survive the Cleanup, mark it with Messenger.MarkAsPermanent(string). This may be required if a certain class responds to messages broadcasted from across different levels.<br />
<br />
<br />
== Misc ==<br />
=== Log all messages ===<br />
For debugging purposes, you can set the '''''shouldLogAllMessages''''' flag in Messenger to true. This will log all calls to the Messenger.<br />
<br />
=== Transition from other messengers ===<br />
To quickly change all calls to messaging system from older CSharpMessenger's to the advanced, do the following steps:<br />
# In MonoDevelop go to Search =&gt; Replace in files<br />
# In Find field enter: '''''Messenger&lt;([^&lt;&gt;]+)&gt;.([A-Za-z0-9_]+)'''''<br />
# In Replace field enter: '''''Messenger.$2&lt;$1&gt;'''''<br />
# Select scope: Whole solution.<br />
# Check the Regex search check box. <br />
# Press the Replace button<br />
<br />
== Code ==<br />
There're two files required for the messenger to work - '''''Callback.cs''''' and '''''Messenger.cs'''''.<br />
<br />
=== Callback.cs ===<br />
&lt;csharp&gt;<br />
public delegate void Callback();<br />
public delegate void Callback&lt;T&gt;(T arg1);<br />
public delegate void Callback&lt;T, U&gt;(T arg1, U arg2);<br />
public delegate void Callback&lt;T, U, V&gt;(T arg1, U arg2, V arg3);<br />
&lt;/csharp&gt;<br />
<br />
=== Messenger.cs ===<br />
&lt;csharp&gt;<br />
/*<br />
 * Advanced C# messenger by Ilya Suzdalnitski. V1.0<br />
 * <br />
 * Based on Rod Hyde's &quot;CSharpMessenger&quot; and Magnus Wolffelt's &quot;CSharpMessenger Extended&quot;.<br />
 * <br />
 * Features:<br />
 	* Prevents a MissingReferenceException because of a reference to a destroyed message handler.<br />
 	* Option to log all messages<br />
 	* Extensive error detection, preventing silent bugs<br />
 * <br />
 * Usage examples:<br />
 	1. Messenger.AddListener&lt;GameObject&gt;(&quot;prop collected&quot;, PropCollected);<br />
 	   Messenger.Broadcast&lt;GameObject&gt;(&quot;prop collected&quot;, prop);<br />
 	2. Messenger.AddListener&lt;float&gt;(&quot;speed changed&quot;, SpeedChanged);<br />
 	   Messenger.Broadcast&lt;float&gt;(&quot;speed changed&quot;, 0.5f);<br />
 * <br />
 * Messenger cleans up its evenTable automatically upon loading of a new level.<br />
 * <br />
 * Don't forget that the messages that should survive the cleanup, should be marked with Messenger.MarkAsPermanent(string)<br />
 * <br />
 */<br />
<br />
//#define LOG_ALL_MESSAGES<br />
//#define LOG_ADD_LISTENER<br />
//#define LOG_BROADCAST_MESSAGE<br />
#define REQUIRE_LISTENER<br />
<br />
using System;<br />
using System.Collections.Generic;<br />
using UnityEngine;<br />
<br />
static internal class Messenger {<br />
	#region Internal variables<br />
<br />
	//Disable the unused variable warning<br />
#pragma warning disable 0414<br />
	//Ensures that the MessengerHelper will be created automatically upon start of the game.<br />
	static private MessengerHelper messengerHelper = ( new GameObject(&quot;MessengerHelper&quot;) ).AddComponent&lt; MessengerHelper &gt;();<br />
#pragma warning restore 0414<br />
	<br />
	static public Dictionary&lt;string, Delegate&gt; eventTable = new Dictionary&lt;string, Delegate&gt;();<br />
<br />
	//Message handlers that should never be removed, regardless of calling Cleanup<br />
	static public List&lt; string &gt; permanentMessages = new List&lt; string &gt; ();<br />
	#endregion<br />
	#region Helper methods<br />
	//Marks a certain message as permanent.<br />
	static public void MarkAsPermanent(string eventType) {<br />
#if LOG_ALL_MESSAGES<br />
		Debug.Log(&quot;Messenger MarkAsPermanent &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&quot;);<br />
#endif<br />
		<br />
		permanentMessages.Add( eventType );<br />
	}<br />
<br />
	<br />
	static public void Cleanup()<br />
	{<br />
#if LOG_ALL_MESSAGES<br />
		Debug.Log(&quot;MESSENGER Cleanup. Make sure that none of necessary listeners are removed.&quot;);<br />
#endif<br />
		<br />
		List&lt; string &gt; messagesToRemove = new List&lt;string&gt;();<br />
		<br />
		foreach (KeyValuePair&lt;string, Delegate&gt; pair in eventTable) {<br />
			bool wasFound = false;<br />
			<br />
			foreach (string message in permanentMessages) {<br />
				if (pair.Key == message) {<br />
					wasFound = true;<br />
					break;<br />
				}<br />
			}<br />
			<br />
			if (!wasFound)<br />
				messagesToRemove.Add( pair.Key );<br />
		}<br />
		<br />
		foreach (string message in messagesToRemove) {<br />
			eventTable.Remove( message );<br />
		}<br />
	}<br />
	<br />
	static public void PrintEventTable()<br />
	{<br />
		Debug.Log(&quot;&#92;t&#92;t&#92;t=== MESSENGER PrintEventTable ===&quot;);<br />
		<br />
		foreach (KeyValuePair&lt;string, Delegate&gt; pair in eventTable) {<br />
			Debug.Log(&quot;&#92;t&#92;t&#92;t&quot; + pair.Key + &quot;&#92;t&#92;t&quot; + pair.Value);<br />
		}<br />
		<br />
		Debug.Log(&quot;&#92;n&quot;);<br />
	}<br />
	#endregion<br />
	<br />
	#region Message logging and exception throwing<br />
    static public void OnListenerAdding(string eventType, Delegate listenerBeingAdded) {<br />
#if LOG_ALL_MESSAGES || LOG_ADD_LISTENER<br />
		Debug.Log(&quot;MESSENGER OnListenerAdding &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&#92;t{&quot; + listenerBeingAdded.Target + &quot; -&gt; &quot; + listenerBeingAdded.Method + &quot;}&quot;);<br />
#endif<br />
		<br />
        if (!eventTable.ContainsKey(eventType)) {<br />
            eventTable.Add(eventType, null );<br />
        }<br />
<br />
        Delegate d = eventTable[eventType];<br />
        if (d != null &amp;&amp; d.GetType() != listenerBeingAdded.GetType()) {<br />
            throw new ListenerException(string.Format(&quot;Attempting to add listener with inconsistent signature for event type {0}. Current listeners have type {1} and listener being added has type {2}&quot;, eventType, d.GetType().Name, listenerBeingAdded.GetType().Name));<br />
        }<br />
    }<br />
<br />
    static public void OnListenerRemoving(string eventType, Delegate listenerBeingRemoved) {<br />
#if LOG_ALL_MESSAGES<br />
		Debug.Log(&quot;MESSENGER OnListenerRemoving &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&#92;t{&quot; + listenerBeingRemoved.Target + &quot; -&gt; &quot; + listenerBeingRemoved.Method + &quot;}&quot;);<br />
#endif<br />
		<br />
        if (eventTable.ContainsKey(eventType)) {<br />
            Delegate d = eventTable[eventType];<br />
<br />
            if (d == null) {<br />
                throw new ListenerException(string.Format(&quot;Attempting to remove listener with for event type &#92;&quot;{0}&#92;&quot; but current listener is null.&quot;, eventType));<br />
            } else if (d.GetType() != listenerBeingRemoved.GetType()) {<br />
                throw new ListenerException(string.Format(&quot;Attempting to remove listener with inconsistent signature for event type {0}. Current listeners have type {1} and listener being removed has type {2}&quot;, eventType, d.GetType().Name, listenerBeingRemoved.GetType().Name));<br />
            }<br />
        } else {<br />
            throw new ListenerException(string.Format(&quot;Attempting to remove listener for type &#92;&quot;{0}&#92;&quot; but Messenger doesn't know about this event type.&quot;, eventType));<br />
        }<br />
    }<br />
<br />
    static public void OnListenerRemoved(string eventType) {<br />
        if (eventTable[eventType] == null) {<br />
            eventTable.Remove(eventType);<br />
        }<br />
    }<br />
<br />
    static public void OnBroadcasting(string eventType) {<br />
#if REQUIRE_LISTENER<br />
        if (!eventTable.ContainsKey(eventType)) {<br />
            throw new BroadcastException(string.Format(&quot;Broadcasting message &#92;&quot;{0}&#92;&quot; but no listener found. Try marking the message with Messenger.MarkAsPermanent.&quot;, eventType));<br />
        }<br />
#endif<br />
    }<br />
<br />
    static public BroadcastException CreateBroadcastSignatureException(string eventType) {<br />
        return new BroadcastException(string.Format(&quot;Broadcasting message &#92;&quot;{0}&#92;&quot; but listeners have a different signature than the broadcaster.&quot;, eventType));<br />
    }<br />
<br />
    public class BroadcastException : Exception {<br />
        public BroadcastException(string msg)<br />
            : base(msg) {<br />
        }<br />
    }<br />
<br />
    public class ListenerException : Exception {<br />
        public ListenerException(string msg)<br />
            : base(msg) {<br />
        }<br />
    }<br />
	#endregion<br />
	<br />
	#region AddListener<br />
	//No parameters<br />
    static public void AddListener(string eventType, Callback handler) {<br />
        OnListenerAdding(eventType, handler);<br />
        eventTable[eventType] = (Callback)eventTable[eventType] + handler;<br />
    }<br />
	<br />
	//Single parameter<br />
	static public void AddListener&lt;T&gt;(string eventType, Callback&lt;T&gt; handler) {<br />
        OnListenerAdding(eventType, handler);<br />
        eventTable[eventType] = (Callback&lt;T&gt;)eventTable[eventType] + handler;<br />
    }<br />
	<br />
	//Two parameters<br />
	static public void AddListener&lt;T, U&gt;(string eventType, Callback&lt;T, U&gt; handler) {<br />
        OnListenerAdding(eventType, handler);<br />
        eventTable[eventType] = (Callback&lt;T, U&gt;)eventTable[eventType] + handler;<br />
    }<br />
	<br />
	//Three parameters<br />
	static public void AddListener&lt;T, U, V&gt;(string eventType, Callback&lt;T, U, V&gt; handler) {<br />
        OnListenerAdding(eventType, handler);<br />
        eventTable[eventType] = (Callback&lt;T, U, V&gt;)eventTable[eventType] + handler;<br />
    }<br />
	#endregion<br />
	<br />
	#region RemoveListener<br />
	//No parameters<br />
    static public void RemoveListener(string eventType, Callback handler) {<br />
        OnListenerRemoving(eventType, handler);   <br />
        eventTable[eventType] = (Callback)eventTable[eventType] - handler;<br />
        OnListenerRemoved(eventType);<br />
    }<br />
	<br />
	//Single parameter<br />
	static public void RemoveListener&lt;T&gt;(string eventType, Callback&lt;T&gt; handler) {<br />
        OnListenerRemoving(eventType, handler);<br />
        eventTable[eventType] = (Callback&lt;T&gt;)eventTable[eventType] - handler;<br />
        OnListenerRemoved(eventType);<br />
    }<br />
	<br />
	//Two parameters<br />
	static public void RemoveListener&lt;T, U&gt;(string eventType, Callback&lt;T, U&gt; handler) {<br />
        OnListenerRemoving(eventType, handler);<br />
        eventTable[eventType] = (Callback&lt;T, U&gt;)eventTable[eventType] - handler;<br />
        OnListenerRemoved(eventType);<br />
    }<br />
	<br />
	//Three parameters<br />
	static public void RemoveListener&lt;T, U, V&gt;(string eventType, Callback&lt;T, U, V&gt; handler) {<br />
        OnListenerRemoving(eventType, handler);<br />
        eventTable[eventType] = (Callback&lt;T, U, V&gt;)eventTable[eventType] - handler;<br />
        OnListenerRemoved(eventType);<br />
    }<br />
	#endregion<br />
	<br />
	#region Broadcast<br />
	//No parameters<br />
    static public void Broadcast(string eventType) {<br />
#if LOG_ALL_MESSAGES || LOG_BROADCAST_MESSAGE<br />
		Debug.Log(&quot;MESSENGER&#92;t&quot; + System.DateTime.Now.ToString(&quot;hh:mm:ss.fff&quot;) + &quot;&#92;t&#92;t&#92;tInvoking &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&quot;);<br />
#endif<br />
        OnBroadcasting(eventType);<br />
		<br />
        Delegate d;<br />
        if (eventTable.TryGetValue(eventType, out d)) {<br />
            Callback callback = d as Callback;<br />
<br />
            if (callback != null) {<br />
                callback();<br />
            } else {<br />
                throw CreateBroadcastSignatureException(eventType);<br />
            }<br />
        }<br />
    }<br />
	<br />
	//Single parameter<br />
    static public void Broadcast&lt;T&gt;(string eventType, T arg1) {<br />
#if LOG_ALL_MESSAGES || LOG_BROADCAST_MESSAGE<br />
		Debug.Log(&quot;MESSENGER&#92;t&quot; + System.DateTime.Now.ToString(&quot;hh:mm:ss.fff&quot;) + &quot;&#92;t&#92;t&#92;tInvoking &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&quot;);<br />
#endif<br />
        OnBroadcasting(eventType);<br />
		<br />
        Delegate d;<br />
        if (eventTable.TryGetValue(eventType, out d)) {<br />
            Callback&lt;T&gt; callback = d as Callback&lt;T&gt;;<br />
			<br />
            if (callback != null) {<br />
                callback(arg1);<br />
            } else {<br />
                throw CreateBroadcastSignatureException(eventType);<br />
            }<br />
        }<br />
	}<br />
	<br />
	//Two parameters<br />
    static public void Broadcast&lt;T, U&gt;(string eventType, T arg1, U arg2) {<br />
#if LOG_ALL_MESSAGES || LOG_BROADCAST_MESSAGE<br />
		Debug.Log(&quot;MESSENGER&#92;t&quot; + System.DateTime.Now.ToString(&quot;hh:mm:ss.fff&quot;) + &quot;&#92;t&#92;t&#92;tInvoking &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&quot;);<br />
#endif<br />
        OnBroadcasting(eventType);<br />
		<br />
        Delegate d;<br />
        if (eventTable.TryGetValue(eventType, out d)) {<br />
            Callback&lt;T, U&gt; callback = d as Callback&lt;T, U&gt;;<br />
			<br />
            if (callback != null) {<br />
                callback(arg1, arg2);<br />
            } else {<br />
                throw CreateBroadcastSignatureException(eventType);<br />
            }<br />
        }<br />
    }<br />
	<br />
	//Three parameters<br />
    static public void Broadcast&lt;T, U, V&gt;(string eventType, T arg1, U arg2, V arg3) {<br />
#if LOG_ALL_MESSAGES || LOG_BROADCAST_MESSAGE<br />
		Debug.Log(&quot;MESSENGER&#92;t&quot; + System.DateTime.Now.ToString(&quot;hh:mm:ss.fff&quot;) + &quot;&#92;t&#92;t&#92;tInvoking &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&quot;);<br />
#endif<br />
        OnBroadcasting(eventType);<br />
		<br />
        Delegate d;<br />
        if (eventTable.TryGetValue(eventType, out d)) {<br />
            Callback&lt;T, U, V&gt; callback = d as Callback&lt;T, U, V&gt;;<br />
<br />
            if (callback != null) {<br />
                callback(arg1, arg2, arg3);<br />
            } else {<br />
                throw CreateBroadcastSignatureException(eventType);<br />
            }<br />
        }<br />
    }<br />
	#endregion<br />
}<br />
<br />
//This manager will ensure that the messenger's eventTable will be cleaned up upon loading of a new level.<br />
public sealed class MessengerHelper : MonoBehaviour {<br />
	void Awake ()<br />
	{<br />
		DontDestroyOnLoad(gameObject);	<br />
	}<br />
	<br />
	//Clean up eventTable every time a new level loads.<br />
	public void OnDisable() {<br />
		Messenger.Cleanup();<br />
	}<br />
}<br />
&lt;/csharp&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/19/advanced-csharp-messenger-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advanced CSharp Messenger &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/19/advanced-csharp-messenger-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/19/advanced-csharp-messenger-unify-wiki-2/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 07:28:47 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=Advanced_CSharp_Messenger</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/csharp&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

[[Category:Design Patterns]]
[[Category:Messaging]]
[[Category:C Sharp]]
Author: Ilya Suzdalnitski


== Description ==
This is an advanced version of a messagi...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/csharp&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>[[Category:Design Patterns]]<br />
[[Category:Messaging]]<br />
[[Category:C Sharp]]<br />
Author: Ilya Suzdalnitski<br />
<br />
<br />
== Description ==<br />
This is an advanced version of a messaging system for C#.<br />
It will automatically clean up its event table after a new level has been loaded. This will prevent the programmer from accidentally invoking destroyed methods and thus will help prevent many MissingReferenceExceptions.<br />
This messaging system is based on Rod Hyde's [[CSharpMessenger]] and Magnus Wolffelt's [[CSharpMessenger Extended]].<br />
<br />
== Foreword ==<br />
Upon introduction of a messaging system into our project ([[CSharpMessenger Extended]]) we started facing very strange bugs. Unity3d would throw MissingReferenceExceptions every time a message was broadcasted. It would say that the class, where the message handler was declared in, was destroyed. The problem came out of nowhere and there was not a reasonable explanation behind it. However placing the message handler code within try-catch blocks solved the problem. We understood that it was not a good solution to have hundreds of try-catch blocks in our code.<br />
It took us some time to finally figure out where was the problem.<br />
<br />
=== Cause behind the MissingReferenceException and solution ===<br />
It turned out, that the MissingReferenceException bug appeared, when a new level was loaded (or current one was reloaded). For example, we have a message '''''&quot;start game&quot;''''', declared as follows:<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
public class MainMenu : MonoBehaviour {	<br />
	void Start ()<br />
	{<br />
		Messenger.AddListener(&quot;start game&quot;, StartGame);<br />
	}<br />
<br />
	void StartGame()<br />
	{<br />
		Debug.Log(&quot;StartGame called in&quot; + gameObject);  //This is the line that would throw an exception<br />
	}<br />
	<br />
	void StartGameButtonPressed()<br />
	{<br />
		Messenger.Broadcast(&quot;start game&quot;);<br />
	}<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
At first glance, there's no problem at all, but after the level has been reloaded, Unity3d will throw an exception, saying that MainMenu has been destroyed. However there's no code that would EVER destroy the MainMenu script.<br />
<br />
What actually happened is:<br />
# We added a &quot;start game&quot; message listener to our Messenger.<br />
# StartGameButtonPressed was called which in turn broadcasted the &quot;start game&quot; message.<br />
# We reloaded the level with Application.LoadLevel.<br />
# Step 1 repeated.<br />
# Step 2 repeated.<br />
<br />
Here's how eventTable of the messenger looks like at corresponding steps:<br />
* At step 1: { '''''&quot;start game&quot;, mainMenu1- &gt; StartGame();''''' }<br />
* At step 4: { '''''&quot;start game&quot;, mainMenu1- &gt; StartGame();''''' } { '''''&quot;start game&quot;, mainMenu2- &gt; StartGame();''''' }<br />
<br />
So at step 4 we have two message handler for the same '''''&quot;start game&quot;''''' message - the first one is for the destroyed MainMenu object (got destroyed when reloaded a level), and the second one it for the current valid MainMenu object.<br />
It turns out that when we broadcast the '''''&quot;start game&quot;''''' message after reloading the level, the messenger invokes both - the destroyed and the valid message handlers. This is where the MissingReferenceException came from.<br />
<br />
So the solution is obvious - clear the '''''eventTable''''' after unloading a level. There's nothing else the programmer has to do on his side to clean up the table, it's being done automatically.<br />
<br />
= The Messenger =<br />
We're happy to present you an advanced version of C# messaging system.<br />
== Usage ==<br />
=== Event listener ===<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
void OnPropCollected( PropType propType ) {<br />
	if (propType == PropType.Life)<br />
		livesAmount++;<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
=== Registering an event listener ===<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
void Start() {<br />
	Messenger.AddListener&lt; Prop &gt;( &quot;prop collected&quot;, OnPropCollected );<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
=== Unregistering an event listener ===<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
	Messenger.RemoveListener&lt; Prop &gt; ( &quot;prop collected&quot;, OnPropCollected );<br />
&lt;/syntaxhighlight&gt;<br />
<br />
=== Broadcasting an event ===<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
public void OnTriggerEnter(Collider _collider) <br />
{<br />
	Messenger.Broadcast&lt; PropType &gt; ( &quot;prop collected&quot;, _collider.gameObject.GetComponent&lt;Prop&gt;().propType );<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
== Cleaning up the messenger ==<br />
The messenger cleans up its eventTable automatically when a new level loads. This will ensure that the eventTable of the messenger gets cleaned up and will save us from unexpected MissingReferenceExceptions.<br />
In case you want to clean up manager's eventTable manually, there's such an option by calling Messenger.Cleanup();<br />
<br />
=== Permanent messages ===<br />
If you want a certain message to survive the Cleanup, mark it with Messenger.MarkAsPermanent(string). This may be required if a certain class responds to messages broadcasted from across different levels.<br />
<br />
<br />
== Misc ==<br />
=== Log all messages ===<br />
For debugging purposes, you can set the '''''shouldLogAllMessages''''' flag in Messenger to true. This will log all calls to the Messenger.<br />
<br />
=== Transition from other messengers ===<br />
To quickly change all calls to messaging system from older CSharpMessenger's to the advanced, do the following steps:<br />
# In MonoDevelop go to Search =&gt; Replace in files<br />
# In Find field enter: '''''Messenger&lt;([^&lt;&gt;]+)&gt;.([A-Za-z0-9_]+)'''''<br />
# In Replace field enter: '''''Messenger.$2&lt;$1&gt;'''''<br />
# Select scope: Whole solution.<br />
# Check the Regex search check box. <br />
# Press the Replace button<br />
<br />
== Code ==<br />
There're two files required for the messenger to work - '''''Callback.cs''''' and '''''Messenger.cs'''''.<br />
<br />
=== Callback.cs ===<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
public delegate void Callback();<br />
public delegate void Callback&lt;T&gt;(T arg1);<br />
public delegate void Callback&lt;T, U&gt;(T arg1, U arg2);<br />
public delegate void Callback&lt;T, U, V&gt;(T arg1, U arg2, V arg3);<br />
&lt;/syntaxhighlight&gt;<br />
<br />
=== Messenger.cs ===<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
/*<br />
 * Advanced C# messenger by Ilya Suzdalnitski. V1.0<br />
 * <br />
 * Based on Rod Hyde's &quot;CSharpMessenger&quot; and Magnus Wolffelt's &quot;CSharpMessenger Extended&quot;.<br />
 * <br />
 * Features:<br />
 	* Prevents a MissingReferenceException because of a reference to a destroyed message handler.<br />
 	* Option to log all messages<br />
 	* Extensive error detection, preventing silent bugs<br />
 * <br />
 * Usage examples:<br />
 	1. Messenger.AddListener&lt;GameObject&gt;(&quot;prop collected&quot;, PropCollected);<br />
 	   Messenger.Broadcast&lt;GameObject&gt;(&quot;prop collected&quot;, prop);<br />
 	2. Messenger.AddListener&lt;float&gt;(&quot;speed changed&quot;, SpeedChanged);<br />
 	   Messenger.Broadcast&lt;float&gt;(&quot;speed changed&quot;, 0.5f);<br />
 * <br />
 * Messenger cleans up its evenTable automatically upon loading of a new level.<br />
 * <br />
 * Don't forget that the messages that should survive the cleanup, should be marked with Messenger.MarkAsPermanent(string)<br />
 * <br />
 */<br />
<br />
//#define LOG_ALL_MESSAGES<br />
//#define LOG_ADD_LISTENER<br />
//#define LOG_BROADCAST_MESSAGE<br />
#define REQUIRE_LISTENER<br />
<br />
using System;<br />
using System.Collections.Generic;<br />
using UnityEngine;<br />
<br />
static internal class Messenger {<br />
	#region Internal variables<br />
<br />
	//Disable the unused variable warning<br />
#pragma warning disable 0414<br />
	//Ensures that the MessengerHelper will be created automatically upon start of the game.<br />
	static private MessengerHelper messengerHelper = ( new GameObject(&quot;MessengerHelper&quot;) ).AddComponent&lt; MessengerHelper &gt;();<br />
#pragma warning restore 0414<br />
	<br />
	static public Dictionary&lt;string, Delegate&gt; eventTable = new Dictionary&lt;string, Delegate&gt;();<br />
<br />
	//Message handlers that should never be removed, regardless of calling Cleanup<br />
	static public List&lt; string &gt; permanentMessages = new List&lt; string &gt; ();<br />
	#endregion<br />
	#region Helper methods<br />
	//Marks a certain message as permanent.<br />
	static public void MarkAsPermanent(string eventType) {<br />
#if LOG_ALL_MESSAGES<br />
		Debug.Log(&quot;Messenger MarkAsPermanent &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&quot;);<br />
#endif<br />
		<br />
		permanentMessages.Add( eventType );<br />
	}<br />
<br />
	<br />
	static public void Cleanup()<br />
	{<br />
#if LOG_ALL_MESSAGES<br />
		Debug.Log(&quot;MESSENGER Cleanup. Make sure that none of necessary listeners are removed.&quot;);<br />
#endif<br />
		<br />
		List&lt; string &gt; messagesToRemove = new List&lt;string&gt;();<br />
		<br />
		foreach (KeyValuePair&lt;string, Delegate&gt; pair in eventTable) {<br />
			bool wasFound = false;<br />
			<br />
			foreach (string message in permanentMessages) {<br />
				if (pair.Key == message) {<br />
					wasFound = true;<br />
					break;<br />
				}<br />
			}<br />
			<br />
			if (!wasFound)<br />
				messagesToRemove.Add( pair.Key );<br />
		}<br />
		<br />
		foreach (string message in messagesToRemove) {<br />
			eventTable.Remove( message );<br />
		}<br />
	}<br />
	<br />
	static public void PrintEventTable()<br />
	{<br />
		Debug.Log(&quot;&#92;t&#92;t&#92;t=== MESSENGER PrintEventTable ===&quot;);<br />
		<br />
		foreach (KeyValuePair&lt;string, Delegate&gt; pair in eventTable) {<br />
			Debug.Log(&quot;&#92;t&#92;t&#92;t&quot; + pair.Key + &quot;&#92;t&#92;t&quot; + pair.Value);<br />
		}<br />
		<br />
		Debug.Log(&quot;&#92;n&quot;);<br />
	}<br />
	#endregion<br />
	<br />
	#region Message logging and exception throwing<br />
    static public void OnListenerAdding(string eventType, Delegate listenerBeingAdded) {<br />
#if LOG_ALL_MESSAGES || LOG_ADD_LISTENER<br />
		Debug.Log(&quot;MESSENGER OnListenerAdding &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&#92;t{&quot; + listenerBeingAdded.Target + &quot; -&gt; &quot; + listenerBeingAdded.Method + &quot;}&quot;);<br />
#endif<br />
		<br />
        if (!eventTable.ContainsKey(eventType)) {<br />
            eventTable.Add(eventType, null );<br />
        }<br />
<br />
        Delegate d = eventTable[eventType];<br />
        if (d != null &amp;&amp; d.GetType() != listenerBeingAdded.GetType()) {<br />
            throw new ListenerException(string.Format(&quot;Attempting to add listener with inconsistent signature for event type {0}. Current listeners have type {1} and listener being added has type {2}&quot;, eventType, d.GetType().Name, listenerBeingAdded.GetType().Name));<br />
        }<br />
    }<br />
<br />
    static public void OnListenerRemoving(string eventType, Delegate listenerBeingRemoved) {<br />
#if LOG_ALL_MESSAGES<br />
		Debug.Log(&quot;MESSENGER OnListenerRemoving &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&#92;t{&quot; + listenerBeingRemoved.Target + &quot; -&gt; &quot; + listenerBeingRemoved.Method + &quot;}&quot;);<br />
#endif<br />
		<br />
        if (eventTable.ContainsKey(eventType)) {<br />
            Delegate d = eventTable[eventType];<br />
<br />
            if (d == null) {<br />
                throw new ListenerException(string.Format(&quot;Attempting to remove listener with for event type &#92;&quot;{0}&#92;&quot; but current listener is null.&quot;, eventType));<br />
            } else if (d.GetType() != listenerBeingRemoved.GetType()) {<br />
                throw new ListenerException(string.Format(&quot;Attempting to remove listener with inconsistent signature for event type {0}. Current listeners have type {1} and listener being removed has type {2}&quot;, eventType, d.GetType().Name, listenerBeingRemoved.GetType().Name));<br />
            }<br />
        } else {<br />
            throw new ListenerException(string.Format(&quot;Attempting to remove listener for type &#92;&quot;{0}&#92;&quot; but Messenger doesn't know about this event type.&quot;, eventType));<br />
        }<br />
    }<br />
<br />
    static public void OnListenerRemoved(string eventType) {<br />
        if (eventTable[eventType] == null) {<br />
            eventTable.Remove(eventType);<br />
        }<br />
    }<br />
<br />
    static public void OnBroadcasting(string eventType) {<br />
#if REQUIRE_LISTENER<br />
        if (!eventTable.ContainsKey(eventType)) {<br />
            throw new BroadcastException(string.Format(&quot;Broadcasting message &#92;&quot;{0}&#92;&quot; but no listener found. Try marking the message with Messenger.MarkAsPermanent.&quot;, eventType));<br />
        }<br />
#endif<br />
    }<br />
<br />
    static public BroadcastException CreateBroadcastSignatureException(string eventType) {<br />
        return new BroadcastException(string.Format(&quot;Broadcasting message &#92;&quot;{0}&#92;&quot; but listeners have a different signature than the broadcaster.&quot;, eventType));<br />
    }<br />
<br />
    public class BroadcastException : Exception {<br />
        public BroadcastException(string msg)<br />
            : base(msg) {<br />
        }<br />
    }<br />
<br />
    public class ListenerException : Exception {<br />
        public ListenerException(string msg)<br />
            : base(msg) {<br />
        }<br />
    }<br />
	#endregion<br />
	<br />
	#region AddListener<br />
	//No parameters<br />
    static public void AddListener(string eventType, Callback handler) {<br />
        OnListenerAdding(eventType, handler);<br />
        eventTable[eventType] = (Callback)eventTable[eventType] + handler;<br />
    }<br />
	<br />
	//Single parameter<br />
	static public void AddListener&lt;T&gt;(string eventType, Callback&lt;T&gt; handler) {<br />
        OnListenerAdding(eventType, handler);<br />
        eventTable[eventType] = (Callback&lt;T&gt;)eventTable[eventType] + handler;<br />
    }<br />
	<br />
	//Two parameters<br />
	static public void AddListener&lt;T, U&gt;(string eventType, Callback&lt;T, U&gt; handler) {<br />
        OnListenerAdding(eventType, handler);<br />
        eventTable[eventType] = (Callback&lt;T, U&gt;)eventTable[eventType] + handler;<br />
    }<br />
	<br />
	//Three parameters<br />
	static public void AddListener&lt;T, U, V&gt;(string eventType, Callback&lt;T, U, V&gt; handler) {<br />
        OnListenerAdding(eventType, handler);<br />
        eventTable[eventType] = (Callback&lt;T, U, V&gt;)eventTable[eventType] + handler;<br />
    }<br />
	#endregion<br />
	<br />
	#region RemoveListener<br />
	//No parameters<br />
    static public void RemoveListener(string eventType, Callback handler) {<br />
        OnListenerRemoving(eventType, handler);   <br />
        eventTable[eventType] = (Callback)eventTable[eventType] - handler;<br />
        OnListenerRemoved(eventType);<br />
    }<br />
	<br />
	//Single parameter<br />
	static public void RemoveListener&lt;T&gt;(string eventType, Callback&lt;T&gt; handler) {<br />
        OnListenerRemoving(eventType, handler);<br />
        eventTable[eventType] = (Callback&lt;T&gt;)eventTable[eventType] - handler;<br />
        OnListenerRemoved(eventType);<br />
    }<br />
	<br />
	//Two parameters<br />
	static public void RemoveListener&lt;T, U&gt;(string eventType, Callback&lt;T, U&gt; handler) {<br />
        OnListenerRemoving(eventType, handler);<br />
        eventTable[eventType] = (Callback&lt;T, U&gt;)eventTable[eventType] - handler;<br />
        OnListenerRemoved(eventType);<br />
    }<br />
	<br />
	//Three parameters<br />
	static public void RemoveListener&lt;T, U, V&gt;(string eventType, Callback&lt;T, U, V&gt; handler) {<br />
        OnListenerRemoving(eventType, handler);<br />
        eventTable[eventType] = (Callback&lt;T, U, V&gt;)eventTable[eventType] - handler;<br />
        OnListenerRemoved(eventType);<br />
    }<br />
	#endregion<br />
	<br />
	#region Broadcast<br />
	//No parameters<br />
    static public void Broadcast(string eventType) {<br />
#if LOG_ALL_MESSAGES || LOG_BROADCAST_MESSAGE<br />
		Debug.Log(&quot;MESSENGER&#92;t&quot; + System.DateTime.Now.ToString(&quot;hh:mm:ss.fff&quot;) + &quot;&#92;t&#92;t&#92;tInvoking &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&quot;);<br />
#endif<br />
        OnBroadcasting(eventType);<br />
		<br />
        Delegate d;<br />
        if (eventTable.TryGetValue(eventType, out d)) {<br />
            Callback callback = d as Callback;<br />
<br />
            if (callback != null) {<br />
                callback();<br />
            } else {<br />
                throw CreateBroadcastSignatureException(eventType);<br />
            }<br />
        }<br />
    }<br />
	<br />
	//Single parameter<br />
    static public void Broadcast&lt;T&gt;(string eventType, T arg1) {<br />
#if LOG_ALL_MESSAGES || LOG_BROADCAST_MESSAGE<br />
		Debug.Log(&quot;MESSENGER&#92;t&quot; + System.DateTime.Now.ToString(&quot;hh:mm:ss.fff&quot;) + &quot;&#92;t&#92;t&#92;tInvoking &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&quot;);<br />
#endif<br />
        OnBroadcasting(eventType);<br />
		<br />
        Delegate d;<br />
        if (eventTable.TryGetValue(eventType, out d)) {<br />
            Callback&lt;T&gt; callback = d as Callback&lt;T&gt;;<br />
			<br />
            if (callback != null) {<br />
                callback(arg1);<br />
            } else {<br />
                throw CreateBroadcastSignatureException(eventType);<br />
            }<br />
        }<br />
	}<br />
	<br />
	//Two parameters<br />
    static public void Broadcast&lt;T, U&gt;(string eventType, T arg1, U arg2) {<br />
#if LOG_ALL_MESSAGES || LOG_BROADCAST_MESSAGE<br />
		Debug.Log(&quot;MESSENGER&#92;t&quot; + System.DateTime.Now.ToString(&quot;hh:mm:ss.fff&quot;) + &quot;&#92;t&#92;t&#92;tInvoking &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&quot;);<br />
#endif<br />
        OnBroadcasting(eventType);<br />
		<br />
        Delegate d;<br />
        if (eventTable.TryGetValue(eventType, out d)) {<br />
            Callback&lt;T, U&gt; callback = d as Callback&lt;T, U&gt;;<br />
			<br />
            if (callback != null) {<br />
                callback(arg1, arg2);<br />
            } else {<br />
                throw CreateBroadcastSignatureException(eventType);<br />
            }<br />
        }<br />
    }<br />
	<br />
	//Three parameters<br />
    static public void Broadcast&lt;T, U, V&gt;(string eventType, T arg1, U arg2, V arg3) {<br />
#if LOG_ALL_MESSAGES || LOG_BROADCAST_MESSAGE<br />
		Debug.Log(&quot;MESSENGER&#92;t&quot; + System.DateTime.Now.ToString(&quot;hh:mm:ss.fff&quot;) + &quot;&#92;t&#92;t&#92;tInvoking &#92;t&#92;&quot;&quot; + eventType + &quot;&#92;&quot;&quot;);<br />
#endif<br />
        OnBroadcasting(eventType);<br />
		<br />
        Delegate d;<br />
        if (eventTable.TryGetValue(eventType, out d)) {<br />
            Callback&lt;T, U, V&gt; callback = d as Callback&lt;T, U, V&gt;;<br />
<br />
            if (callback != null) {<br />
                callback(arg1, arg2, arg3);<br />
            } else {<br />
                throw CreateBroadcastSignatureException(eventType);<br />
            }<br />
        }<br />
    }<br />
	#endregion<br />
}<br />
<br />
//This manager will ensure that the messenger's eventTable will be cleaned up upon loading of a new level.<br />
public sealed class MessengerHelper : MonoBehaviour {<br />
	void Awake ()<br />
	{<br />
		DontDestroyOnLoad(gameObject);	<br />
	}<br />
	<br />
	//Clean up eventTable every time a new level loads.<br />
	public void OnDisable() {<br />
		Messenger.Cleanup();<br />
	}<br />
}<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/19/advanced-csharp-messenger-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LoadAssetBundle &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/17/loadassetbundle-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/17/loadassetbundle-unify-wiki/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 10:56:24 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=LoadAssetBundle</guid>
		<description><![CDATA[DbIMok: Unloading errors fixed

[[Category:Editor Scripts]]
[[Category:AssetBundle]]
Author: DbIMok

==Description==
The purpose of this script is to load content of selected AssetBundle in Editor

==Usage==
Like all Editor scripts, this has to be put ...]]></description>
			<content:encoded><![CDATA[<p>DbIMok: Unloading errors fixed</p>
<hr />
<div>[[Category:Editor Scripts]]<br />
[[Category:AssetBundle]]<br />
Author: DbIMok<br />
<br />
==Description==<br />
The purpose of this script is to load content of selected AssetBundle in Editor<br />
<br />
==Usage==<br />
Like all Editor scripts, this has to be put into a folder named ''Editor'', somewhere in your Assets folder. Click on .unity3d file in Project window right mouse button and select Ext/Load Bundle.<br />
<br />
==C# - LoadBundle.cs==<br />
&lt;csharp&gt;using UnityEngine;<br />
using UnityEditor;<br />
using System.IO;<br />
using System.Collections.Generic;<br />
using System.Security.Cryptography;<br />
<br />
public class LoadBundle : EditorWindow<br />
{<br />
	/// &lt;summary&gt;<br />
	/// Relative path to AssetBundle file<br />
	/// &lt;/summary&gt;<br />
	private static string _pathBundle;<br />
	/// &lt;summary&gt;<br />
	/// Dictionary for loaded AssetBundles<br />
	/// &lt;/summary&gt;<br />
	private static Dictionary&lt;string, AssetBundle&gt; _bundles = new Dictionary&lt;string, AssetBundle&gt;();<br />
	/// &lt;summary&gt;<br />
	/// Dictionary for hashes of loaded AssetBundles<br />
	/// &lt;/summary&gt;<br />
	private static Dictionary&lt;string, byte[]&gt; _bundlesHash = new Dictionary&lt;string, byte[]&gt;();<br />
	/// &lt;summary&gt;<br />
	/// EditorWindow instance<br />
	/// &lt;/summary&gt;<br />
	private static LoadBundle _wnd;<br />
<br />
	/// &lt;summary&gt;<br />
	/// URL to AssetBundle file<br />
	/// &lt;/summary&gt;<br />
	private string _url;<br />
	/// &lt;summary&gt;<br />
	/// Check for Run<br />
	/// &lt;/summary&gt;<br />
	private bool _isRun;<br />
	/// &lt;summary&gt;<br />
	/// Check for Loaded<br />
	/// &lt;/summary&gt;<br />
	private bool _isLoaded;<br />
	/// &lt;summary&gt;<br />
	/// WWW loader<br />
	/// &lt;/summary&gt;<br />
	private WWW _loader;<br />
	/// &lt;summary&gt;<br />
	/// Instance of MD5 hash class<br />
	/// &lt;/summary&gt;<br />
	private MD5 _hash = MD5.Create();<br />
<br />
	/// &lt;summary&gt;<br />
	/// Menu validator Assets/Ext/Load Bundle<br />
	/// &lt;/summary&gt;<br />
	[MenuItem(&quot;Assets/Ext/Load Bundle&quot;, true)]<br />
	public static bool LoadBundleValidator()<br />
	{<br />
		_pathBundle = AssetDatabase.GetAssetPath(Selection.activeObject);<br />
		return Path.GetExtension(_pathBundle) == &quot;.unity3d&quot;;<br />
	}<br />
	/// &lt;summary&gt;<br />
	/// Menu Assets/Ext/Load Bundle<br />
	/// &lt;/summary&gt;<br />
	[MenuItem(&quot;Assets/Ext/Load Bundle&quot;)]<br />
	public static void LoadBundleToScene()<br />
	{<br />
		BundleToScene();<br />
	}<br />
	/// &lt;summary&gt;<br />
	/// Menu Assets/Ext/Unload Bundles<br />
	/// &lt;/summary&gt;<br />
	[MenuItem(&quot;Assets/Ext/Unload Bundles&quot;)]<br />
	public static void UnloadAll()<br />
	{<br />
		if (_wnd != null)<br />
		{<br />
			_wnd.Close();<br />
			Destroy(_wnd);<br />
		}<br />
		foreach (AssetBundle assetBundle in _bundles.Values)<br />
		{<br />
			assetBundle.Unload(true);<br />
		}<br />
		_bundles.Clear();<br />
		_bundlesHash.Clear();<br />
	}<br />
<br />
	/// &lt;summary&gt;<br />
	/// Init EditorWindow<br />
	/// &lt;/summary&gt;<br />
	static void BundleToScene()<br />
	{<br />
		GetWindowWithRect&lt;LoadBundle&gt;(new Rect(0,0,1,1));<br />
	}<br />
	/// &lt;summary&gt;<br />
	/// Update for EditorWindow<br />
	/// &lt;/summary&gt;<br />
	void Update()<br />
	{<br />
		if (!_isRun)<br />
		{<br />
			_isRun = true;<br />
			if (IsLoaded()) Close();<br />
		} else {<br />
			while ((_loader.assetBundle == null) &amp;&amp; string.IsNullOrEmpty(_loader.error))<br />
			{<br />
				return;<br />
			}<br />
			if (_loader.assetBundle != null)<br />
			{<br />
				Instantiate(_loader.assetBundle.mainAsset);<br />
				_bundles.Add(_pathBundle, _loader.assetBundle);<br />
				_bundlesHash.Add(_pathBundle, _hash.ComputeHash(_loader.bytes));<br />
			}<br />
			else<br />
			{<br />
				Debug.LogWarning(_loader.error);				<br />
			}<br />
			Close();<br />
		}<br />
	}<br />
	/// &lt;summary&gt;<br />
	/// Check for already loaded bundles<br />
	/// &lt;/summary&gt;<br />
	/// &lt;returns&gt;&lt;/returns&gt;<br />
	bool IsLoaded()<br />
	{<br />
		_url = string.Concat(&quot;file:///&quot;, Application.dataPath, &quot;/../&quot;, _pathBundle);<br />
		if (_bundles.ContainsKey(_pathBundle))<br />
		{<br />
			if (!CheckHash())<br />
			{<br />
				_bundles.Remove(_pathBundle);<br />
				_bundlesHash.Remove(_pathBundle);<br />
				_loader = new WWW(_url);<br />
				return false;<br />
			}<br />
			Instantiate(_bundles[_pathBundle].mainAsset);<br />
			return true;<br />
		} <br />
		else<br />
		{<br />
			_loader = new WWW(_url);<br />
			return false;<br />
		}<br />
	}<br />
	/// &lt;summary&gt;<br />
	/// Check hash for loaded AssetBundle and file<br />
	/// &lt;/summary&gt;<br />
	/// &lt;returns&gt;&lt;/returns&gt;<br />
	bool CheckHash()<br />
	{<br />
		StreamReader sr = new StreamReader(string.Concat(Application.dataPath, &quot;/../&quot;, _pathBundle));<br />
		byte[] _filehash = _hash.ComputeHash(sr.BaseStream);<br />
		for (int i = 0; i &lt; _filehash.Length; i++)<br />
		{<br />
			if (_filehash[i] != _bundlesHash[_pathBundle][i]) return false;<br />
		}<br />
		return true;<br />
	}<br />
}&lt;/csharp&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/17/loadassetbundle-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LoadAssetBundle &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/17/loadassetbundle-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/17/loadassetbundle-unify-wiki-2/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 10:56:24 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=LoadAssetBundle</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/csharp&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

[[Category:Editor Scripts]]
[[Category:AssetBundle]]
Author: DbIMok

==Description==
The purpose of this script is to load content of selected AssetBundle in E...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/csharp&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>[[Category:Editor Scripts]]<br />
[[Category:AssetBundle]]<br />
Author: DbIMok<br />
<br />
==Description==<br />
The purpose of this script is to load content of selected AssetBundle in Editor<br />
<br />
==Usage==<br />
Like all Editor scripts, this has to be put into a folder named ''Editor'', somewhere in your Assets folder. Click on .unity3d file in Project window right mouse button and select Ext/Load Bundle.<br />
<br />
==C# - LoadBundle.cs==<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;using UnityEngine;<br />
using UnityEditor;<br />
using System.IO;<br />
using System.Collections.Generic;<br />
using System.Security.Cryptography;<br />
<br />
public class LoadBundle : EditorWindow<br />
{<br />
	/// &lt;summary&gt;<br />
	/// Relative path to AssetBundle file<br />
	/// &lt;/summary&gt;<br />
	private static string _pathBundle;<br />
	/// &lt;summary&gt;<br />
	/// Dictionary for loaded AssetBundles<br />
	/// &lt;/summary&gt;<br />
	private static Dictionary&lt;string, AssetBundle&gt; _bundles = new Dictionary&lt;string, AssetBundle&gt;();<br />
	/// &lt;summary&gt;<br />
	/// Dictionary for hashes of loaded AssetBundles<br />
	/// &lt;/summary&gt;<br />
	private static Dictionary&lt;string, byte[]&gt; _bundlesHash = new Dictionary&lt;string, byte[]&gt;();<br />
	/// &lt;summary&gt;<br />
	/// EditorWindow instance<br />
	/// &lt;/summary&gt;<br />
	private static LoadBundle _wnd;<br />
<br />
	/// &lt;summary&gt;<br />
	/// URL to AssetBundle file<br />
	/// &lt;/summary&gt;<br />
	private string _url;<br />
	/// &lt;summary&gt;<br />
	/// Check for Run<br />
	/// &lt;/summary&gt;<br />
	private bool _isRun;<br />
	/// &lt;summary&gt;<br />
	/// Check for Loaded<br />
	/// &lt;/summary&gt;<br />
	private bool _isLoaded;<br />
	/// &lt;summary&gt;<br />
	/// WWW loader<br />
	/// &lt;/summary&gt;<br />
	private WWW _loader;<br />
	/// &lt;summary&gt;<br />
	/// Instance of MD5 hash class<br />
	/// &lt;/summary&gt;<br />
	private MD5 _hash = MD5.Create();<br />
<br />
	/// &lt;summary&gt;<br />
	/// Menu validator Assets/Ext/Load Bundle<br />
	/// &lt;/summary&gt;<br />
	[MenuItem(&quot;Assets/Ext/Load Bundle&quot;, true)]<br />
	public static bool LoadBundleValidator()<br />
	{<br />
		_pathBundle = AssetDatabase.GetAssetPath(Selection.activeObject);<br />
		return Path.GetExtension(_pathBundle) == &quot;.unity3d&quot;;<br />
	}<br />
	/// &lt;summary&gt;<br />
	/// Menu Assets/Ext/Load Bundle<br />
	/// &lt;/summary&gt;<br />
	[MenuItem(&quot;Assets/Ext/Load Bundle&quot;)]<br />
	public static void LoadBundleToScene()<br />
	{<br />
		BundleToScene();<br />
	}<br />
	/// &lt;summary&gt;<br />
	/// Menu Assets/Ext/Unload Bundles<br />
	/// &lt;/summary&gt;<br />
	[MenuItem(&quot;Assets/Ext/Unload Bundles&quot;)]<br />
	public static void UnloadAll()<br />
	{<br />
		if (_wnd != null)<br />
		{<br />
			_wnd.Close();<br />
			Destroy(_wnd);<br />
		}<br />
		foreach (AssetBundle assetBundle in _bundles.Values)<br />
		{<br />
			assetBundle.Unload(true);<br />
		}<br />
		_bundles.Clear();<br />
		_bundlesHash.Clear();<br />
	}<br />
<br />
	/// &lt;summary&gt;<br />
	/// Init EditorWindow<br />
	/// &lt;/summary&gt;<br />
	static void BundleToScene()<br />
	{<br />
		GetWindowWithRect&lt;LoadBundle&gt;(new Rect(0,0,1,1));<br />
	}<br />
	/// &lt;summary&gt;<br />
	/// Update for EditorWindow<br />
	/// &lt;/summary&gt;<br />
	void Update()<br />
	{<br />
		if (!_isRun)<br />
		{<br />
			_isRun = true;<br />
			if (IsLoaded()) Close();<br />
		} else {<br />
			while ((_loader.assetBundle == null) &amp;&amp; string.IsNullOrEmpty(_loader.error))<br />
			{<br />
				return;<br />
			}<br />
			if (_loader.assetBundle != null)<br />
			{<br />
				Instantiate(_loader.assetBundle.mainAsset);<br />
				_bundles.Add(_pathBundle, _loader.assetBundle);<br />
				_bundlesHash.Add(_pathBundle, _hash.ComputeHash(_loader.bytes));<br />
			}<br />
			else<br />
			{<br />
				Debug.LogWarning(_loader.error);				<br />
			}<br />
			Close();<br />
		}<br />
	}<br />
	/// &lt;summary&gt;<br />
	/// Check for already loaded bundles<br />
	/// &lt;/summary&gt;<br />
	/// &lt;returns&gt;&lt;/returns&gt;<br />
	bool IsLoaded()<br />
	{<br />
		_url = string.Concat(&quot;file:///&quot;, Application.dataPath, &quot;/../&quot;, _pathBundle);<br />
		if (_bundles.ContainsKey(_pathBundle))<br />
		{<br />
			if (!CheckHash())<br />
			{<br />
				_bundles.Remove(_pathBundle);<br />
				_bundlesHash.Remove(_pathBundle);<br />
				_loader = new WWW(_url);<br />
				return false;<br />
			}<br />
			Instantiate(_bundles[_pathBundle].mainAsset);<br />
			return true;<br />
		} <br />
		else<br />
		{<br />
			_loader = new WWW(_url);<br />
			return false;<br />
		}<br />
	}<br />
	/// &lt;summary&gt;<br />
	/// Check hash for loaded AssetBundle and file<br />
	/// &lt;/summary&gt;<br />
	/// &lt;returns&gt;&lt;/returns&gt;<br />
	bool CheckHash()<br />
	{<br />
		StreamReader sr = new StreamReader(string.Concat(Application.dataPath, &quot;/../&quot;, _pathBundle));<br />
		byte[] _filehash = _hash.ComputeHash(sr.BaseStream);<br />
		for (int i = 0; i &lt; _filehash.Length; i++)<br />
		{<br />
			if (_filehash[i] != _bundlesHash[_pathBundle][i]) return false;<br />
		}<br />
		return true;<br />
	}<br />
}&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/17/loadassetbundle-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AutoBuilder &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/16/autobuilder-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/16/autobuilder-unify-wiki/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 19:41:56 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=AutoBuilder</guid>
		<description><![CDATA[Thinksquirrel: /* C# - AutoBuilder.cs */

Author: Josh Montoute

==Description==
Some static methods that change the target platform and create a build.

==Usage==
Place this script in ''YourProject/Assets/Editor''. Go to File &#62; AutoBuilder and sele...]]></description>
			<content:encoded><![CDATA[<p>Thinksquirrel: /* C# - AutoBuilder.cs */</p>
<hr />
<div>Author: Josh Montoute<br />
<br />
==Description==<br />
Some static methods that change the target platform and create a build.<br />
<br />
==Usage==<br />
Place this script in ''YourProject/Assets/Editor''. Go to File &gt; AutoBuilder and select a platform. These methods can also be run from the Unity command line using -executeMethod AutoBuilder.MethodName.<br />
<br />
== C# - AutoBuilder.cs ==<br />
<br />
&lt;csharp&gt;<br />
/* <br />
AutoBuilder.cs<br />
Automatically changes the target platform and creates a build.<br />
<br />
Installation<br />
Place in an Editor folder.<br />
<br />
Usage<br />
Go to File &gt; AutoBuilder and select a platform. These methods can also be run from the Unity command line using -executeMethod AutoBuilder.MethodName.<br />
<br />
License<br />
Copyright (C) 2011 by Thinksquirrel Software, LLC<br />
<br />
Permission is hereby granted, free of charge, to any person obtaining a copy<br />
of this software and associated documentation files (the &quot;Software&quot;), to deal<br />
in the Software without restriction, including without limitation the rights<br />
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br />
copies of the Software, and to permit persons to whom the Software is<br />
furnished to do so, subject to the following conditions:<br />
<br />
The above copyright notice and this permission notice shall be included in<br />
all copies or substantial portions of the Software.<br />
<br />
THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br />
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br />
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br />
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br />
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br />
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br />
THE SOFTWARE.<br />
 */<br />
using UnityEngine;<br />
using UnityEditor;<br />
using System.Collections;<br />
using System.Collections.Generic;<br />
using System.IO;<br />
<br />
public static class AutoBuilder {<br />
<br />
	static string GetProjectName()<br />
	{<br />
		string[] s = Application.dataPath.Split('/');<br />
		return s[s.Length - 2];<br />
	}<br />
	<br />
	static string[] GetScenePaths()<br />
	{<br />
		string[] scenes = new string[EditorBuildSettings.scenes.Length];<br />
<br />
		for(int i = 0; i &lt; scenes.Length; i++)<br />
		{<br />
			scenes[i] = EditorBuildSettings.scenes[i].path;<br />
		}<br />
		<br />
		return scenes;<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/Windows/32-bit&quot;)]<br />
	static void PerformWinBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/Win/&quot; + GetProjectName() + &quot;.exe&quot;,BuildTarget.StandaloneWindows,BuildOptions.None);<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/Windows/64-bit&quot;)]<br />
	static void PerformWin64Build ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/Win64/&quot; + GetProjectName() + &quot;.exe&quot;,BuildTarget.StandaloneWindows64,BuildOptions.None);<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/Mac OSX/Universal&quot;)]<br />
	static void PerformOSXUniversalBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneOSXUniversal);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/OSX-Universal/&quot; + GetProjectName() + &quot;.app&quot;,BuildTarget.StandaloneOSXUniversal,BuildOptions.None);<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/Mac OSX/Intel&quot;)]<br />
	static void PerformOSXIntelBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneOSXIntel);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/OSX-Intel/&quot; + GetProjectName() + &quot;.app&quot;,BuildTarget.StandaloneOSXIntel,BuildOptions.None);<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/Mac OSX/PPC&quot;)]<br />
	static void PerformOSXPPCBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneOSXPPC);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/OSX-PPC/&quot; + GetProjectName() + &quot;.app&quot;,BuildTarget.StandaloneOSXPPC,BuildOptions.None);<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/Mac OSX/Dashboard&quot;)]<br />
	static void PerformOSXDashboardBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.DashboardWidget);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/OSX-Dashboard/&quot; + GetProjectName() + &quot;.wdgt&quot;,BuildTarget.DashboardWidget,BuildOptions.None);<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/iOS&quot;)]<br />
	static void PerformiOSBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.iPhone);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/iOS&quot;,BuildTarget.iPhone,BuildOptions.None);<br />
	}<br />
	[MenuItem(&quot;File/AutoBuilder/Android&quot;)]<br />
	static void PerformAndroidBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.Android);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/Android&quot;,BuildTarget.Android,BuildOptions.None);<br />
	}<br />
	[MenuItem(&quot;File/AutoBuilder/Web/Standard&quot;)]<br />
	static void PerformWebBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.WebPlayer);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/Web&quot;,BuildTarget.WebPlayer,BuildOptions.None);<br />
	}<br />
	[MenuItem(&quot;File/AutoBuilder/Web/Streamed&quot;)]<br />
	static void PerformWebStreamedBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.WebPlayerStreamed);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/Web-Streamed&quot;,BuildTarget.WebPlayerStreamed,BuildOptions.None);<br />
	}<br />
}<br />
&lt;/csharp&gt;<br />
[[Category:Editor Scripts]]<br />
[[Category:C Sharp]]</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/16/autobuilder-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AutoBuilder &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/16/autobuilder-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/16/autobuilder-unify-wiki-2/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 19:41:56 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=AutoBuilder</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/csharp&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

Author: Josh Montoute

==Description==
Some static methods that change the target platform and create a build.

==Usage==
Place this script in ''YourProject/As...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/csharp&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>Author: Josh Montoute<br />
<br />
==Description==<br />
Some static methods that change the target platform and create a build.<br />
<br />
==Usage==<br />
Place this script in ''YourProject/Assets/Editor''. Go to File &gt; AutoBuilder and select a platform. These methods can also be run from the Unity command line using -executeMethod AutoBuilder.MethodName.<br />
<br />
== C# - AutoBuilder.cs ==<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
/* <br />
AutoBuilder.cs<br />
Automatically changes the target platform and creates a build.<br />
<br />
Installation<br />
Place in an Editor folder.<br />
<br />
Usage<br />
Go to File &gt; AutoBuilder and select a platform. These methods can also be run from the Unity command line using -executeMethod AutoBuilder.MethodName.<br />
<br />
License<br />
Copyright (C) 2011 by Thinksquirrel Software, LLC<br />
<br />
Permission is hereby granted, free of charge, to any person obtaining a copy<br />
of this software and associated documentation files (the &quot;Software&quot;), to deal<br />
in the Software without restriction, including without limitation the rights<br />
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br />
copies of the Software, and to permit persons to whom the Software is<br />
furnished to do so, subject to the following conditions:<br />
<br />
The above copyright notice and this permission notice shall be included in<br />
all copies or substantial portions of the Software.<br />
<br />
THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br />
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br />
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br />
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br />
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br />
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br />
THE SOFTWARE.<br />
 */<br />
using UnityEngine;<br />
using UnityEditor;<br />
using System.Collections;<br />
using System.Collections.Generic;<br />
using System.IO;<br />
<br />
public static class AutoBuilder {<br />
<br />
	static string GetProjectName()<br />
	{<br />
		string[] s = Application.dataPath.Split('/');<br />
		return s[s.Length - 2];<br />
	}<br />
	<br />
	static string[] GetScenePaths()<br />
	{<br />
		string[] scenes = new string[EditorBuildSettings.scenes.Length];<br />
<br />
		for(int i = 0; i &lt; scenes.Length; i++)<br />
		{<br />
			scenes[i] = EditorBuildSettings.scenes[i].path;<br />
		}<br />
		<br />
		return scenes;<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/Windows/32-bit&quot;)]<br />
	static void PerformWinBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/Win/&quot; + GetProjectName() + &quot;.exe&quot;,BuildTarget.StandaloneWindows,BuildOptions.None);<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/Windows/64-bit&quot;)]<br />
	static void PerformWin64Build ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/Win64/&quot; + GetProjectName() + &quot;.exe&quot;,BuildTarget.StandaloneWindows64,BuildOptions.None);<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/Mac OSX/Universal&quot;)]<br />
	static void PerformOSXUniversalBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneOSXUniversal);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/OSX-Universal/&quot; + GetProjectName() + &quot;.app&quot;,BuildTarget.StandaloneOSXUniversal,BuildOptions.None);<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/Mac OSX/Intel&quot;)]<br />
	static void PerformOSXIntelBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneOSXIntel);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/OSX-Intel/&quot; + GetProjectName() + &quot;.app&quot;,BuildTarget.StandaloneOSXIntel,BuildOptions.None);<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/Mac OSX/PPC&quot;)]<br />
	static void PerformOSXPPCBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneOSXPPC);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/OSX-PPC/&quot; + GetProjectName() + &quot;.app&quot;,BuildTarget.StandaloneOSXPPC,BuildOptions.None);<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/Mac OSX/Dashboard&quot;)]<br />
	static void PerformOSXDashboardBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.DashboardWidget);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/OSX-Dashboard/&quot; + GetProjectName() + &quot;.wdgt&quot;,BuildTarget.DashboardWidget,BuildOptions.None);<br />
	}<br />
	<br />
	[MenuItem(&quot;File/AutoBuilder/iOS&quot;)]<br />
	static void PerformiOSBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.iPhone);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/iOS&quot;,BuildTarget.iPhone,BuildOptions.None);<br />
	}<br />
	[MenuItem(&quot;File/AutoBuilder/Android&quot;)]<br />
	static void PerformAndroidBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.Android);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/Android&quot;,BuildTarget.Android,BuildOptions.None);<br />
	}<br />
	[MenuItem(&quot;File/AutoBuilder/Web/Standard&quot;)]<br />
	static void PerformWebBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.WebPlayer);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/Web&quot;,BuildTarget.WebPlayer,BuildOptions.None);<br />
	}<br />
	[MenuItem(&quot;File/AutoBuilder/Web/Streamed&quot;)]<br />
	static void PerformWebStreamedBuild ()<br />
	{<br />
		EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.WebPlayerStreamed);<br />
		BuildPipeline.BuildPlayer(GetScenePaths(), &quot;Builds/Web-Streamed&quot;,BuildTarget.WebPlayerStreamed,BuildOptions.None);<br />
	}<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
[[Category:Editor Scripts]]<br />
[[Category:C Sharp]]</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/16/autobuilder-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TextManager &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/16/textmanager-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/16/textmanager-unify-wiki/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 19:30:37 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=TextManager</guid>
		<description><![CDATA[Caue.rego: posting my first and probably last fork of kenlem TextManager script

== Disclaimer ==
Basically all credits go to [http://forum.unity3d.com/members/3744-kenlem kenlem] from the forums: http://forum.unity3d.com/threads/35617-TextManager-Loca...]]></description>
			<content:encoded><![CDATA[<p>Caue.rego: posting my first and probably last fork of kenlem TextManager script</p>
<hr />
<div>== Disclaimer ==<br />
Basically all credits go to [http://forum.unity3d.com/members/3744-kenlem kenlem] from the forums: http://forum.unity3d.com/threads/35617-TextManager-Localization-Script<br />
<br />
== Description ==<br />
Uses [http://en.wikipedia.org/wiki/Gettext gettext] along the lines of [http://en.wikipedia.org/wiki/Poedit poEdit] for translating text the GNU way!<br />
<br />
The concept is really simple as you can see under Usage and all you need is POT and PO files created by any po editor, or even just use your text editor of choice with the standards in mind.<br />
<br />
== Usage ==<br />
<br />
&lt;csharp&gt;<br />
// This will reset to default POT Language<br />
TextManager.LoadLanguage(null);<br />
<br />
// This will load filename-en.po<br />
TextManager.LoadLanguage(&quot;filename-en&quot;);<br />
<br />
// Considering the PO file has a msgid &quot;Ola Mundo&quot; and msgstr &quot;Hello World&quot; this will print &quot;Hello World&quot;<br />
print(TextManager.GetText(&quot;Ola Mundo&quot;));<br />
&lt;/csharp&gt;<br />
<br />
<br />
== TextManager.cs ==<br />
<br />
&lt;csharp&gt;<br />
using UnityEngine;<br />
using System.Collections;<br />
using System.IO;<br />
<br />
// originally found in: http://forum.unity3d.com/threads/35617-TextManager-Localization-Script<br />
<br />
/// &lt;summary&gt;<br />
/// TextManager<br />
/// <br />
/// Reads PO files in the Assets&#92;Resourcesanguages directory into a hashtable.<br />
/// look for &quot;po editors&quot; as that's a standard for translating software.<br />
/// <br />
/// example:<br />
/// <br />
/// load the language file:<br />
///   textmanager.loadlanguage(&quot;helptext-pt-br&quot;);<br />
/// <br />
/// which has to contain at least two lines as such:<br />
///   msgid &quot;hello world&quot;<br />
///   msgstr &quot;ola mundo&quot;<br />
/// <br />
/// then we can retrieve the text by calling:<br />
///   textmanager.gettext(&quot;hello world&quot;);<br />
/// &lt;/summary&gt;<br />
public class textmanager : monobehaviour {<br />
	<br />
	private static textmanager instance;<br />
	private static hashtable texttable;<br />
	private textmanager () {} <br />
<br />
	private static textmanager instance <br />
	{<br />
		get <br />
		{<br />
			if (instance == null) <br />
			{<br />
        		// because the textmanager is a component, we have to create a gameobject to attach it to.<br />
       	 		gameobject notificationobject = new gameobject(&quot;default textmanager&quot;);<br />
       	 		<br />
        		// add the dynamicobjectmanager component, and set it as the defaultcenter<br />
       			instance = (textmanager) notificationobject.addcomponent(typeof(textmanager));<br />
    		}<br />
			return instance;<br />
		}<br />
	}<br />
	<br />
	public static textmanager getinstance ()<br />
	{<br />
		return instance;<br />
	}	<br />
	<br />
	public static bool loadlanguage (string filename)<br />
	{<br />
		getinstance();<br />
		<br />
		if (filename == null)<br />
		{<br />
			debugconsole.log(&quot;[textmanager] loading default language.&quot;);<br />
			texttable = null; // reset to default<br />
			return false; // this means: call loadlanguage with null to reset to default<br />
		}<br />
		<br />
		string fullpath = &quot;languages/&quot; +  filename + &quot;.po&quot;; // the file is actually &quot;.txt&quot; in the end<br />
<br />
		textasset textasset = (textasset) resources.load(fullpath, typeof(textasset));<br />
		if (textasset == null) <br />
		{<br />
			debugconsole.logerror(&quot;[textmanager] &quot;+ fullpath +&quot; file not found.&quot;);<br />
			return false;<br />
		}<br />
		<br />
		debugconsole.log(&quot;[textmanager] loading: &quot;+ fullpath);<br />
		<br />
		if (texttable == null) <br />
		{<br />
			texttable = new hashtable();<br />
		}<br />
			<br />
		texttable.clear();<br />
		<br />
		stringreader reader = new stringreader(textasset.text);<br />
		string key = null;<br />
		string val = null;<br />
		string line;<br />
		while ( (line = reader.readline()) != null)<br />
		{<br />
			if (line.startswith(&quot;msgid &#92;&quot;&quot;))<br />
			{<br />
    			key = line.substring(7, line.length - 8);<br />
			}<br />
			else if (line.startswith(&quot;msgstr &#92;&quot;&quot;))<br />
			{<br />
    			val = line.substring(8, line.length - 9);<br />
			}<br />
			else<br />
			{<br />
	    		if (key != null &amp;&amp; val != null) <br />
	    		{<br />
	    			// todo: add error handling here in case of duplicate keys<br />
	    			texttable.add(key, val);<br />
					key = val = null;<br />
	    		} <br />
    		}<br />
		}<br />
		<br />
		reader.close();<br />
				<br />
		return true;<br />
	}<br />
<br />
	<br />
	public static string gettext (string key)<br />
	{<br />
		if (key != null &amp;&amp; texttable != null)<br />
		{<br />
			if (texttable.containskey(key))<br />
			{<br />
				string result = (string)texttable[key];<br />
				if (result.length &gt; 0)<br />
				{<br />
					key = result;<br />
				}<br />
			}<br />
		}<br />
		return key;<br />
	}<br />
}<br />
&lt;/csharp&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/16/textmanager-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TextManager &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/16/textmanager-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/16/textmanager-unify-wiki-2/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 19:30:37 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=TextManager</guid>
		<description><![CDATA[Ickylevel: /* TextManager.js */

== Disclaimer ==
Basically all credits go to [http://forum.unity3d.com/members/3744-kenlem kenlem] from the forums: http://forum.unity3d.com/threads/35617-TextManager-Localization-Script

== Description ==
Uses [http://...]]></description>
			<content:encoded><![CDATA[<p>Ickylevel: /* TextManager.js */</p>
<hr />
<div>== Disclaimer ==<br />
Basically all credits go to [http://forum.unity3d.com/members/3744-kenlem kenlem] from the forums: http://forum.unity3d.com/threads/35617-TextManager-Localization-Script<br />
<br />
== Description ==<br />
Uses [http://en.wikipedia.org/wiki/Gettext gettext] along the lines of [http://en.wikipedia.org/wiki/Poedit poEdit] for translating text the GNU way!<br />
<br />
The concept is really simple as you can see under Usage and all you need is POT and PO files created by any po editor, or even just use your text editor of choice with the standards in mind.<br />
<br />
== Usage ==<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
// This will reset to default POT Language<br />
TextManager.LoadLanguage(null);<br />
<br />
// This will load filename-en.po<br />
TextManager.LoadLanguage(&quot;filename-en&quot;);<br />
<br />
// Considering the PO file has a msgid &quot;Ola Mundo&quot; and msgstr &quot;Hello World&quot; this will print &quot;Hello World&quot;<br />
print(TextManager.GetText(&quot;Ola Mundo&quot;));<br />
&lt;/syntaxhighlight&gt;<br />
<br />
<br />
== TextManager.cs ==<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
using UnityEngine;<br />
using System.Collections;<br />
using System.IO;<br />
<br />
// originally found in: http://forum.unity3d.com/threads/35617-TextManager-Localization-Script<br />
<br />
/// &lt;summary&gt;<br />
/// TextManager<br />
/// <br />
/// Reads PO files in the Assets&#92;Resourcesanguages directory into a hashtable.<br />
/// look for &quot;po editors&quot; as that's a standard for translating software.<br />
/// <br />
/// example:<br />
/// <br />
/// load the language file:<br />
///   textmanager.loadlanguage(&quot;helptext-pt-br&quot;);<br />
/// <br />
/// which has to contain at least two lines as such:<br />
///   msgid &quot;hello world&quot;<br />
///   msgstr &quot;ola mundo&quot;<br />
/// <br />
/// then we can retrieve the text by calling:<br />
///   textmanager.gettext(&quot;hello world&quot;);<br />
/// &lt;/summary&gt;<br />
public class textmanager : monobehaviour {<br />
	<br />
	private static textmanager instance;<br />
	private static hashtable texttable;<br />
	private textmanager () {} <br />
<br />
	private static textmanager instance <br />
	{<br />
		get <br />
		{<br />
			if (instance == null) <br />
			{<br />
        		// because the textmanager is a component, we have to create a gameobject to attach it to.<br />
       	 		gameobject notificationobject = new gameobject(&quot;default textmanager&quot;);<br />
       	 		<br />
        		// add the dynamicobjectmanager component, and set it as the defaultcenter<br />
       			instance = (textmanager) notificationobject.addcomponent(typeof(textmanager));<br />
    		}<br />
			return instance;<br />
		}<br />
	}<br />
	<br />
	public static textmanager getinstance ()<br />
	{<br />
		return instance;<br />
	}	<br />
	<br />
	public static bool loadlanguage (string filename)<br />
	{<br />
		getinstance();<br />
		<br />
		if (filename == null)<br />
		{<br />
			debugconsole.log(&quot;[textmanager] loading default language.&quot;);<br />
			texttable = null; // reset to default<br />
			return false; // this means: call loadlanguage with null to reset to default<br />
		}<br />
		<br />
		string fullpath = &quot;languages/&quot; +  filename + &quot;.po&quot;; // the file is actually &quot;.txt&quot; in the end<br />
<br />
		textasset textasset = (textasset) resources.load(fullpath, typeof(textasset));<br />
		if (textasset == null) <br />
		{<br />
			debugconsole.logerror(&quot;[textmanager] &quot;+ fullpath +&quot; file not found.&quot;);<br />
			return false;<br />
		}<br />
		<br />
		debugconsole.log(&quot;[textmanager] loading: &quot;+ fullpath);<br />
		<br />
		if (texttable == null) <br />
		{<br />
			texttable = new hashtable();<br />
		}<br />
			<br />
		texttable.clear();<br />
		<br />
		stringreader reader = new stringreader(textasset.text);<br />
		string key = null;<br />
		string val = null;<br />
		string line;<br />
		while ( (line = reader.readline()) != null)<br />
		{<br />
			if (line.startswith(&quot;msgid &#92;&quot;&quot;))<br />
			{<br />
    			key = line.substring(7, line.length - 8);<br />
			}<br />
			else if (line.startswith(&quot;msgstr &#92;&quot;&quot;))<br />
			{<br />
    			val = line.substring(8, line.length - 9);<br />
			}<br />
			else<br />
			{<br />
	    		if (key != null &amp;&amp; val != null) <br />
	    		{<br />
	    			// todo: add error handling here in case of duplicate keys<br />
	    			texttable.add(key, val);<br />
					key = val = null;<br />
	    		} <br />
    		}<br />
		}<br />
		<br />
		reader.close();<br />
				<br />
		return true;<br />
	}<br />
<br />
	<br />
	public static string gettext (string key)<br />
	{<br />
		if (key != null &amp;&amp; texttable != null)<br />
		{<br />
			if (texttable.containskey(key))<br />
			{<br />
				string result = (string)texttable[key];<br />
				if (result.length &gt; 0)<br />
				{<br />
					key = result;<br />
				}<br />
			}<br />
		}<br />
		return key;<br />
	}<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
<br />
== textmanager.js ==<br />
added this js port. also fixed one error (don't remember what it was).<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
<br />
import system.io;//using system.io;<br />
import unityengine;<br />
import system.collections;<br />
<br />
// originally found in: http://forum.unity3d.com/threads/35617-textmanager-localization-script<br />
<br />
/// &lt;summary&gt;<br />
/// textmanager<br />
/// <br />
/// reads po files in the assets&#92;resourcesanguages directory into a hashtable.<br />
/// look for &quot;po editors&quot; as that's a standard for translating software.<br />
/// <br />
/// example:<br />
/// <br />
/// load the language file:<br />
///   textmanager.loadlanguage(&quot;helptext-pt-br&quot;);<br />
/// <br />
/// which has to contain at least two lines as such:<br />
///   msgid &quot;hello world&quot;<br />
///   msgstr &quot;ola mundo&quot;<br />
/// <br />
/// then we can retrieve the text by calling:<br />
///   textmanager.gettext(&quot;hello world&quot;);<br />
/// &lt;/summary&gt;<br />
class textmanager extends monobehaviour {<br />
    <br />
    static var instance:textmanager ;<br />
    static var texttable:hashtable ;<br />
<br />
<br />
    static function instance() <br />
    {<br />
      <br />
            if (instance == null) <br />
            {<br />
                // because the textmanager is a component, we have to create a gameobject to attach it to.<br />
                var notificationobject:gameobject  = new gameobject(&quot;default textmanager&quot;);<br />
                 <br />
                // add the dynamicobjectmanager component, and set it as the defaultcenter<br />
          	instance = notificationobject.addcomponent(typeof(textmanager));<br />
            }<br />
            return instance;<br />
        <br />
    }<br />
    <br />
    public static function getinstance ()<br />
    {<br />
        return instance();<br />
    }   <br />
    <br />
    public static function loadlanguage (filename:string)<br />
    {<br />
        getinstance();<br />
        <br />
        if (filename == null)<br />
        {<br />
            debug.log(&quot;[textmanager] loading default language.&quot;);<br />
            texttable = null; // reset to default<br />
            return false; // this means: call loadlanguage with null to reset to default<br />
        }<br />
        <br />
        var fullpath:string = &quot;languages/&quot; +  filename ; // the file is actually &quot;.txt&quot; in the end<br />
<br />
        var textasset:textasset =  resources.load(fullpath, typeof(textasset));<br />
        if (textasset == null) <br />
        {<br />
            debug.log(&quot;[textmanager] &quot;+ fullpath +&quot; file not found.&quot;);<br />
            return false;<br />
        }<br />
        <br />
        debug.log(&quot;[textmanager] loading: &quot;+ fullpath);<br />
        <br />
        if (texttable == null) <br />
        {<br />
            texttable = new hashtable();<br />
        }<br />
            <br />
        texttable.clear();<br />
        <br />
        var reader:stringreader  = new stringreader(textasset.text);<br />
        var key:string = null;<br />
        var val:string = null;<br />
        var line:string;<br />
        line = reader.readline();<br />
        while ( (line ) != null)<br />
        { <br />
      <br />
            if (line.startswith(&quot;msgid &#92;&quot;&quot;))<br />
            {<br />
                key = line.substring(7, line.length - 8);<br />
            }<br />
            else if (line.startswith(&quot;msgstr &#92;&quot;&quot;))<br />
            {<br />
                val = line.substring(8, line.length - 9);<br />
            }<br />
            <br />
            if (key != null &amp;&amp; val != null) <br />
            {<br />
                    // todo: add error handling here in case of duplicate keys<br />
                    texttable.add(key, val);<br />
                   <br />
                    key = val = null;<br />
            } <br />
            <br />
            line = reader.readline();<br />
        }<br />
        <br />
        reader.close();<br />
                <br />
        return true;<br />
    }<br />
<br />
    <br />
    public static function gettext (key:string)<br />
    {<br />
        if (key != null &amp;&amp; texttable != null)<br />
        {<br />
            if (texttable.containskey(key))<br />
            {<br />
                var result:string = texttable[key];<br />
                if (result.length &gt; 0)<br />
                {<br />
                    key = result;<br />
                }<br />
            }<br />
        }<br />
        return key;<br />
    }<br />
}<br />
<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/16/textmanager-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unity at the Massive Black Workshops &#124; Unity Technologies</title>
		<link>http://www.bydesigngames.com/2011/11/14/unity-at-the-massive-black-workshops-unity-technologies/</link>
		<comments>http://www.bydesigngames.com/2011/11/14/unity-at-the-massive-black-workshops-unity-technologies/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 21:15:17 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://blogs.unity3d.com/?p=6380</guid>
		<description><![CDATA[Our good friends at Massive Black, who include some of the most accomplished and talented artists in the industry, have invited Unity to participate in their annual workshop! Unity artist reps Joe Robins and Roald Hoyer-Hansen will be on hand to dispense knowledge to help attending artists get the most out of the Unity tools...]]></description>
			<content:encoded><![CDATA[<p><a rel="nofollow"  href="http://blogs.unity3d.com/2011/11/14/unity-at-the-massive-black-workshops/front_massiveblack_logo2/"><br />
</a><a rel="nofollow"  href="http://blogs.unity3d.com/2011/11/14/unity-at-the-massive-black-workshops/massiveblack/"><img class="aligncenter size-full wp-image-6393" title="MassiveBlack" src="http://blogs.unity3d.com/wp-content/uploads/2011/11/MassiveBlack.jpg" alt="" width="700" height="165"/></a></p>
<p>Our good friends at Massive Black, who include some of the most accomplished and talented artists in the industry, have invited Unity to participate in their annual workshop! Unity artist reps Joe Robins and Roald Hoyer-Hansen will be on hand to dispense knowledge to help attending artists get the most out of the Unity tools and engine.</p>
<p>Massive Black has been hard at work creating one of the most amazing visual treats that has been developed using Unity. This will be shown for the first time at the Massive Black workshop and we can’t wait to see the final results.</p>
<p>Monday November 21st, Roald is teaching &#8220;Creating Cool Games without a Programmer&#8221; at 2:30-4pm and Joe is teaching &#8220;Creating a multi-platform Real-time portfolio for your artwork using Unity&#8221; at 4:30-5:30pm.</p>
<p>You can check out more information at: <a rel="nofollow"  href="http://www.massiveblackworkshop.com/">massiveblackworkshop.com</a><a rel="nofollow"  href="http://www.massiveblackworkshop.com/#!"></a></p>
<p><a rel="nofollow"  href="http://www.massiveblackworkshop.com/#!"></a></p>
<p><a rel="nofollow"  href="http://www.massiveblackworkshop.com/#!"> </a></p>
<p><a rel="nofollow"  href="http://www.massiveblackworkshop.com/#!"></a></p>
<p><a rel="nofollow"  href="http://www.massiveblackworkshop.com/#!"></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/14/unity-at-the-massive-black-workshops-unity-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TextureSampler &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/10/texturesampler-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/10/texturesampler-unify-wiki/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 16:03:09 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=TextureSampler</guid>
		<description><![CDATA[Tenebrous: Created page with &#34;== Description == This is a simple class which (should) replicate the Texture2D.GetPixelBilinear function, but because it doesn't use Unity classes you can use it in other thread...&#34;

== Description ==
This is a ...]]></description>
			<content:encoded><![CDATA[<p>Tenebrous: Created page with &quot;== Description == This is a simple class which (should) replicate the Texture2D.GetPixelBilinear function, but because it doesn't use Unity classes you can use it in other thread...&quot;</p>
<hr />
<div>== Description ==<br />
This is a simple class which (should) replicate the Texture2D.GetPixelBilinear function, but because it doesn't use Unity classes you can use it in other threads.<br />
<br />
== Usage ==<br />
<br />
&lt;csharp&gt;<br />
// firstly create a new texture sampler<br />
TextureSampler tex = new TextureSampler( your Texture2D goes here );<br />
<br />
// then get the pixel you want<br />
Color p = tex.GetPixelBilinear( 0.5f, 0.5f 0;<br />
&lt;/csharp&gt;<br />
<br />
== Code ==<br />
<br />
=== CSharp - TextureSampler.cs ===<br />
<br />
&lt;csharp&gt;<br />
using UnityEngine;<br />
<br />
public class TextureSampler<br />
{<br />
    Color[] _data;<br />
    int _height;<br />
    int _width;<br />
<br />
    public Color GetPixelBilinear( float u, float v )<br />
    {<br />
        // from: http://en.wikipedia.org/wiki/Bilinear_filtering#Sample_code<br />
<br />
        u *= _width;<br />
        v *= _height;<br />
<br />
        int x = Mathf.FloorToInt( u );<br />
        int y = Mathf.FloorToInt( v );<br />
<br />
        float u_ratio = u - x;<br />
        float v_ratio = v - y;<br />
        float u_opposite = 1 - u_ratio;<br />
        float v_opposite = 1 - v_ratio;<br />
<br />
        return ( ( GetPixel( x, y ) * u_opposite + GetPixel( x + 1, y ) * u_ratio ) * v_opposite<br />
              + ( GetPixel( x, y + 1 ) * u_opposite + GetPixel( x + 1, y + 1 ) * u_ratio ) * v_ratio<br />
              );<br />
    }<br />
<br />
    public Color GetPixel( float x, float y )<br />
    {<br />
        int xi = (int)WrapBetween( x, 0.0f, (float)_width );<br />
        int yi = (int)WrapBetween( y, 0.0f, (float)_height );<br />
        return ( _data[yi * _width + xi] );<br />
    }<br />
<br />
    float Mod( float x, float y )<br />
    {<br />
        // from http://stackoverflow.com/questions/4633177/c-how-to-wrap-a-float-to-the-interval-pi-pi<br />
        if( 0 == y )<br />
            return( x );<br />
<br />
        return( x - y * Mathf.Floor(x/y) );<br />
    }<br />
<br />
    float WrapBetween( float value, float min, float max )<br />
    {<br />
        return Mod( value - min, max - min ) + min;<br />
    }<br />
<br />
    public TextureSampler( Texture2D source )<br />
    {<br />
        _data = source.GetPixels();<br />
        _width = source.width;<br />
        _height = source.height;<br />
    }<br />
}<br />
&lt;/csharp&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/10/texturesampler-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TextureSampler &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/10/texturesampler-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/10/texturesampler-unify-wiki-2/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 16:03:09 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=TextureSampler</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/csharp&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

== Description ==
This is a simple class which (should) replicate the Texture2D.GetPixelBilinear function, but because it doesn't use Unity classes you can use...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/csharp&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>== Description ==<br />
This is a simple class which (should) replicate the Texture2D.GetPixelBilinear function, but because it doesn't use Unity classes you can use it in other threads.<br />
<br />
== Usage ==<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
// firstly create a new texture sampler<br />
TextureSampler tex = new TextureSampler( your Texture2D goes here );<br />
<br />
// then get the pixel you want<br />
Color p = tex.GetPixelBilinear( 0.5f, 0.5f 0;<br />
&lt;/syntaxhighlight&gt;<br />
<br />
== Code ==<br />
<br />
=== CSharp - TextureSampler.cs ===<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
using UnityEngine;<br />
<br />
public class TextureSampler<br />
{<br />
    Color[] _data;<br />
    int _height;<br />
    int _width;<br />
<br />
    public Color GetPixelBilinear( float u, float v )<br />
    {<br />
        // from: http://en.wikipedia.org/wiki/Bilinear_filtering#Sample_code<br />
<br />
        u *= _width;<br />
        v *= _height;<br />
<br />
        int x = Mathf.FloorToInt( u );<br />
        int y = Mathf.FloorToInt( v );<br />
<br />
        float u_ratio = u - x;<br />
        float v_ratio = v - y;<br />
        float u_opposite = 1 - u_ratio;<br />
        float v_opposite = 1 - v_ratio;<br />
<br />
        return ( ( GetPixel( x, y ) * u_opposite + GetPixel( x + 1, y ) * u_ratio ) * v_opposite<br />
              + ( GetPixel( x, y + 1 ) * u_opposite + GetPixel( x + 1, y + 1 ) * u_ratio ) * v_ratio<br />
              );<br />
    }<br />
<br />
    public Color GetPixel( float x, float y )<br />
    {<br />
        int xi = (int)WrapBetween( x, 0.0f, (float)_width );<br />
        int yi = (int)WrapBetween( y, 0.0f, (float)_height );<br />
        return ( _data[yi * _width + xi] );<br />
    }<br />
<br />
    float Mod( float x, float y )<br />
    {<br />
        // from http://stackoverflow.com/questions/4633177/c-how-to-wrap-a-float-to-the-interval-pi-pi<br />
        if( 0 == y )<br />
            return( x );<br />
<br />
        return( x - y * Mathf.Floor(x/y) );<br />
    }<br />
<br />
    float WrapBetween( float value, float min, float max )<br />
    {<br />
        return Mod( value - min, max - min ) + min;<br />
    }<br />
<br />
    public TextureSampler( Texture2D source )<br />
    {<br />
        _data = source.GetPixels();<br />
        _width = source.width;<br />
        _height = source.height;<br />
    }<br />
}<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/10/texturesampler-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joystic &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/10/joystic-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/10/joystic-unify-wiki/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 09:08:32 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Joystic</guid>
		<description><![CDATA[Jmpp: Improve exception handling a bit, and some other fixes

[[Category: Scripts]]
[[Category: C Sharp]]

Author: Unity Technologies.&#60;br /&#62;
Translated into C# by [[User:Jmpp&#124;Juan Manuel Palacios]], with a slightly modified API.


==Description==...]]></description>
			<content:encoded><![CDATA[<p>Jmpp: Improve exception handling a bit, and some other fixes</p>
<hr />
<div>[[Category: Scripts]]<br />
[[Category: C Sharp]]<br />
<br />
Author: Unity Technologies.&lt;br /&gt;<br />
Translated into C# by [[User:Jmpp|Juan Manuel Palacios]], with a slightly modified API.<br />
<br />
<br />
==Description==<br />
<br />
This is the Joystick script developed by Unity Technologies in JavaScript, originally released with the [http://unity3d.com/support/resources/tutorials/penelope Penelope tutorial] and recently updated in the Unity 3.4.x release, translated into C# with a slightly modified API.<br />
<br />
<br />
== Usage==<br />
<br />
Script explanation &amp; usage instructions should be sought in the [http://unity3d.com/support/resources/tutorials/penelope Penelope tutorial]. The API variations to the original script are decribed below:<br />
<br />
* A '''fadeGUI''' boolean parameter was included to discern whether or not &quot;touchPad&quot; joysticks should be faded.<br />
* The '''IsFingerDown''' method was migrated to an equivalent read-only '''isFingerDown''' C# property that can be queried as follows: &lt;csharp&gt;if (joystick.isFingerDown) { }&lt;/csharp&gt;<br />
* The '''LatchedFinger''' method was similarly migrated to a write-only '''latchedFinger''' C# property that can be set as follows: &lt;csharp&gt;joystick.latchedFinger = touch.FingerId;&lt;/csharp&gt;<br />
* The public '''position''' member variable was transparently migrated to a public but read-only C# property for off-the-shelf client consumption.<br />
* Game-wide joysticks collection was moved to the '''Awake''' method away from '''Update''', the former itself employed instead of '''Start'''. This change is important because it involves the collection of the joysticks gameObjects based on the &quot;joysticks&quot; tag (customizable), which will cause an exception to be thrown when creating a joystick if not defined.<br />
* Public '''Enable''' &amp; '''Disable''' methods are provided for the corresponding actions, without needing to deactivate the entire joystick gameObject.<br />
* The '''ResetJoystick''' method was renamed '''Restart'''. Note: I'm far from happy with this new method naming; the ideal would of course be simply '''Reset''', but that's already a [http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.Reset.html MonoBehaviour reserved method] for in-Editor component resetting. Feel free to suggest a better naming in the [[{{TALKPAGENAME}}|Discussion]] page.<br />
<br />
==C# - Joystick.cs==<br />
 &lt;csharp&gt;using UnityEngine;<br />
using System;<br />
using System.Collections;<br />
using System.Collections.Generic;<br />
<br />
<br />
public class Boundary<br />
{<br />
    public Vector2 min = Vector2.zero;<br />
    public Vector2 max = Vector2.zero;<br />
}<br />
<br />
<br />
[RequireComponent(typeof(GUITexture))]<br />
public class Joystick : MonoBehaviour<br />
{<br />
<br />
    /* Is this joystick a TouchPad? */<br />
    public bool touchPad = false;<br />
    /* In case the joystick is a touchPad, should its GUI be faded when inactive? */<br />
    public bool fadeGUI = false;<br />
    /* Control when position is output */<br />
    public Vector2 deadZone = Vector2.zero;<br />
    /* Normalize output after the dead-zone? */<br />
    public bool normalize = false;<br />
    /* Current tap count */<br />
    public int tapCount = -1;<br />
<br />
    /* The touchZone of the joystick */<br />
    private Rect touchZone;<br />
<br />
    /* Finger last used on this joystick */<br />
    private int lastFingerId = -1;<br />
    /* How much time there is left for a tap to occur */<br />
    private float tapTimeWindow;<br />
    private Vector2 fingerDownPos;<br />
    /*<br />
     * Currently unused.<br />
    private float fingerDownTime;<br />
    */<br />
    private float firstDeltaTime;<br />
<br />
    /* Joystick graphic */<br />
    private GUITexture gui;<br />
    /* Default position / extents of the joystick graphic */<br />
    private Rect defaultRect;<br />
    /* Boundary for joystick graphic */<br />
    private Boundary guiBoundary = new Boundary();<br />
    /* Offset to apply to touch input */<br />
    private Vector2 guiTouchOffset;<br />
    /* Center of joystick */<br />
    private Vector2 guiCenter;<br />
<br />
    public bool isFingerDown<br />
    {<br />
        get<br />
        {<br />
            return (lastFingerId != -1);<br />
        }<br />
    }<br />
<br />
    public int latchedFinger<br />
    {<br />
        set<br />
        {<br />
            /* If another joystick has latched this finger, then we must release it */<br />
            if (lastFingerId == value)<br />
            {<br />
                Restart();<br />
            }<br />
        }<br />
    }<br />
<br />
    /* The position of the joystick on the screen ([-1, 1] in x,y) for clients to read. */<br />
    public Vector2 position<br />
    {<br />
        get;<br />
        private set;<br />
    }<br />
<br />
<br />
    private static string joysticksTag = &quot;joystick&quot;;<br />
    /* A static collection of all joysticks */<br />
    private static List&lt;Joystick&gt; joysticks;<br />
    /* Has the joysticks collection been enumerated yet? */<br />
    private static bool enumeratedJoysticks = false;<br />
    /* Time allowed between taps */<br />
    private static float tapTimeDelta = 0.3f;<br />
<br />
<br />
    private void Reset()<br />
    {<br />
        try<br />
        {<br />
            gameObject.tag = joysticksTag;<br />
        }<br />
        catch (Exception)<br />
        {<br />
            Debug.LogError(&quot;The &#92;&quot;&quot;+joysticksTag+&quot;&#92;&quot; tag has not yet been defined in the Tag Manager.&quot;);<br />
            throw;<br />
        }<br />
    }<br />
<br />
<br />
    private void Awake()<br />
    {<br />
        gui = GetComponent&lt;GUITexture&gt;();<br />
        if (gui.texture == null)<br />
        {<br />
            Debug.LogError(&quot;Joystick object requires a valid texture!&quot;);<br />
            gameObject.active = false;<br />
            return;<br />
        }<br />
<br />
        if (!enumeratedJoysticks)<br />
        {<br />
            try<br />
            {<br />
                /* Collect all joysticks in the game, so we can relay finger latching messages */<br />
                GameObject[] objs = GameObject.FindGameObjectsWithTag(joysticksTag);<br />
                joysticks = new List&lt;Joystick&gt;(objs.Length);<br />
                foreach (GameObject obj in objs)<br />
                {<br />
                    Joystick newJoystick = obj.GetComponent&lt;Joystick&gt;();<br />
                    if (newJoystick == null)<br />
                    {<br />
                        throw new NullReferenceException(&quot;Joystick gameObject found without a suitable Joystick component.&quot;);<br />
                    }<br />
                    joysticks.Add(newJoystick);<br />
                }<br />
                enumeratedJoysticks = true;<br />
            }<br />
            catch (Exception exp)<br />
            {<br />
                Debug.LogError(&quot;Error collecting Joystick objects: &quot;+exp.Message);<br />
                throw;<br />
            }<br />
        }<br />
<br />
        /* Store the default rect for the gui, so we can snap back to it */<br />
        defaultRect = gui.pixelInset;<br />
<br />
        defaultRect.x += transform.position.x * Screen.width;// + gui.pixelInset.x; // -  Screen.width * 0.5f;<br />
        defaultRect.y += transform.position.y * Screen.height;// - Screen.height * 0.5f;<br />
<br />
        transform.position = new Vector3(0, 0, transform.position.z);<br />
<br />
        if (touchPad)<br />
        {<br />
            /* Use the rect from the gui as our touchZone */<br />
            touchZone = defaultRect;<br />
        }<br />
        else<br />
        {<br />
            /* This is an offset for touch input to match with the top left corner of the GUI */<br />
            guiTouchOffset.x = defaultRect.width * 0.5f;<br />
            guiTouchOffset.y = defaultRect.height * 0.5f;<br />
<br />
            /* Cache the center of the GUI, since it doesn't change */<br />
            guiCenter.x = defaultRect.x + guiTouchOffset.x;<br />
            guiCenter.y = defaultRect.y + guiTouchOffset.y;<br />
<br />
            /* Let's build the GUI boundary, so we can clamp joystick movement */<br />
            guiBoundary.min.x = defaultRect.x - guiTouchOffset.x;<br />
            guiBoundary.max.x = defaultRect.x + guiTouchOffset.x;<br />
            guiBoundary.min.y = defaultRect.y - guiTouchOffset.y;<br />
            guiBoundary.max.y = defaultRect.y + guiTouchOffset.y;<br />
        }<br />
<br />
    }<br />
<br />
<br />
    public void Enable()<br />
    {<br />
        enabled = true;<br />
    }<br />
<br />
<br />
    public void Disable()<br />
    {<br />
        enabled = false;<br />
    }<br />
<br />
<br />
    public void Restart()<br />
    {<br />
        /* Release the finger control and set the joystick back to the default position */<br />
        gui.pixelInset = defaultRect;<br />
        lastFingerId = -1;<br />
        position = Vector2.zero;<br />
        fingerDownPos = Vector2.zero;<br />
<br />
        if (touchPad &amp;&amp; fadeGUI)<br />
        {<br />
            gui.color = new Color(gui.color.r, gui.color.g, gui.color.b, 0.025f);<br />
        }<br />
    }<br />
<br />
<br />
    private void Update()<br />
    {<br />
<br />
        int count = Input.touchCount;<br />
<br />
        /* Adjust the tap time window while it still available */<br />
        if (tapTimeWindow &gt; 0)<br />
        {<br />
            tapTimeWindow -= Time.deltaTime;<br />
        }<br />
        else<br />
        {<br />
            tapCount = 0;<br />
        }<br />
<br />
        if (count == 0)<br />
        {<br />
            Restart();<br />
        }<br />
        else<br />
        {<br />
            for (int i = 0; i &lt; count; i++)<br />
            {<br />
                Touch touch = Input.GetTouch(i);<br />
                Vector2 guiTouchPos = touch.position - guiTouchOffset;<br />
<br />
                bool shouldLatchFinger = false;<br />
                if (touchPad &amp;&amp; touchZone.Contains(touch.position))<br />
                {<br />
                    shouldLatchFinger = true;<br />
                }<br />
                else if (gui.HitTest(touch.position))<br />
                {<br />
                    shouldLatchFinger = true;<br />
                }<br />
<br />
                /* Latch the finger if this is a new touch */<br />
                if (shouldLatchFinger &amp;&amp; (lastFingerId == -1 || lastFingerId != touch.fingerId))<br />
                {<br />
<br />
                    if (touchPad)<br />
                    {<br />
                        if (fadeGUI)<br />
                        {<br />
                            gui.color = new Color(gui.color.r, gui.color.g, gui.color.b, 0.15f);<br />
                        }<br />
                        lastFingerId = touch.fingerId;<br />
                        fingerDownPos = touch.position;<br />
                        /*<br />
                         * Currently unused.<br />
                        fingerDownTime = Time.time;<br />
                        */<br />
                    }<br />
<br />
                    lastFingerId = touch.fingerId;<br />
<br />
                    /* Accumulate taps if it is within the time window */<br />
                    if (tapTimeWindow &gt; 0)<br />
                    {<br />
                        tapCount++;<br />
                    }<br />
                    else<br />
                    {<br />
                        tapCount = 1;<br />
                        tapTimeWindow = tapTimeDelta;<br />
                    }<br />
<br />
                    /* Tell other joysticks we've latched this finger */<br />
                    foreach (Joystick j in joysticks)<br />
                    {<br />
                        if (j == this)<br />
                        {<br />
                            continue;<br />
                        }<br />
                        j.latchedFinger = touch.fingerId;<br />
                    }<br />
                }<br />
<br />
                if (lastFingerId == touch.fingerId)<br />
                {<br />
                    /*<br />
                        Override the tap count with what the iOS SDK reports if it is greater.<br />
                        This is a workaround, since the iOS SDK does not currently track taps<br />
                        for multiple touches.<br />
                    */<br />
                    if (touch.tapCount &gt; tapCount)<br />
                    {<br />
                        tapCount = touch.tapCount;<br />
                    }<br />
<br />
                    if (touchPad)<br />
                    {<br />
                        /* For a touchpad, let's just set the position directly based on distance from initial touchdown */<br />
                        position = new Vector2<br />
                            (<br />
                              Mathf.Clamp((touch.position.x - fingerDownPos.x) / (touchZone.width / 2), -1, 1),<br />
                              Mathf.Clamp((touch.position.y - fingerDownPos.y) / (touchZone.height / 2), -1, 1)<br />
                            );<br />
                    }<br />
                    else<br />
                    {<br />
                        /* Change the location of the joystick graphic to match where the touch is */<br />
                        gui.pixelInset = new Rect<br />
                            (<br />
                              Mathf.Clamp(guiTouchPos.x, guiBoundary.min.x, guiBoundary.max.x),<br />
                              Mathf.Clamp(guiTouchPos.y, guiBoundary.min.y, guiBoundary.max.y),<br />
                              gui.pixelInset.width,<br />
                              gui.pixelInset.height<br />
                            );<br />
                    }<br />
<br />
                    if (touch.phase == TouchPhase.Ended || touch.phase == TouchPhase.Canceled)<br />
                    {<br />
                        Restart();<br />
                    }<br />
                }<br />
            }<br />
<br />
        }<br />
<br />
        if (!touchPad)<br />
        {<br />
            /* Get a value between -1 and 1 based on the joystick graphic location */<br />
            position = new Vector2<br />
                (<br />
                  (gui.pixelInset.x + guiTouchOffset.x - guiCenter.x) / guiTouchOffset.x,<br />
                  (gui.pixelInset.y + guiTouchOffset.y - guiCenter.y) / guiTouchOffset.y<br />
                );<br />
        }<br />
<br />
        /* Adjust for dead zone */<br />
        float absoluteX = Mathf.Abs(position.x);<br />
        float absoluteY = Mathf.Abs(position.y);<br />
<br />
        if (absoluteX &lt; deadZone.x)<br />
        {<br />
            /* Report the joystick as being at the center if it is within the dead zone */<br />
            position = new Vector2(0, position.y);<br />
        }<br />
        else if (normalize)<br />
        {<br />
            /* Rescale the output after taking the dead zone into account */<br />
            position = new Vector2(Mathf.Sign(position.x) * (absoluteX - deadZone.x) / (1 - deadZone.x), position.y);<br />
        }<br />
<br />
        if (absoluteY &lt; deadZone.y)<br />
        {<br />
            /* Report the joystick as being at the center if it is within the dead zone */<br />
            position = new Vector2(position.x, 0);<br />
        }<br />
        else if (normalize)<br />
        {<br />
            /* Rescale the output after taking the dead zone into account */<br />
            position = new Vector2(position.x, Mathf.Sign(position.y) * (absoluteY - deadZone.y) / (1 - deadZone.y));<br />
        }<br />
    }<br />
<br />
<br />
}<br />
 &lt;/csharp&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/10/joystic-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joystic &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/10/joystic-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/10/joystic-unify-wiki-2/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 09:08:32 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=Joystic</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/csharp&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

[[Category: Scripts]]
[[Category: C Sharp]]

Author: Unity Technologies.&#60;br /&#62;
Translated into C# by [[User:Jmpp&#124;Juan Manuel Palacios]], with a slightly ...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/csharp&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>[[Category: Scripts]]<br />
[[Category: C Sharp]]<br />
<br />
Author: Unity Technologies.&lt;br /&gt;<br />
Translated into C# by [[User:Jmpp|Juan Manuel Palacios]], with a slightly modified API.<br />
<br />
<br />
==Description==<br />
<br />
This is the Joystick script developed by Unity Technologies in JavaScript, originally released with the [http://unity3d.com/support/resources/tutorials/penelope Penelope tutorial] and recently updated in the Unity 3.4.x release, translated into C# with a slightly modified API.<br />
<br />
<br />
== Usage==<br />
<br />
Script explanation &amp; usage instructions should be sought in the [http://unity3d.com/support/resources/tutorials/penelope Penelope tutorial]. The API variations to the original script are decribed below:<br />
<br />
* A '''fadeGUI''' boolean parameter was included to discern whether or not &quot;touchPad&quot; joysticks should be faded.<br />
* The '''IsFingerDown''' method was migrated to an equivalent read-only '''isFingerDown''' C# property that can be queried as follows: &lt;syntaxhighlight lang=&quot;csharp&quot;&gt;if (joystick.isFingerDown) { }&lt;/syntaxhighlight&gt;<br />
* The '''LatchedFinger''' method was similarly migrated to a write-only '''latchedFinger''' C# property that can be set as follows: &lt;syntaxhighlight lang=&quot;csharp&quot;&gt;joystick.latchedFinger = touch.FingerId;&lt;/syntaxhighlight&gt;<br />
* The public '''position''' member variable was transparently migrated to a public but read-only C# property for off-the-shelf client consumption.<br />
* Game-wide joysticks collection was moved to the '''Awake''' method away from '''Update''', the former itself employed instead of '''Start'''. This change is important because it involves the collection of the joysticks gameObjects based on the &quot;joysticks&quot; tag (customizable), which will cause an exception to be thrown when creating a joystick if not defined.<br />
* Public '''Enable''' &amp; '''Disable''' methods are provided for the corresponding actions, without needing to deactivate the entire joystick gameObject.<br />
* The '''ResetJoystick''' method was renamed '''Restart'''. Note: I'm far from happy with this new method naming; the ideal would of course be simply '''Reset''', but that's already a [http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.Reset.html MonoBehaviour reserved method] for in-Editor component resetting. Feel free to suggest a better naming in the [[{{TALKPAGENAME}}|Discussion]] page.<br />
<br />
==C# - Joystick.cs==<br />
 &lt;syntaxhighlight lang=&quot;csharp&quot;&gt;using UnityEngine;<br />
using System;<br />
using System.Collections;<br />
using System.Collections.Generic;<br />
<br />
<br />
public class Boundary<br />
{<br />
    public Vector2 min = Vector2.zero;<br />
    public Vector2 max = Vector2.zero;<br />
}<br />
<br />
<br />
[RequireComponent(typeof(GUITexture))]<br />
public class Joystick : MonoBehaviour<br />
{<br />
<br />
    /* Is this joystick a TouchPad? */<br />
    public bool touchPad = false;<br />
    /* In case the joystick is a touchPad, should its GUI be faded when inactive? */<br />
    public bool fadeGUI = false;<br />
    /* Control when position is output */<br />
    public Vector2 deadZone = Vector2.zero;<br />
    /* Normalize output after the dead-zone? */<br />
    public bool normalize = false;<br />
    /* Current tap count */<br />
    public int tapCount = -1;<br />
<br />
    /* The touchZone of the joystick */<br />
    private Rect touchZone;<br />
<br />
    /* Finger last used on this joystick */<br />
    private int lastFingerId = -1;<br />
    /* How much time there is left for a tap to occur */<br />
    private float tapTimeWindow;<br />
    private Vector2 fingerDownPos;<br />
    /*<br />
     * Currently unused.<br />
    private float fingerDownTime;<br />
    */<br />
    private float firstDeltaTime;<br />
<br />
    /* Joystick graphic */<br />
    private GUITexture gui;<br />
    /* Default position / extents of the joystick graphic */<br />
    private Rect defaultRect;<br />
    /* Boundary for joystick graphic */<br />
    private Boundary guiBoundary = new Boundary();<br />
    /* Offset to apply to touch input */<br />
    private Vector2 guiTouchOffset;<br />
    /* Center of joystick */<br />
    private Vector2 guiCenter;<br />
<br />
    public bool isFingerDown<br />
    {<br />
        get<br />
        {<br />
            return (lastFingerId != -1);<br />
        }<br />
    }<br />
<br />
    public int latchedFinger<br />
    {<br />
        set<br />
        {<br />
            /* If another joystick has latched this finger, then we must release it */<br />
            if (lastFingerId == value)<br />
            {<br />
                Restart();<br />
            }<br />
        }<br />
    }<br />
<br />
    /* The position of the joystick on the screen ([-1, 1] in x,y) for clients to read. */<br />
    public Vector2 position<br />
    {<br />
        get;<br />
        private set;<br />
    }<br />
<br />
<br />
    private static string joysticksTag = &quot;joystick&quot;;<br />
    /* A static collection of all joysticks */<br />
    private static List&lt;Joystick&gt; joysticks;<br />
    /* Has the joysticks collection been enumerated yet? */<br />
    private static bool enumeratedJoysticks = false;<br />
    /* Time allowed between taps */<br />
    private static float tapTimeDelta = 0.3f;<br />
<br />
<br />
    private void Reset()<br />
    {<br />
        try<br />
        {<br />
            gameObject.tag = joysticksTag;<br />
        }<br />
        catch (Exception)<br />
        {<br />
            Debug.LogError(&quot;The &#92;&quot;&quot;+joysticksTag+&quot;&#92;&quot; tag has not yet been defined in the Tag Manager.&quot;);<br />
            throw;<br />
        }<br />
    }<br />
<br />
<br />
    private void Awake()<br />
    {<br />
        gui = GetComponent&lt;GUITexture&gt;();<br />
        if (gui.texture == null)<br />
        {<br />
            Debug.LogError(&quot;Joystick object requires a valid texture!&quot;);<br />
            gameObject.active = false;<br />
            return;<br />
        }<br />
<br />
        if (!enumeratedJoysticks)<br />
        {<br />
            try<br />
            {<br />
                /* Collect all joysticks in the game, so we can relay finger latching messages */<br />
                GameObject[] objs = GameObject.FindGameObjectsWithTag(joysticksTag);<br />
                joysticks = new List&lt;Joystick&gt;(objs.Length);<br />
                foreach (GameObject obj in objs)<br />
                {<br />
                    Joystick newJoystick = obj.GetComponent&lt;Joystick&gt;();<br />
                    if (newJoystick == null)<br />
                    {<br />
                        throw new NullReferenceException(&quot;Joystick gameObject found without a suitable Joystick component.&quot;);<br />
                    }<br />
                    joysticks.Add(newJoystick);<br />
                }<br />
                enumeratedJoysticks = true;<br />
            }<br />
            catch (Exception exp)<br />
            {<br />
                Debug.LogError(&quot;Error collecting Joystick objects: &quot;+exp.Message);<br />
                throw;<br />
            }<br />
        }<br />
<br />
        /* Store the default rect for the gui, so we can snap back to it */<br />
        defaultRect = gui.pixelInset;<br />
<br />
        defaultRect.x += transform.position.x * Screen.width;// + gui.pixelInset.x; // -  Screen.width * 0.5f;<br />
        defaultRect.y += transform.position.y * Screen.height;// - Screen.height * 0.5f;<br />
<br />
        transform.position = new Vector3(0, 0, transform.position.z);<br />
<br />
        if (touchPad)<br />
        {<br />
            /* Use the rect from the gui as our touchZone */<br />
            touchZone = defaultRect;<br />
        }<br />
        else<br />
        {<br />
            /* This is an offset for touch input to match with the top left corner of the GUI */<br />
            guiTouchOffset.x = defaultRect.width * 0.5f;<br />
            guiTouchOffset.y = defaultRect.height * 0.5f;<br />
<br />
            /* Cache the center of the GUI, since it doesn't change */<br />
            guiCenter.x = defaultRect.x + guiTouchOffset.x;<br />
            guiCenter.y = defaultRect.y + guiTouchOffset.y;<br />
<br />
            /* Let's build the GUI boundary, so we can clamp joystick movement */<br />
            guiBoundary.min.x = defaultRect.x - guiTouchOffset.x;<br />
            guiBoundary.max.x = defaultRect.x + guiTouchOffset.x;<br />
            guiBoundary.min.y = defaultRect.y - guiTouchOffset.y;<br />
            guiBoundary.max.y = defaultRect.y + guiTouchOffset.y;<br />
        }<br />
<br />
    }<br />
<br />
<br />
    public void Enable()<br />
    {<br />
        enabled = true;<br />
    }<br />
<br />
<br />
    public void Disable()<br />
    {<br />
        enabled = false;<br />
    }<br />
<br />
<br />
    public void Restart()<br />
    {<br />
        /* Release the finger control and set the joystick back to the default position */<br />
        gui.pixelInset = defaultRect;<br />
        lastFingerId = -1;<br />
        position = Vector2.zero;<br />
        fingerDownPos = Vector2.zero;<br />
<br />
        if (touchPad &amp;&amp; fadeGUI)<br />
        {<br />
            gui.color = new Color(gui.color.r, gui.color.g, gui.color.b, 0.025f);<br />
        }<br />
    }<br />
<br />
<br />
    private void Update()<br />
    {<br />
<br />
        int count = Input.touchCount;<br />
<br />
        /* Adjust the tap time window while it still available */<br />
        if (tapTimeWindow &gt; 0)<br />
        {<br />
            tapTimeWindow -= Time.deltaTime;<br />
        }<br />
        else<br />
        {<br />
            tapCount = 0;<br />
        }<br />
<br />
        if (count == 0)<br />
        {<br />
            Restart();<br />
        }<br />
        else<br />
        {<br />
            for (int i = 0; i &lt; count; i++)<br />
            {<br />
                Touch touch = Input.GetTouch(i);<br />
                Vector2 guiTouchPos = touch.position - guiTouchOffset;<br />
<br />
                bool shouldLatchFinger = false;<br />
                if (touchPad &amp;&amp; touchZone.Contains(touch.position))<br />
                {<br />
                    shouldLatchFinger = true;<br />
                }<br />
                else if (gui.HitTest(touch.position))<br />
                {<br />
                    shouldLatchFinger = true;<br />
                }<br />
<br />
                /* Latch the finger if this is a new touch */<br />
                if (shouldLatchFinger &amp;&amp; (lastFingerId == -1 || lastFingerId != touch.fingerId))<br />
                {<br />
<br />
                    if (touchPad)<br />
                    {<br />
                        if (fadeGUI)<br />
                        {<br />
                            gui.color = new Color(gui.color.r, gui.color.g, gui.color.b, 0.15f);<br />
                        }<br />
                        lastFingerId = touch.fingerId;<br />
                        fingerDownPos = touch.position;<br />
                        /*<br />
                         * Currently unused.<br />
                        fingerDownTime = Time.time;<br />
                        */<br />
                    }<br />
<br />
                    lastFingerId = touch.fingerId;<br />
<br />
                    /* Accumulate taps if it is within the time window */<br />
                    if (tapTimeWindow &gt; 0)<br />
                    {<br />
                        tapCount++;<br />
                    }<br />
                    else<br />
                    {<br />
                        tapCount = 1;<br />
                        tapTimeWindow = tapTimeDelta;<br />
                    }<br />
<br />
                    /* Tell other joysticks we've latched this finger */<br />
                    foreach (Joystick j in joysticks)<br />
                    {<br />
                        if (j == this)<br />
                        {<br />
                            continue;<br />
                        }<br />
                        j.latchedFinger = touch.fingerId;<br />
                    }<br />
                }<br />
<br />
                if (lastFingerId == touch.fingerId)<br />
                {<br />
                    /*<br />
                        Override the tap count with what the iOS SDK reports if it is greater.<br />
                        This is a workaround, since the iOS SDK does not currently track taps<br />
                        for multiple touches.<br />
                    */<br />
                    if (touch.tapCount &gt; tapCount)<br />
                    {<br />
                        tapCount = touch.tapCount;<br />
                    }<br />
<br />
                    if (touchPad)<br />
                    {<br />
                        /* For a touchpad, let's just set the position directly based on distance from initial touchdown */<br />
                        position = new Vector2<br />
                            (<br />
                              Mathf.Clamp((touch.position.x - fingerDownPos.x) / (touchZone.width / 2), -1, 1),<br />
                              Mathf.Clamp((touch.position.y - fingerDownPos.y) / (touchZone.height / 2), -1, 1)<br />
                            );<br />
                    }<br />
                    else<br />
                    {<br />
                        /* Change the location of the joystick graphic to match where the touch is */<br />
                        gui.pixelInset = new Rect<br />
                            (<br />
                              Mathf.Clamp(guiTouchPos.x, guiBoundary.min.x, guiBoundary.max.x),<br />
                              Mathf.Clamp(guiTouchPos.y, guiBoundary.min.y, guiBoundary.max.y),<br />
                              gui.pixelInset.width,<br />
                              gui.pixelInset.height<br />
                            );<br />
                    }<br />
<br />
                    if (touch.phase == TouchPhase.Ended || touch.phase == TouchPhase.Canceled)<br />
                    {<br />
                        Restart();<br />
                    }<br />
                }<br />
            }<br />
<br />
        }<br />
<br />
        if (!touchPad)<br />
        {<br />
            /* Get a value between -1 and 1 based on the joystick graphic location */<br />
            position = new Vector2<br />
                (<br />
                  (gui.pixelInset.x + guiTouchOffset.x - guiCenter.x) / guiTouchOffset.x,<br />
                  (gui.pixelInset.y + guiTouchOffset.y - guiCenter.y) / guiTouchOffset.y<br />
                );<br />
        }<br />
<br />
        /* Adjust for dead zone */<br />
        float absoluteX = Mathf.Abs(position.x);<br />
        float absoluteY = Mathf.Abs(position.y);<br />
<br />
        if (absoluteX &lt; deadZone.x)<br />
        {<br />
            /* Report the joystick as being at the center if it is within the dead zone */<br />
            position = new Vector2(0, position.y);<br />
        }<br />
        else if (normalize)<br />
        {<br />
            /* Rescale the output after taking the dead zone into account */<br />
            position = new Vector2(Mathf.Sign(position.x) * (absoluteX - deadZone.x) / (1 - deadZone.x), position.y);<br />
        }<br />
<br />
        if (absoluteY &lt; deadZone.y)<br />
        {<br />
            /* Report the joystick as being at the center if it is within the dead zone */<br />
            position = new Vector2(position.x, 0);<br />
        }<br />
        else if (normalize)<br />
        {<br />
            /* Rescale the output after taking the dead zone into account */<br />
            position = new Vector2(position.x, Mathf.Sign(position.y) * (absoluteY - deadZone.y) / (1 - deadZone.y));<br />
        }<br />
    }<br />
<br />
<br />
}<br />
 &lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/10/joystic-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Urinary Tract Infection researches 14 &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/10/urinary-tract-infection-researches-14-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/10/urinary-tract-infection-researches-14-unify-wiki/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 07:47:13 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Urinary_Tract_Infection_researches_14</guid>
		<description><![CDATA[GrantBensonsvh: Created page with &#34;Liver  sort  a component of  excretory  program  individuals  human body  [http://www.theurinarytractinfection.com/what-are-the-urinary-tract-infection-causes/ urinary tract infe...&#34;

Liver  sort  a componen...]]></description>
			<content:encoded><![CDATA[<p>GrantBensonsvh: Created page with &quot;Liver  sort  a component of  excretory  program  individuals  human body  [http://www.theurinarytractinfection.com/what-are-the-urinary-tract-infection-causes/ urinary tract infe...&quot;</p>
<hr />
<div>Liver  sort  a component of  excretory  program  individuals  human body  [http://www.theurinarytractinfection.com/what-are-the-urinary-tract-infection-causes/ urinary tract infection causes].   There're  located on  spare on both  in the  human body  within the  diaphragm.   Just about every  renal  is  linked to the  kidney  with  lengthy  tv  like  structures  identified as  ureters.   The  pee  from the  renal system  trips  through these  ureters  and  gathers  from the  bladder  [http://www.theurinarytractinfection.com urinary tract infection] '''urinary tract infection'''.   It  stays on  there  till  time  it is  handed down  out of the  human body  as a result of  urethra.   The  filtering organs  engage in  vital  capabilities  in the body  such as  filter  the  waste material  with the  body ,  retaining  electrolyte  steadiness ,  unsafe effects of  blood pressure  and  contributing to  the production of  erythrocytes  (or  crimson  blood stream  skin cells ) '''urinary tract infection'''.   But  sometimes ,  the  filtering organs</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/10/urinary-tract-infection-researches-14-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vertex/Fragment Template &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/05/vertexfragment-template-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/05/vertexfragment-template-unify-wiki/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 20:02:12 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Vertex/Fragment_Template</guid>
		<description><![CDATA[Danielbrauer: Created page

[[Category: Unity 3.x shaders]]
[[Category: Cg shaders]]

Author: [[User:Danielbrauer&#124;Daniel Brauer]]

== Description ==
This is one of the simplest vertex/fragment combination shaders you can write. It is a good starting po...]]></description>
			<content:encoded><![CDATA[<p>Danielbrauer: Created page</p>
<hr />
<div>[[Category: Unity 3.x shaders]]<br />
[[Category: Cg shaders]]<br />
<br />
Author: [[User:Danielbrauer|Daniel Brauer]]<br />
<br />
== Description ==<br />
This is one of the simplest vertex/fragment combination shaders you can write. It is a good starting point for any number of shaders that wouldn't make good surface shaders.<br />
<br />
==ShaderLab - Unlit.shader==<br />
&lt;shaderlab&gt;<br />
Shader &quot;Custom/Basic Unlit&quot; {<br />
	Properties {<br />
		_MainTex (&quot;Base (RGB)&quot;, 2D) = &quot;white&quot; {}<br />
	}<br />
	SubShader {<br />
		Tags { &quot;RenderType&quot;=&quot;Opaque&quot; }<br />
		LOD 200<br />
		<br />
		Pass {<br />
			CGPROGRAM<br />
				#pragma vertex vert<br />
				#pragma fragment frag<br />
				#include &quot;UnityCG.cginc&quot;<br />
			<br />
				struct v2f {<br />
					float4 pos : SV_POSITION;<br />
					float2 uv_MainTex : TEXCOORD0;<br />
				};<br />
			<br />
				float4 _MainTex_ST;<br />
			<br />
				v2f vert(appdata_base v) {<br />
					v2f o;<br />
					o.pos = mul(UNITY_MATRIX_MVP, v.vertex);<br />
					o.uv_MainTex = TRANSFORM_TEX(v.texcoord, _MainTex);<br />
					return o;<br />
				}<br />
			<br />
				sampler2D _MainTex;<br />
			<br />
				float4 frag(v2f IN) : COLOR {<br />
					half4 c = tex2D (_MainTex, IN.uv_MainTex);<br />
					return c;<br />
				}<br />
			ENDCG<br />
		}<br />
	}<br />
}<br />
&lt;/shaderlab&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/05/vertexfragment-template-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vertex/Fragment Template &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/05/vertexfragment-template-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/05/vertexfragment-template-unify-wiki-2/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 20:02:12 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=Vertex/Fragment_Template</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/shaderlab&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

[[Category: Unity 3.x shaders]]
[[Category: Cg shaders]]

Author: [[User:Danielbrauer&#124;Daniel Brauer]]

== Description ==
This is one of the simplest vertex/...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/shaderlab&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>[[Category: Unity 3.x shaders]]<br />
[[Category: Cg shaders]]<br />
<br />
Author: [[User:Danielbrauer|Daniel Brauer]]<br />
<br />
== Description ==<br />
This is one of the simplest vertex/fragment combination shaders you can write. It is a good starting point for any number of shaders that wouldn't make good surface shaders.<br />
<br />
==ShaderLab - Unlit.shader==<br />
&lt;syntaxhighlight lang=&quot;shaderlab&quot;&gt;<br />
Shader &quot;Custom/Basic Unlit&quot; {<br />
	Properties {<br />
		_MainTex (&quot;Base (RGB)&quot;, 2D) = &quot;white&quot; {}<br />
	}<br />
	SubShader {<br />
		Tags { &quot;RenderType&quot;=&quot;Opaque&quot; }<br />
		LOD 200<br />
		<br />
		Pass {<br />
			CGPROGRAM<br />
				#pragma vertex vert<br />
				#pragma fragment frag<br />
				#include &quot;UnityCG.cginc&quot;<br />
			<br />
				struct v2f {<br />
					float4 pos : SV_POSITION;<br />
					float2 uv_MainTex : TEXCOORD0;<br />
				};<br />
			<br />
				float4 _MainTex_ST;<br />
			<br />
				v2f vert(appdata_base v) {<br />
					v2f o;<br />
					o.pos = mul(UNITY_MATRIX_MVP, v.vertex);<br />
					o.uv_MainTex = TRANSFORM_TEX(v.texcoord, _MainTex);<br />
					return o;<br />
				}<br />
			<br />
				sampler2D _MainTex;<br />
			<br />
				float4 frag(v2f IN) : COLOR {<br />
					half4 c = tex2D (_MainTex, IN.uv_MainTex);<br />
					return c;<br />
				}<br />
			ENDCG<br />
		}<br />
	}<br />
}<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/05/vertexfragment-template-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MouseOrbitInfiteRotateZoom &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/02/mouseorbitinfiterotatezoom-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/02/mouseorbitinfiterotatezoom-unify-wiki/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 22:41:05 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=MouseOrbitInfiteRotateZoom</guid>
		<description><![CDATA[VeggieTrbie: 

[[Category: Camera]]
[[Category: MonoBehaviour]]
[[Category: C_Sharp]]
[[Category: MouseLook]]

Author: [http://forum.unity3d.com/members/70994-VeggieTribe VeggieTribe]

==Description==
This orbital camera will rotate infinitely with zoo...]]></description>
			<content:encoded><![CDATA[<p>VeggieTrbie: </p>
<hr />
<div>[[Category: Camera]]<br />
[[Category: MonoBehaviour]]<br />
[[Category: C_Sharp]]<br />
[[Category: MouseLook]]<br />
<br />
Author: [http://forum.unity3d.com/members/70994-VeggieTribe VeggieTribe]<br />
<br />
==Description==<br />
This orbital camera will rotate infinitely with zoom controls on the mousewheel.  The zoom can be limited via  min/max. <br />
<br />
Please let me know if you have any questions or want to show me how you use it in your project.<br />
<br />
<br />
==Code C#==<br />
<br />
&lt;csharp&gt;<br />
<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
[AddComponentMenu(&quot;Infinite Camera-Control/Mouse Orbit with zoom&quot;)]<br />
public class MouseOrbitInfiniteRotateZoom : MonoBehaviour {<br />
<br />
    public Transform target;<br />
    public float xSpeed = 12.0f;<br />
    public float ySpeed = 12.0f;<br />
    public float scrollSpeed = 10.0f;<br />
<br />
	public float zoomMin = 1.0f;<br />
<br />
	public float zoomMax = 20.0f;<br />
<br />
	public float distance ;<br />
<br />
	public Vector3 position;<br />
<br />
    public bool isActivated;<br />
<br />
	<br />
<br />
    float x = 0.0f;<br />
<br />
    float y = 0.0f;<br />
<br />
<br />
<br />
    // Use this for initialization<br />
<br />
    void Start () {<br />
<br />
        Vector3 angles = transform.eulerAngles;<br />
<br />
        x = angles.y;<br />
<br />
        y = angles.x;<br />
<br />
<br />
<br />
    }<br />
<br />
    <br />
<br />
    void LateUpdate () {<br />
<br />
		<br />
<br />
		// only update if the mousebutton is held down<br />
<br />
		if (Input.GetMouseButtonDown(1)){<br />
<br />
			isActivated = true;<br />
<br />
		} <br />
<br />
		// if mouse button is let UP then stop rotating camera<br />
<br />
		if (Input.GetMouseButtonUp(1))<br />
<br />
		{<br />
<br />
			isActivated = false;<br />
<br />
		} <br />
<br />
		<br />
<br />
	    if (target &amp;&amp; isActivated) { <br />
<br />
			//  get the distance the mouse moved in the respective direction<br />
<br />
			x += Input.GetAxis(&quot;Mouse X&quot;) * xSpeed;<br />
<br />
	        y -= Input.GetAxis(&quot;Mouse Y&quot;) * ySpeed;	 <br />
<br />
			<br />
<br />
			// when mouse moves left and right we actually rotate around local y axis	<br />
<br />
			transform.RotateAround(target.position,transform.up, x);<br />
<br />
				<br />
<br />
			// when mouse moves up and down we actually rotate around the local x axis	<br />
<br />
			transform.RotateAround(target.position,transform.right, y);<br />
<br />
				<br />
<br />
			// reset back to 0 so it doesn't continue to rotate while holding the button<br />
<br />
			x=0;<br />
<br />
			y=0; 	<br />
<br />
		} else {		<br />
<br />
			// see if mouse wheel is used 	<br />
<br />
	 		if (Input.GetAxis(&quot;Mouse ScrollWheel&quot;) != 0) <br />
<br />
			{	<br />
<br />
				// get the distance between camera and target<br />
<br />
				distance = Vector3.Distance (transform.position , target.position);	<br />
<br />
					<br />
<br />
				// get mouse wheel info to zoom in and out	<br />
<br />
				distance = ZoomLimit(distance - Input.GetAxis(&quot;Mouse ScrollWheel&quot;)*scrollSpeed, zoomMin, zoomMax);<br />
<br />
		        <br />
<br />
				// position the camera FORWARD the right distance towards target<br />
<br />
		        position = -(transform.forward*distance) + target.position;<br />
<br />
		        <br />
<br />
				// move the camera<br />
<br />
				transform.position = position; <br />
<br />
			}<br />
<br />
		}<br />
<br />
}<br />
<br />
<br />
<br />
	public static float ZoomLimit(float dist, float min, float max)<br />
<br />
    {<br />
<br />
        if (dist &lt; min)<br />
<br />
            dist= min;<br />
<br />
        if (dist &gt; max)<br />
<br />
            dist= max; <br />
<br />
		return dist;<br />
<br />
    }<br />
<br />
<br />
<br />
}<br />
<br />
<br />
&lt;/csharp&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/02/mouseorbitinfiterotatezoom-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MouseOrbitInfiteRotateZoom &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/02/mouseorbitinfiterotatezoom-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/02/mouseorbitinfiterotatezoom-unify-wiki-2/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 22:41:05 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=MouseOrbitInfiteRotateZoom</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/csharp&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

[[Category: Camera]]
[[Category: MonoBehaviour]]
[[Category: C_Sharp]]
[[Category: MouseLook]]

Author: [http://forum.unity3d.com/members/70994-VeggieTribe Veg...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/csharp&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>[[Category: Camera]]<br />
[[Category: MonoBehaviour]]<br />
[[Category: C_Sharp]]<br />
[[Category: MouseLook]]<br />
<br />
Author: [http://forum.unity3d.com/members/70994-VeggieTribe VeggieTribe]<br />
<br />
==Description==<br />
This orbital camera will rotate infinitely with zoom controls on the mousewheel.  The zoom can be limited via  min/max. <br />
<br />
Please let me know if you have any questions or want to show me how you use it in your project.<br />
<br />
<br />
==Code C#==<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
[AddComponentMenu(&quot;Infinite Camera-Control/Mouse Orbit with zoom&quot;)]<br />
public class MouseOrbitInfiniteRotateZoom : MonoBehaviour {<br />
<br />
    public Transform target;<br />
    public float xSpeed = 12.0f;<br />
    public float ySpeed = 12.0f;<br />
    public float scrollSpeed = 10.0f;<br />
<br />
	public float zoomMin = 1.0f;<br />
<br />
	public float zoomMax = 20.0f;<br />
<br />
	public float distance ;<br />
<br />
	public Vector3 position;<br />
<br />
    public bool isActivated;<br />
<br />
	<br />
<br />
    float x = 0.0f;<br />
<br />
    float y = 0.0f;<br />
<br />
<br />
<br />
    // Use this for initialization<br />
<br />
    void Start () {<br />
<br />
        Vector3 angles = transform.eulerAngles;<br />
<br />
        x = angles.y;<br />
<br />
        y = angles.x;<br />
<br />
<br />
<br />
    }<br />
<br />
    <br />
<br />
    void LateUpdate () {<br />
<br />
		<br />
<br />
		// only update if the mousebutton is held down<br />
<br />
		if (Input.GetMouseButtonDown(1)){<br />
<br />
			isActivated = true;<br />
<br />
		} <br />
<br />
		// if mouse button is let UP then stop rotating camera<br />
<br />
		if (Input.GetMouseButtonUp(1))<br />
<br />
		{<br />
<br />
			isActivated = false;<br />
<br />
		} <br />
<br />
		<br />
<br />
	    if (target &amp;&amp; isActivated) { <br />
<br />
			//  get the distance the mouse moved in the respective direction<br />
<br />
			x += Input.GetAxis(&quot;Mouse X&quot;) * xSpeed;<br />
<br />
	        y -= Input.GetAxis(&quot;Mouse Y&quot;) * ySpeed;	 <br />
<br />
			<br />
<br />
			// when mouse moves left and right we actually rotate around local y axis	<br />
<br />
			transform.RotateAround(target.position,transform.up, x);<br />
<br />
				<br />
<br />
			// when mouse moves up and down we actually rotate around the local x axis	<br />
<br />
			transform.RotateAround(target.position,transform.right, y);<br />
<br />
				<br />
<br />
			// reset back to 0 so it doesn't continue to rotate while holding the button<br />
<br />
			x=0;<br />
<br />
			y=0; 	<br />
<br />
		} else {		<br />
<br />
			// see if mouse wheel is used 	<br />
<br />
	 		if (Input.GetAxis(&quot;Mouse ScrollWheel&quot;) != 0) <br />
<br />
			{	<br />
<br />
				// get the distance between camera and target<br />
<br />
				distance = Vector3.Distance (transform.position , target.position);	<br />
<br />
					<br />
<br />
				// get mouse wheel info to zoom in and out	<br />
<br />
				distance = ZoomLimit(distance - Input.GetAxis(&quot;Mouse ScrollWheel&quot;)*scrollSpeed, zoomMin, zoomMax);<br />
<br />
		        <br />
<br />
				// position the camera FORWARD the right distance towards target<br />
<br />
		        position = -(transform.forward*distance) + target.position;<br />
<br />
		        <br />
<br />
				// move the camera<br />
<br />
				transform.position = position; <br />
<br />
			}<br />
<br />
		}<br />
<br />
}<br />
<br />
<br />
<br />
	public static float ZoomLimit(float dist, float min, float max)<br />
<br />
    {<br />
<br />
        if (dist &lt; min)<br />
<br />
            dist= min;<br />
<br />
        if (dist &gt; max)<br />
<br />
            dist= max; <br />
<br />
		return dist;<br />
<br />
    }<br />
<br />
<br />
<br />
}<br />
<br />
<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/02/mouseorbitinfiterotatezoom-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; FileEncryption &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/02/4dis-fileencryption-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/02/4dis-fileencryption-unify-wiki/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 21:33:26 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=4DIS_-_FileEncryption</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''File encryption''' ==

[[4D IS]] - Back


FileEncryption is a class to encrypt files or strings.

'''Functions :'''

&#60;javascript&#62;

FileEncryption.Encrypt ( &#34;...text...&#34;, key as int ) : String;
FileEncrypti...]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''File encryption''' ==<br />
<br />
[[4D IS]] - Back<br />
<br />
<br />
FileEncryption is a class to encrypt files or strings.<br />
<br />
'''Functions :'''<br />
<br />
&lt;javascript&gt;<br />
<br />
FileEncryption.Encrypt ( &quot;...text...&quot;, key as int ) : String;<br />
FileEncryption.EncryptFile ( &quot;...url...&quot;, key as int );<br />
<br />
&lt;/javascript&gt;<br />
<br />
----<br />
<br />
'''You need ...'''<br />
<br />
[[4DIS - IO]]<br />
<br />
'''... and ...'''<br />
<br />
FileEncryption.js<br />
<br />
&lt;javascript&gt;<br />
<br />
class FileEncryption<br />
{<br />
	public static function GetCharList ( string : String )<br />
	{<br />
		var s : String = &quot;&quot;;<br />
		<br />
		for ( var i : int = 0; i &lt; string.length; i++ )<br />
			if ( s.IndexOf ( string [ i ] ) == -1 )<br />
				s += string [ i ];<br />
		<br />
		return s;<br />
	}<br />
	<br />
	public static function GetNewChar ( c : char, list : String, key : int )<br />
	{<br />
		var oi : int = list.length - list.IndexOf ( c ) - 1 + key;<br />
		<br />
		while ( oi &gt;= list.length )<br />
			oi -= list.length;<br />
		<br />
		while ( oi &lt; 0 )<br />
			oi += list.length;<br />
		<br />
		return list [ oi ];<br />
	}<br />
	<br />
	public static function Encrypt ( string : String, key : int )<br />
	{<br />
		var list : String = GetCharList ( string );<br />
		var rs : String = &quot;&quot;;<br />
		<br />
		for ( var i : int = 0; i &lt; string.length; i++ )<br />
			rs += GetNewChar ( string [ i ], list, key );<br />
		<br />
		return rs;<br />
	}<br />
	<br />
	public static function EncryptFile ( url : String, key : int )<br />
	{<br />
		if ( ! IO.ExistsFile ( url ) )<br />
			return null;<br />
		<br />
		IO.WriteFile ( url, Encrypt ( IO.ReadFile ( url ), key ) );<br />
	}<br />
}<br />
<br />
&lt;/javascript&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/02/4dis-fileencryption-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; FileEncryption &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/02/4dis-fileencryption-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/02/4dis-fileencryption-unify-wiki-2/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 21:33:26 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=4DIS_-_FileEncryption</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/javascript&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

== '''File encryption''' ==

[[4D IS]] - Back


FileEncryption is a class to encrypt files or strings.

'''Functions :'''

&#60;syntaxhighlight lang=&#34;j...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/javascript&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>== '''File encryption''' ==<br />
<br />
[[4D IS]] - Back<br />
<br />
<br />
FileEncryption is a class to encrypt files or strings.<br />
<br />
'''Functions :'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
FileEncryption.Encrypt ( &quot;...text...&quot;, key as int ) : String;<br />
FileEncryption.EncryptFile ( &quot;...url...&quot;, key as int );<br />
<br />
&lt;/syntaxhighlight&gt;<br />
<br />
----<br />
<br />
'''You need ...'''<br />
<br />
[[4DIS - IO]]<br />
<br />
'''... and ...'''<br />
<br />
FileEncryption.js<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
class FileEncryption<br />
{<br />
	public static function GetCharList ( string : String )<br />
	{<br />
		var s : String = &quot;&quot;;<br />
		<br />
		for ( var i : int = 0; i &lt; string.length; i++ )<br />
			if ( s.IndexOf ( string [ i ] ) == -1 )<br />
				s += string [ i ];<br />
		<br />
		return s;<br />
	}<br />
	<br />
	public static function GetNewChar ( c : char, list : String, key : int )<br />
	{<br />
		var oi : int = list.length - list.IndexOf ( c ) - 1 + key;<br />
		<br />
		while ( oi &gt;= list.length )<br />
			oi -= list.length;<br />
		<br />
		while ( oi &lt; 0 )<br />
			oi += list.length;<br />
		<br />
		return list [ oi ];<br />
	}<br />
	<br />
	public static function Encrypt ( string : String, key : int )<br />
	{<br />
		var list : String = GetCharList ( string );<br />
		var rs : String = &quot;&quot;;<br />
		<br />
		for ( var i : int = 0; i &lt; string.length; i++ )<br />
			rs += GetNewChar ( string [ i ], list, key );<br />
		<br />
		return rs;<br />
	}<br />
	<br />
	public static function EncryptFile ( url : String, key : int )<br />
	{<br />
		if ( ! IO.ExistsFile ( url ) )<br />
			return null;<br />
		<br />
		IO.WriteFile ( url, Encrypt ( IO.ReadFile ( url ), key ) );<br />
	}<br />
}<br />
<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/02/4dis-fileencryption-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; IO &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/02/4dis-io-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/02/4dis-io-unify-wiki/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 21:31:21 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=4DIS_-_IO</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''IO''' ==

[[4D IS]] - Back


You need this class to save and load strings.

'''Functions :'''

&#60;javascript&#62;

IO.ExistsFile ( &#34;...url...&#34; ) : boolean;
IO.RemoveFile ( &#34;...url...&#34; );
IO.WriteFile (...]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''IO''' ==<br />
<br />
[[4D IS]] - Back<br />
<br />
<br />
You need this class to save and load strings.<br />
<br />
'''Functions :'''<br />
<br />
&lt;javascript&gt;<br />
<br />
IO.ExistsFile ( &quot;...url...&quot; ) : boolean;<br />
IO.RemoveFile ( &quot;...url...&quot; );<br />
IO.WriteFile ( &quot;...url...&quot;, &quot;...text...&quot; );<br />
IO.ReadFile ( &quot;...url...&quot; ) : String;<br />
<br />
&lt;/javascript&gt;<br />
<br />
----<br />
<br />
IO.js<br />
<br />
&lt;javascript&gt;<br />
<br />
import System.IO;<br />
<br />
class IO<br />
{<br />
	public static function ExistsFile ( url : String )<br />
	{<br />
		var info : FileInfo = new FileInfo ( url );<br />
		<br />
		return info.Exists;<br />
	}<br />
	<br />
	public static function RemoveFile ( url : String )<br />
	{<br />
		var info : FileInfo = new FileInfo ( url );<br />
		<br />
		if ( info.Exists )<br />
			info.Delete ( );<br />
	}<br />
	<br />
	public static function WriteFile ( url : String, string : String )<br />
	{<br />
		var writer : StreamWriter;<br />
		var info : FileInfo = new FileInfo ( url );<br />
		<br />
		if ( info.Exists )<br />
			info.Delete ( );<br />
		<br />
		writer = info.CreateText ( );<br />
		<br />
		writer.Write ( string );<br />
		writer.Close ( );<br />
	}<br />
	<br />
	public static function ReadFile ( url : String )<br />
	{<br />
		var info : FileInfo = new FileInfo ( url );<br />
		<br />
		if ( ! info.Exists )<br />
			return &quot;&quot;;<br />
		<br />
		var reader : StreamReader = File.OpenText ( url );<br />
		var readedString : String = reader.ReadToEnd ( );  <br />
		<br />
		reader.Close ( );<br />
		<br />
		return readedString;<br />
	}<br />
}<br />
<br />
&lt;/javascript&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/02/4dis-io-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; IO &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/02/4dis-io-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/02/4dis-io-unify-wiki-2/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 21:31:21 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=4DIS_-_IO</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/javascript&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

== '''IO''' ==

[[4D IS]] - Back


You need this class to save and load strings.

'''Functions :'''

&#60;syntaxhighlight lang=&#34;javascript&#34;&#62;

I...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/javascript&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>== '''IO''' ==<br />
<br />
[[4D IS]] - Back<br />
<br />
<br />
You need this class to save and load strings.<br />
<br />
'''Functions :'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
IO.ExistsFile ( &quot;...url...&quot; ) : boolean;<br />
IO.RemoveFile ( &quot;...url...&quot; );<br />
IO.WriteFile ( &quot;...url...&quot;, &quot;...text...&quot; );<br />
IO.ReadFile ( &quot;...url...&quot; ) : String;<br />
<br />
&lt;/syntaxhighlight&gt;<br />
<br />
----<br />
<br />
IO.js<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
import System.IO;<br />
<br />
class IO<br />
{<br />
	public static function ExistsFile ( url : String )<br />
	{<br />
		var info : FileInfo = new FileInfo ( url );<br />
		<br />
		return info.Exists;<br />
	}<br />
	<br />
	public static function RemoveFile ( url : String )<br />
	{<br />
		var info : FileInfo = new FileInfo ( url );<br />
		<br />
		if ( info.Exists )<br />
			info.Delete ( );<br />
	}<br />
	<br />
	public static function WriteFile ( url : String, string : String )<br />
	{<br />
		var writer : StreamWriter;<br />
		var info : FileInfo = new FileInfo ( url );<br />
		<br />
		if ( info.Exists )<br />
			info.Delete ( );<br />
		<br />
		writer = info.CreateText ( );<br />
		<br />
		writer.Write ( string );<br />
		writer.Close ( );<br />
	}<br />
	<br />
	public static function ReadFile ( url : String )<br />
	{<br />
		var info : FileInfo = new FileInfo ( url );<br />
		<br />
		if ( ! info.Exists )<br />
			return &quot;&quot;;<br />
		<br />
		var reader : StreamReader = File.OpenText ( url );<br />
		var readedString : String = reader.ReadToEnd ( );  <br />
		<br />
		reader.Close ( );<br />
		<br />
		return readedString;<br />
	}<br />
}<br />
<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/02/4dis-io-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wander &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/01/wander-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/11/01/wander-unify-wiki/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 17:44:40 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Wander</guid>
		<description><![CDATA[Matthew Miner: Added script and description.

Author: Matthew Miner (matthew@matthewminer.com)

== Description ==

Creates a wandering behaviour for NPCs.

== Usage ==

Attach the script to your NPC, ensuring a CharacterController component is also att...]]></description>
			<content:encoded><![CDATA[<p>Matthew Miner: Added script and description.</p>
<hr />
<div>Author: Matthew Miner (matthew@matthewminer.com)<br />
<br />
== Description ==<br />
<br />
Creates a wandering behaviour for NPCs.<br />
<br />
== Usage ==<br />
<br />
Attach the script to your NPC, ensuring a CharacterController component is also attached. Tweak the inspector variables to get the desired behaviour.<br />
<br />
== C# - Wander.cs ==<br />
<br />
&lt;csharp&gt;<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
/// &lt;summary&gt;<br />
/// Creates wandering behaviour for a CharacterController.<br />
/// &lt;/summary&gt;<br />
[RequireComponent(typeof(CharacterController))]<br />
public class Wander : MonoBehaviour<br />
{<br />
	public float speed = 5;<br />
	public float directionChangeInterval = 1;<br />
	public float maxHeadingChange = 30;<br />
<br />
	CharacterController controller;<br />
	float heading;<br />
	Vector3 targetRotation;<br />
<br />
	void Awake ()<br />
	{<br />
		controller = GetComponent&lt;CharacterController&gt;();<br />
<br />
		// Set random initial rotation<br />
		heading = Random.Range(0, 360);<br />
		transform.eulerAngles = new Vector3(0, heading, 0);<br />
<br />
		StartCoroutine(NewHeading());<br />
	}<br />
<br />
	void Update ()<br />
	{<br />
		transform.eulerAngles = Vector3.Slerp(transform.eulerAngles, targetRotation, Time.deltaTime * directionChangeInterval);<br />
		var forward = transform.TransformDirection(Vector3.forward);<br />
		controller.SimpleMove(forward * speed);<br />
	}<br />
<br />
	/// &lt;summary&gt;<br />
	/// Repeatedly calculates a new direction to move towards.<br />
	/// Use this instead of MonoBehaviour.InvokeRepeating so that the interval can be changed at runtime.<br />
	/// &lt;/summary&gt;<br />
	IEnumerator NewHeading ()<br />
	{<br />
		while (true) {<br />
			NewHeadingRoutine();<br />
			yield return new WaitForSeconds(directionChangeInterval);<br />
		}<br />
	}<br />
<br />
	/// &lt;summary&gt;<br />
	/// Calculates a new direction to move towards.<br />
	/// &lt;/summary&gt;<br />
	void NewHeadingRoutine ()<br />
	{<br />
		var floor = Mathf.Clamp(heading - maxHeadingChange, 0, 360);<br />
		var ceil  = Mathf.Clamp(heading + maxHeadingChange, 0, 360);<br />
		heading = Random.Range(floor, ceil);<br />
		targetRotation = new Vector3(0, heading, 0);<br />
	}<br />
}<br />
&lt;/csharp&gt;<br />
<br />
[[Category:Character Control Scripts]]<br />
[[Category:C Sharp]]</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/01/wander-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wander &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/11/01/wander-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/11/01/wander-unify-wiki-2/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 17:44:40 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=Wander</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/csharp&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

Author: Matthew Miner (matthew@matthewminer.com)

== Description ==

Creates a wandering behaviour for NPCs.

== Usage ==

Attach the script to your NPC, ensur...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/csharp&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>Author: Matthew Miner (matthew@matthewminer.com)<br />
<br />
== Description ==<br />
<br />
Creates a wandering behaviour for NPCs.<br />
<br />
== Usage ==<br />
<br />
Attach the script to your NPC, ensuring a CharacterController component is also attached. Tweak the inspector variables to get the desired behaviour.<br />
<br />
== C# - Wander.cs ==<br />
<br />
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;<br />
using UnityEngine;<br />
using System.Collections;<br />
<br />
/// &lt;summary&gt;<br />
/// Creates wandering behaviour for a CharacterController.<br />
/// &lt;/summary&gt;<br />
[RequireComponent(typeof(CharacterController))]<br />
public class Wander : MonoBehaviour<br />
{<br />
	public float speed = 5;<br />
	public float directionChangeInterval = 1;<br />
	public float maxHeadingChange = 30;<br />
<br />
	CharacterController controller;<br />
	float heading;<br />
	Vector3 targetRotation;<br />
<br />
	void Awake ()<br />
	{<br />
		controller = GetComponent&lt;CharacterController&gt;();<br />
<br />
		// Set random initial rotation<br />
		heading = Random.Range(0, 360);<br />
		transform.eulerAngles = new Vector3(0, heading, 0);<br />
<br />
		StartCoroutine(NewHeading());<br />
	}<br />
<br />
	void Update ()<br />
	{<br />
		transform.eulerAngles = Vector3.Slerp(transform.eulerAngles, targetRotation, Time.deltaTime * directionChangeInterval);<br />
		var forward = transform.TransformDirection(Vector3.forward);<br />
		controller.SimpleMove(forward * speed);<br />
	}<br />
<br />
	/// &lt;summary&gt;<br />
	/// Repeatedly calculates a new direction to move towards.<br />
	/// Use this instead of MonoBehaviour.InvokeRepeating so that the interval can be changed at runtime.<br />
	/// &lt;/summary&gt;<br />
	IEnumerator NewHeading ()<br />
	{<br />
		while (true) {<br />
			NewHeadingRoutine();<br />
			yield return new WaitForSeconds(directionChangeInterval);<br />
		}<br />
	}<br />
<br />
	/// &lt;summary&gt;<br />
	/// Calculates a new direction to move towards.<br />
	/// &lt;/summary&gt;<br />
	void NewHeadingRoutine ()<br />
	{<br />
		var floor = Mathf.Clamp(heading - maxHeadingChange, 0, 360);<br />
		var ceil  = Mathf.Clamp(heading + maxHeadingChange, 0, 360);<br />
		heading = Random.Range(floor, ceil);<br />
		targetRotation = new Vector3(0, heading, 0);<br />
	}<br />
}<br />
&lt;/syntaxhighlight&gt;<br />
<br />
[[Category:Character Control Scripts]]<br />
[[Category:C Sharp]]</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/11/01/wander-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stylized Texture Tutorial &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/31/stylized-texture-tutorial-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/31/stylized-texture-tutorial-unify-wiki/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 02:57:19 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=Stylized_Texture_Tutorial</guid>
		<description><![CDATA[Sigtau: /* Photoshop Instructions */

== Introduction ==
This tutorial was designed with people who lack drawing tablets in mind, in hopes that among those people, the ones wanting to work within a cartoon/stylized art style will find this to be benefi...]]></description>
			<content:encoded><![CDATA[<p>Sigtau: /* Photoshop Instructions */</p>
<hr />
<div>== Introduction ==<br />
This tutorial was designed with people who lack drawing tablets in mind, in hopes that among those people, the ones wanting to work within a cartoon/stylized art style will find this to be beneficial.  If you're looking to cut costs so that you don't have to hire a texture artist in the end, this is a great method for going about stylized texture creation.<br />
<br />
If you can memorize this (rather short) process, you can produce hundreds of textures in a matter of hours (like I did!). <br />
<br />
This tutorial is divided into steps, with each step having a GIMP variant and a Photoshop variant within.  This tutorial assumes at least Photoshop CS4 (though CS3 and CS2 probably work just fine), or GIMP 2.6 (available for free at http://www.gimp.org/downloads/).<br />
<br />
The original tutorial posted on the Unity forums can be found here: [http://forum.unity3d.com/threads/109995-Realistic-to-stylized-textures-A-tutorial].<br />
<br />
== Step 1: Find an Appropriate Base Texture ==<br />
<br />
[[File:grass_bad.jpg|100px|thumb|right|A bad texture to use]]<br />
<br />
Regardless of what software we use, we need to find a texture that will act as a decent base texture--basically, we have to assess whether it'll look like crap or not by the time we complete this process.  For example, to the right of this text is a very detailed grass texture.  This texture in particular is too detailed, because of the sheer number of places in which the colors contrast from each other in terms of luminosity (brightness)--in other words, there's far too many places on the texture where different regions of dark colors touch different regions of lighter colors.<br />
<br />
A better alternative would be the second image among the images to the right of this text.  While there are still many spots where the colors contrast, this is a more ideal texture in that it doesn't have as much contrasting regions throughout.  Note that it is not necessarily a bad idea to use more detailed textures, it's just difficult to deal with textures that have more contrasting regions.<br />
<br />
[[File:grass_good.jpg|100px|thumb|right|A good texture to use]]<br />
<br />
Now, forgive me for using grass as an example, because when using this method to create a stylized texture, grass is actually incredibly difficult to get right without over-doing it, simply because it's hard to find base textures that aren't within the range of detail you want. For this example, we'll be using a small, non-seamless texture with details that will bring out what this method is capable of doing--the bottom image on the right, a simple concrete texture.<br />
<br />
[[File:concrete_start.jpg|100px|thumb|right|What we'll be using in this tutorial]]<br />
<br />
== Step 2: Initial Filtering ==<br />
<br />
This step is used to strip out some of the more unnecessary details that may become issues later on in the process, but is not necessarily required.<br />
<br />
=== GIMP Instructions ===<br />
<br />
&lt;span style=&quot;color:red;&quot;&gt;'''WARNING FOR GIMP USERS:'''&lt;/span&gt; Skip this step if your texture has any transparency applied to it. Not skipping this step while processing a transparent image will result in artifacts appearing around the edges of the non-transparent portions of the image!<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Enhance &gt; Despeckle.'''&lt;/span&gt;  You should see a window similar to this (click to enlarge):<br />
<br />
[[File:Step2.png|100px]]<br />
<br />
Leave all of the default values in place, and press OK.  Go on to Step 3.<br />
<br />
=== Photoshop Instructions ===<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Noise &gt; Despeckle.'''&lt;/span&gt;  If any window appears asking you to clarify options for this filter (which it doesn't in CS4--can't speak for CS3 or CS2), just leave them as their default settings.  Press OK and go on to Step 3.<br />
<br />
== Step 3: Detail Retention ==<br />
<br />
This step is used to regain some of the detail accidentally lost as a result of the filtering in Step 2.  This isn't totally necessary either, but if you noticed a significant decrease in overall detail after Step 2, you may not want to skip this step.<br />
<br />
=== GIMP Instructions ===<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Enhance &gt; Sharpen.'''&lt;/span&gt;  You should see a window similar to this (click to enlarge):<br />
<br />
[[File:Step3.png|100px]]<br />
<br />
Set the value to be 40, and click OK.  Go on to Step 4.<br />
<br />
=== Photoshop Instructions ===<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Sharpen &gt; Sharpen.'''&lt;/span&gt; As with Step 2, if any window appears asking you to clarify options for this filter (which it doesn't in CS4--can't speak for CS3 or CS2), just leave them as their default settings. Press OK and go on to Step 4.<br />
<br />
== Step 4: Paint Filtering ==<br />
<br />
''This is the most important step.''  Regardless of whether or not you skipped the above steps, you'll need to do this one.  This step is the &quot;fake&quot; painting filter that essentially emulates the style of hand-painted textures.  Whether or not it actually looks like a hand-painted texture depends on the settings tweaked during this step.<br />
<br />
=== GIMP Instructions ===<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Blur &gt; Selective Gaussian Blur.'''&lt;/span&gt;  You should see a window similar to this (click to enlarge):<br />
<br />
[[File:Step4.png|100px]]<br />
<br />
This is the most important step, so you must know your texture well (as outlined in Step 1) in order to make the decisions necessary for this texture to look good in the end.<br />
<br />
The Max Delta setting looks for contrasting regions in the image, hence the name &quot;delta&quot; (delta meaning &quot;change in,&quot; as in &quot;change in time&quot; or &quot;change in contrast&quot;). Higher values in this field will result in more blurry textures (reducing the hand-painted look), lower values result in negligible blurring, negating the effect this process attempts to pull off.  The Blur Amount setting is essentially just a measure of how blurry you want the regions that don't contrast more than the Max Delta setting allows, giving the appearance of different 'paints' being mixed together to create a color.<br />
<br />
For this example, we're going to set the blur amount to 5 and the max delta to 20.  Press OK.  You're done!<br />
<br />
=== Photoshop Instructions ===<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Blur &gt; Smart Blur...'''&lt;/span&gt;.  You should see a window similar to this (click to enlarge):<br />
<br />
[[File:Smartblur.png|100px]]<br />
<br />
This tool works similar yet a bit different than its GIMP counterpart.  The Radius setting affects the blurriness (&quot;mixed paint&quot; appearance) of the texture, and should stay somewhere between 10 and 40--anything below 10 and your texture may be too blurry, and anything above 40 and the texture may depart from the hand-painted style we're going for, defeating the entire purpose of this process.  The Threshold setting affects how Photoshop sees the different color regions in the texture--that is, lower values tell it to look for smaller differences in color to blur, and higher values tell it to look for larger differences to blur--and it should ideally stay between 30 and 65 (&lt;30, and the blurring will have little effect, and &gt;65 will cause contrasting regions to bleed together and kill the texture's overall quality).<br />
<br />
== Step 5: Final Filtering (Photoshop Only) ==<br />
<br />
This step is entirely optional, and usually requires you to compare the result of skipping this step and following this step, and deciding which one you like better.  This step is Photoshop-only because clever use of the Selective Gaussian Blur settings in GIMP will result in never having to use this (plus, GIMP's Sharpen filter is a lot more potent than it needs to be for this).<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Sharpen &gt; Sharpen.'''&lt;/span&gt;  This should harden some of the edges between the different regions of color, and reduce any leftover blurriness from the last step.  If you don't like this result, undo it (Ctrl+Z or Command+Z on the Mac--I think) and stick with what you've got.<br />
<br />
== Conclusion ==<br />
<br />
When it's all said and done, you should have a texture similar to this (click to enlarge):<br />
<br />
[[File:Cartoondemo.png|200px|thumb|right|An example of this tutorial on a different texture with toon shaders applied in Unity]]<br />
[[File:Finalized.png|200px]]<br />
<br />
If you don't like the result, tweak the settings in Step 4 and try again.  Note that this process should produce no seams on the texture (if not very negligible seams), which can be fixed using the Offset tools in GIMP/Photoshop in combination with the Smudge tool or a bit of feathered blurring.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/31/stylized-texture-tutorial-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stylized Texture Tutorial &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/31/stylized-texture-tutorial-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/31/stylized-texture-tutorial-unify-wiki-2/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 02:57:19 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=Stylized_Texture_Tutorial</guid>
		<description><![CDATA[Sigtau: /* Photoshop Instructions */

== Introduction ==
This tutorial was designed with people who lack drawing tablets in mind, in hopes that among those people, the ones wanting to work within a cartoon/stylized art style will find this to be benefi...]]></description>
			<content:encoded><![CDATA[<p>Sigtau: /* Photoshop Instructions */</p>
<hr />
<div>== Introduction ==<br />
This tutorial was designed with people who lack drawing tablets in mind, in hopes that among those people, the ones wanting to work within a cartoon/stylized art style will find this to be beneficial.  If you're looking to cut costs so that you don't have to hire a texture artist in the end, this is a great method for going about stylized texture creation.<br />
<br />
If you can memorize this (rather short) process, you can produce hundreds of textures in a matter of hours (like I did!). <br />
<br />
This tutorial is divided into steps, with each step having a GIMP variant and a Photoshop variant within.  This tutorial assumes at least Photoshop CS4 (though CS3 and CS2 probably work just fine), or GIMP 2.6 (available for free at http://www.gimp.org/downloads/).<br />
<br />
The original tutorial posted on the Unity forums can be found here: [http://forum.unity3d.com/threads/109995-Realistic-to-stylized-textures-A-tutorial].<br />
<br />
== Step 1: Find an Appropriate Base Texture ==<br />
<br />
[[File:grass_bad.jpg|100px|thumb|right|A bad texture to use]]<br />
<br />
Regardless of what software we use, we need to find a texture that will act as a decent base texture--basically, we have to assess whether it'll look like crap or not by the time we complete this process.  For example, to the right of this text is a very detailed grass texture.  This texture in particular is too detailed, because of the sheer number of places in which the colors contrast from each other in terms of luminosity (brightness)--in other words, there's far too many places on the texture where different regions of dark colors touch different regions of lighter colors.<br />
<br />
A better alternative would be the second image among the images to the right of this text.  While there are still many spots where the colors contrast, this is a more ideal texture in that it doesn't have as much contrasting regions throughout.  Note that it is not necessarily a bad idea to use more detailed textures, it's just difficult to deal with textures that have more contrasting regions.<br />
<br />
[[File:grass_good.jpg|100px|thumb|right|A good texture to use]]<br />
<br />
Now, forgive me for using grass as an example, because when using this method to create a stylized texture, grass is actually incredibly difficult to get right without over-doing it, simply because it's hard to find base textures that aren't within the range of detail you want. For this example, we'll be using a small, non-seamless texture with details that will bring out what this method is capable of doing--the bottom image on the right, a simple concrete texture.<br />
<br />
[[File:concrete_start.jpg|100px|thumb|right|What we'll be using in this tutorial]]<br />
<br />
== Step 2: Initial Filtering ==<br />
<br />
This step is used to strip out some of the more unnecessary details that may become issues later on in the process, but is not necessarily required.<br />
<br />
=== GIMP Instructions ===<br />
<br />
&lt;span style=&quot;color:red;&quot;&gt;'''WARNING FOR GIMP USERS:'''&lt;/span&gt; Skip this step if your texture has any transparency applied to it. Not skipping this step while processing a transparent image will result in artifacts appearing around the edges of the non-transparent portions of the image!<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Enhance &gt; Despeckle.'''&lt;/span&gt;  You should see a window similar to this (click to enlarge):<br />
<br />
[[File:Step2.png|100px]]<br />
<br />
Leave all of the default values in place, and press OK.  Go on to Step 3.<br />
<br />
=== Photoshop Instructions ===<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Noise &gt; Despeckle.'''&lt;/span&gt;  If any window appears asking you to clarify options for this filter (which it doesn't in CS4--can't speak for CS3 or CS2), just leave them as their default settings.  Press OK and go on to Step 3.<br />
<br />
== Step 3: Detail Retention ==<br />
<br />
This step is used to regain some of the detail accidentally lost as a result of the filtering in Step 2.  This isn't totally necessary either, but if you noticed a significant decrease in overall detail after Step 2, you may not want to skip this step.<br />
<br />
=== GIMP Instructions ===<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Enhance &gt; Sharpen.'''&lt;/span&gt;  You should see a window similar to this (click to enlarge):<br />
<br />
[[File:Step3.png|100px]]<br />
<br />
Set the value to be 40, and click OK.  Go on to Step 4.<br />
<br />
=== Photoshop Instructions ===<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Sharpen &gt; Sharpen.'''&lt;/span&gt; As with Step 2, if any window appears asking you to clarify options for this filter (which it doesn't in CS4--can't speak for CS3 or CS2), just leave them as their default settings. Press OK and go on to Step 4.<br />
<br />
== Step 4: Paint Filtering ==<br />
<br />
''This is the most important step.''  Regardless of whether or not you skipped the above steps, you'll need to do this one.  This step is the &quot;fake&quot; painting filter that essentially emulates the style of hand-painted textures.  Whether or not it actually looks like a hand-painted texture depends on the settings tweaked during this step.<br />
<br />
=== GIMP Instructions ===<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Blur &gt; Selective Gaussian Blur.'''&lt;/span&gt;  You should see a window similar to this (click to enlarge):<br />
<br />
[[File:Step4.png|100px]]<br />
<br />
This is the most important step, so you must know your texture well (as outlined in Step 1) in order to make the decisions necessary for this texture to look good in the end.<br />
<br />
The Max Delta setting looks for contrasting regions in the image, hence the name &quot;delta&quot; (delta meaning &quot;change in,&quot; as in &quot;change in time&quot; or &quot;change in contrast&quot;). Higher values in this field will result in more blurry textures (reducing the hand-painted look), lower values result in negligible blurring, negating the effect this process attempts to pull off.  The Blur Amount setting is essentially just a measure of how blurry you want the regions that don't contrast more than the Max Delta setting allows, giving the appearance of different 'paints' being mixed together to create a color.<br />
<br />
For this example, we're going to set the blur amount to 5 and the max delta to 20.  Press OK.  You're done!<br />
<br />
=== Photoshop Instructions ===<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Blur &gt; Smart Blur...'''&lt;/span&gt;.  You should see a window similar to this (click to enlarge):<br />
<br />
[[File:Smartblur.png|100px]]<br />
<br />
This tool works similar yet a bit different than its GIMP counterpart.  The Radius setting affects the blurriness (&quot;mixed paint&quot; appearance) of the texture, and should stay somewhere between 10 and 40--anything below 10 and your texture may be too blurry, and anything above 40 and the texture may depart from the hand-painted style we're going for, defeating the entire purpose of this process.  The Threshold setting affects how Photoshop sees the different color regions in the texture--that is, lower values tell it to look for smaller differences in color to blur, and higher values tell it to look for larger differences to blur--and it should ideally stay between 30 and 65 (&lt;30, and the blurring will have little effect, and &gt;65 will cause contrasting regions to bleed together and kill the texture's overall quality).<br />
<br />
== Step 5: Final Filtering (Photoshop Only) ==<br />
<br />
This step is entirely optional, and usually requires you to compare the result of skipping this step and following this step, and deciding which one you like better.  This step is Photoshop-only because clever use of the Selective Gaussian Blur settings in GIMP will result in never having to use this (plus, GIMP's Sharpen filter is a lot more potent than it needs to be for this).<br />
<br />
Go to &lt;span style=&quot;color:red;&quot;&gt;'''Filters &gt; Sharpen &gt; Sharpen.'''&lt;/span&gt;  This should harden some of the edges between the different regions of color, and reduce any leftover blurriness from the last step.  If you don't like this result, undo it (Ctrl+Z or Command+Z on the Mac--I think) and stick with what you've got.<br />
<br />
== Conclusion ==<br />
<br />
When it's all said and done, you should have a texture similar to this (click to enlarge):<br />
<br />
[[File:Cartoondemo.png|200px|thumb|right|An example of this tutorial on a different texture with toon shaders applied in Unity]]<br />
[[File:Finalized.png|200px]]<br />
<br />
If you don't like the result, tweak the settings in Step 4 and try again.  Note that this process should produce no seams on the texture (if not very negligible seams), which can be fixed using the Offset tools in GIMP/Photoshop in combination with the Smudge tool or a bit of feathered blurring.</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/31/stylized-texture-tutorial-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; JavascriptTutorial &#8211; Functions &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-functions-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-functions-unify-wiki/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 09:16:01 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=4DIS_-_JavascriptTutorial_-_Functions</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''Javascript Functions''' ==

[[4DIS - JavascriptTutorial]] - Back

----

...coming soon...]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''Javascript Functions''' ==<br />
<br />
[[4DIS - JavascriptTutorial]] - Back<br />
<br />
----<br />
<br />
...coming soon...</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-functions-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; JavascriptTutorial &#8211; Functions &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-functions-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-functions-unify-wiki-2/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 09:16:01 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=4DIS_-_JavascriptTutorial_-_Functions</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''Javascript Functions''' ==

[[4DIS - JavascriptTutorial]] - Back

----

...coming soon...]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''Javascript Functions''' ==<br />
<br />
[[4DIS - JavascriptTutorial]] - Back<br />
<br />
----<br />
<br />
...coming soon...</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-functions-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; JavascriptTutorial &#8211; Classes &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-classes-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-classes-unify-wiki/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 08:50:08 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=4DIS_-_JavascriptTutorial_-_Classes</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''Javascript Classes''' ==

[[4DIS - JavascriptTutorial]] - Back

----

'''Creating own classes :'''

&#60;javascript&#62;

class MyClass
{
    function MyClass ( ) { } // This is a constructor !
    
    // ...
}

// Variabl...]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''Javascript Classes''' ==<br />
<br />
[[4DIS - JavascriptTutorial]] - Back<br />
<br />
----<br />
<br />
'''Creating own classes :'''<br />
<br />
&lt;javascript&gt;<br />
<br />
class MyClass<br />
{<br />
    function MyClass ( ) { } // This is a constructor !<br />
    <br />
    // ...<br />
}<br />
<br />
// Variables...<br />
<br />
class MyClass<br />
{<br />
    function MyClass ( ) { }<br />
    <br />
    var a : int = 5;<br />
    var b : float = 2.5;<br />
}<br />
<br />
// Functions...<br />
<br />
class MyClass<br />
{<br />
    function MyClass ( ) { }<br />
    <br />
    var a : float = 2.5;<br />
    var b : float = 7.5;<br />
    <br />
    function MyFunction ( )<br />
    {<br />
        return a * b;    <br />
    }<br />
}<br />
<br />
&lt;/javascript&gt;<br />
<br />
----<br />
<br />
'''Using own classes :'''<br />
<br />
&lt;javascript&gt;<br />
<br />
var mc : MyClass = new MyClass ( );<br />
<br />
print ( mc.MyFunction ( ).ToString ( ) );<br />
<br />
&lt;/javascript&gt;<br />
<br />
----<br />
<br />
'''Static members :'''<br />
<br />
&lt;javascript&gt;<br />
<br />
class MyClass<br />
{<br />
    // You don´t need a constructor here !<br />
    <br />
    static var a : float = 24.1;<br />
    static var b : float = 2.5;<br />
    <br />
    static function MyFunction ( )<br />
    {<br />
        return a * b;<br />
    }<br />
}<br />
<br />
&lt;/javascript&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-classes-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; JavascriptTutorial &#8211; Classes &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-classes-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-classes-unify-wiki-2/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 08:50:08 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=4DIS_-_JavascriptTutorial_-_Classes</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/javascript&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

== '''Javascript Classes''' ==

[[4DIS - JavascriptTutorial]] - Back

----

'''Creating own classes :'''

&#60;syntaxhighlight lang=&#34;javascript&#34;&#38;g...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/javascript&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>== '''Javascript Classes''' ==<br />
<br />
[[4DIS - JavascriptTutorial]] - Back<br />
<br />
----<br />
<br />
'''Creating own classes :'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
class MyClass<br />
{<br />
    function MyClass ( ) { } // This is a constructor !<br />
    <br />
    // ...<br />
}<br />
<br />
// Variables...<br />
<br />
class MyClass<br />
{<br />
    function MyClass ( ) { }<br />
    <br />
    var a : int = 5;<br />
    var b : float = 2.5;<br />
}<br />
<br />
// Functions...<br />
<br />
class MyClass<br />
{<br />
    function MyClass ( ) { }<br />
    <br />
    var a : float = 2.5;<br />
    var b : float = 7.5;<br />
    <br />
    function MyFunction ( )<br />
    {<br />
        return a * b;    <br />
    }<br />
}<br />
<br />
&lt;/syntaxhighlight&gt;<br />
<br />
----<br />
<br />
'''Using own classes :'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
var mc : MyClass = new MyClass ( );<br />
<br />
print ( mc.MyFunction ( ).ToString ( ) );<br />
<br />
&lt;/syntaxhighlight&gt;<br />
<br />
----<br />
<br />
'''Static members :'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
class MyClass<br />
{<br />
    // You don´t need a constructor here !<br />
    <br />
    static var a : float = 24.1;<br />
    static var b : float = 2.5;<br />
    <br />
    static function MyFunction ( )<br />
    {<br />
        return a * b;<br />
    }<br />
}<br />
<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-classes-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; JavascriptTutorial &#8211; Variables &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-variables-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-variables-unify-wiki/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 08:09:22 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=4DIS_-_JavascriptTutorial_-_Variables</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''Javascript Variables''' ==

[[4DIS - JavascriptTutorial]] - Back

----

'''Creating new variables :'''

&#60;javascript&#62;

/*
var ...name...;
var ...name... = ...value...;
var ...name... : ...type...;
var ...name... : .....]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''Javascript Variables''' ==<br />
<br />
[[4DIS - JavascriptTutorial]] - Back<br />
<br />
----<br />
<br />
'''Creating new variables :'''<br />
<br />
&lt;javascript&gt;<br />
<br />
/*<br />
var ...name...;<br />
var ...name... = ...value...;<br />
var ...name... : ...type...;<br />
var ...name... : ...type... = ...value...;<br />
 */<br />
<br />
// examples...<br />
<br />
var newVarA;<br />
var newVarB = &quot;This is a string&quot;;<br />
var newVarC : String;<br />
var newVarD : String = &quot;This is a String.&quot;;<br />
<br />
&lt;/javascript&gt;<br />
<br />
----<br />
<br />
'''Using variables :'''<br />
<br />
&lt;javascript&gt;<br />
<br />
// Write values :<br />
<br />
newVarD = &quot;This is an other string&quot;;<br />
<br />
newVarD += &quot;.&quot;;<br />
<br />
// Read values :<br />
<br />
var x : String = newVarD;<br />
<br />
print ( x );<br />
<br />
&lt;/javascript&gt;<br />
<br />
----<br />
<br />
'''Different types of variables :'''<br />
<br />
&lt;javascript&gt;<br />
<br />
int<br />
float<br />
doule<br />
String<br />
Rect<br />
Vector3<br />
...<br />
<br />
&lt;/javascript&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-variables-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; JavascriptTutorial &#8211; Variables &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-variables-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-variables-unify-wiki-2/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 08:09:22 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=4DIS_-_JavascriptTutorial_-_Variables</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/javascript&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

== '''Javascript Variables''' ==

[[4DIS - JavascriptTutorial]] - Back

----

'''Creating new variables :'''

&#60;syntaxhighlight lang=&#34;javascript&#38;quo...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/javascript&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>== '''Javascript Variables''' ==<br />
<br />
[[4DIS - JavascriptTutorial]] - Back<br />
<br />
----<br />
<br />
'''Creating new variables :'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
/*<br />
var ...name...;<br />
var ...name... = ...value...;<br />
var ...name... : ...type...;<br />
var ...name... : ...type... = ...value...;<br />
 */<br />
<br />
// examples...<br />
<br />
var newVarA;<br />
var newVarB = &quot;This is a string&quot;;<br />
var newVarC : String;<br />
var newVarD : String = &quot;This is a String.&quot;;<br />
<br />
&lt;/syntaxhighlight&gt;<br />
<br />
----<br />
<br />
'''Using variables :'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
// Write values :<br />
<br />
newVarD = &quot;This is an other string&quot;;<br />
<br />
newVarD += &quot;.&quot;;<br />
<br />
// Read values :<br />
<br />
var x : String = newVarD;<br />
<br />
print ( x );<br />
<br />
&lt;/syntaxhighlight&gt;<br />
<br />
----<br />
<br />
'''Different types of variables :'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
int<br />
float<br />
doule<br />
String<br />
Rect<br />
Vector3<br />
...<br />
<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-variables-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; JavascriptTutorial &#8211; Syntax &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-syntax-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-syntax-unify-wiki/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 08:01:58 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=4DIS_-_JavascriptTutorial_-_Syntax</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''Javascript Syntax''' ==

[[4DIS - JavascriptTutorial]] - Back

----

'''Comments :'''

&#60;javascript&#62;

// This is a comment...

/*   This is
     also a comment   */

&#60;/javascript&#62;]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''Javascript Syntax''' ==<br />
<br />
[[4DIS - JavascriptTutorial]] - Back<br />
<br />
----<br />
<br />
'''Comments :'''<br />
<br />
&lt;javascript&gt;<br />
<br />
// This is a comment...<br />
<br />
/*   This is<br />
     also a comment   */<br />
<br />
&lt;/javascript&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-syntax-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; JavascriptTutorial &#8211; Syntax &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-syntax-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-syntax-unify-wiki-2/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 08:01:58 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=4DIS_-_JavascriptTutorial_-_Syntax</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/javascript&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

== '''Javascript Syntax''' ==

[[4DIS - JavascriptTutorial]] - Back

----

'''Comments :'''

&#60;syntaxhighlight lang=&#34;javascript&#34;&#62;

// This i...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/javascript&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>== '''Javascript Syntax''' ==<br />
<br />
[[4DIS - JavascriptTutorial]] - Back<br />
<br />
----<br />
<br />
'''Comments :'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
// This is a comment...<br />
<br />
/*   This is<br />
     also a comment   */<br />
<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-syntax-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; JavascriptTutorial &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-unify-wiki/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 08:00:09 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=4DIS_-_JavascriptTutorial</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''Javascript Tutorial''' ==

[[4D IS]] - Back

----

[[4DIS - JavascriptTutorial - Syntax]] - Syntax

[[4DIS - JavascriptTutorial - Variables]] - Variables

[[4DIS - JavascriptTutorial - Functions]] - Functions

[[4DIS - Ja...]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''Javascript Tutorial''' ==<br />
<br />
[[4D IS]] - Back<br />
<br />
----<br />
<br />
[[4DIS - JavascriptTutorial - Syntax]] - Syntax<br />
<br />
[[4DIS - JavascriptTutorial - Variables]] - Variables<br />
<br />
[[4DIS - JavascriptTutorial - Functions]] - Functions<br />
<br />
[[4DIS - JavascriptTutorial - Classes]] - Classes</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; JavascriptTutorial &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-unify-wiki-2/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 08:00:09 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=4DIS_-_JavascriptTutorial</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''Javascript Tutorial''' ==

[[4D IS]] - Back

----

[[4DIS - JavascriptTutorial - Syntax]] - Syntax

[[4DIS - JavascriptTutorial - Variables]] - Variables

[[4DIS - JavascriptTutorial - Functions]] - Functions

[[4DIS - Ja...]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''Javascript Tutorial''' ==<br />
<br />
[[4D IS]] - Back<br />
<br />
----<br />
<br />
[[4DIS - JavascriptTutorial - Syntax]] - Syntax<br />
<br />
[[4DIS - JavascriptTutorial - Variables]] - Variables<br />
<br />
[[4DIS - JavascriptTutorial - Functions]] - Functions<br />
<br />
[[4DIS - JavascriptTutorial - Classes]] - Classes</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/30/4dis-javascripttutorial-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; Character Controllers &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/29/4dis-character-controllers-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/29/4dis-character-controllers-unify-wiki/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 15:50:30 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=4DIS_-_Character_Controllers</guid>
		<description><![CDATA[4D Interactive Studio: /* Character Controllers */

== '''Character Controllers''' ==

[[4D IS]] - Back

----

'''Roll a ball :'''

&#60;javascript&#62;

@script RequireComponent ( Rigidbody )

public var speed : float = 5.0;
public var force : float = 7...]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: /* Character Controllers */</p>
<hr />
<div>== '''Character Controllers''' ==<br />
<br />
[[4D IS]] - Back<br />
<br />
----<br />
<br />
'''Roll a ball :'''<br />
<br />
&lt;javascript&gt;<br />
<br />
@script RequireComponent ( Rigidbody )<br />
<br />
public var speed : float = 5.0;<br />
public var force : float = 7.5;<br />
<br />
public var input : RollABallInput = new RollABallInput ( );<br />
<br />
private var motion : Vector3 = new Vector3 ( 0, 0, 0 );<br />
<br />
function Update ( )<br />
{<br />
    if ( Input.GetKey ( input.buttonUp ) )<br />
        motion.z = speed;<br />
    else if ( Input.GetKey ( input.buttonDown ) )<br />
        motion.z = - speed;<br />
    else<br />
        motion.z = 0;<br />
    <br />
    if ( Input.GetKey ( input.buttonRight ) )<br />
        motion.x = speed;<br />
    else if ( Input.GetKey ( input.buttonLeft ) )<br />
        motion.x = - speed;<br />
    else<br />
        motion.x = 0;<br />
    <br />
    motion.y = rigidbody.velocity.y;<br />
    <br />
    rigidbody.velocity = Vector3.Lerp ( rigidbody.velocity, motion, Time.deltaTime * force );<br />
}<br />
<br />
class RollABallInput<br />
{<br />
    function RollABallInput ( ) { }<br />
    <br />
    public var buttonUp : String = &quot;&quot;;<br />
    public var buttonLeft : String = &quot;&quot;;<br />
    public var buttonDown : String = &quot;&quot;;<br />
    public var buttonRight : String = &quot;&quot;;<br />
}<br />
<br />
&lt;/javascript&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/29/4dis-character-controllers-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; Character Controllers &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/29/4dis-character-controllers-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/29/4dis-character-controllers-unify-wiki-2/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 15:50:30 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=4DIS_-_Character_Controllers</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/javascript&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

== '''Character Controllers''' ==

[[4D IS]] - Back

----

'''Roll a ball :'''

&#60;syntaxhighlight lang=&#34;javascript&#34;&#62;

@script RequireCompone...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/javascript&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>== '''Character Controllers''' ==<br />
<br />
[[4D IS]] - Back<br />
<br />
----<br />
<br />
'''Roll a ball :'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
@script RequireComponent ( Rigidbody )<br />
<br />
public var speed : float = 5.0;<br />
public var force : float = 7.5;<br />
<br />
public var input : RollABallInput = new RollABallInput ( );<br />
<br />
private var motion : Vector3 = new Vector3 ( 0, 0, 0 );<br />
<br />
function Update ( )<br />
{<br />
    if ( Input.GetKey ( input.buttonUp ) )<br />
        motion.z = speed;<br />
    else if ( Input.GetKey ( input.buttonDown ) )<br />
        motion.z = - speed;<br />
    else<br />
        motion.z = 0;<br />
    <br />
    if ( Input.GetKey ( input.buttonRight ) )<br />
        motion.x = speed;<br />
    else if ( Input.GetKey ( input.buttonLeft ) )<br />
        motion.x = - speed;<br />
    else<br />
        motion.x = 0;<br />
    <br />
    motion.y = rigidbody.velocity.y;<br />
    <br />
    rigidbody.velocity = Vector3.Lerp ( rigidbody.velocity, motion, Time.deltaTime * force );<br />
}<br />
<br />
class RollABallInput<br />
{<br />
    function RollABallInput ( ) { }<br />
    <br />
    public var buttonUp : String = &quot;&quot;;<br />
    public var buttonLeft : String = &quot;&quot;;<br />
    public var buttonDown : String = &quot;&quot;;<br />
    public var buttonRight : String = &quot;&quot;;<br />
}<br />
<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/29/4dis-character-controllers-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; Unitypackgages &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/22/4dis-unitypackgages-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/22/4dis-unitypackgages-unify-wiki/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 09:58:59 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=4DIS_-_Unitypackgages</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''Unitypackgages''' ==

'''Graphic :'''

[[file:4DIS - Clouds.unitypackgage]] - Clouds]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''Unitypackgages''' ==<br />
<br />
'''Graphic :'''<br />
<br />
[[file:4DIS - Clouds.unitypackgage]] - Clouds</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/22/4dis-unitypackgages-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; Unitypackgages &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/22/4dis-unitypackgages-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/22/4dis-unitypackgages-unify-wiki-2/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 09:58:59 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=4DIS_-_Unitypackgages</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''Unitypackgages''' ==

'''Graphic :'''

[[file:4DIS - Clouds.unitypackgage]] - Clouds]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''Unitypackgages''' ==<br />
<br />
'''Graphic :'''<br />
<br />
[[file:4DIS - Clouds.unitypackgage]] - Clouds</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/22/4dis-unitypackgages-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; Sky Jump &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/22/4dis-sky-jump-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/22/4dis-sky-jump-unify-wiki/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 05:01:23 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=4DIS_-_Sky_Jump</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''Sky Jump''' ==

Sorry, we stopped the production of this game.

----

'''Screenshots :'''

----

[[image:SkyJumpScreenshot_A.png]]

[[image:SkyJumpScreenshot_B.png]]

[[image:SkyJumpScreenshot_C.png]]]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''Sky Jump''' ==<br />
<br />
Sorry, we stopped the production of this game.<br />
<br />
----<br />
<br />
'''Screenshots :'''<br />
<br />
----<br />
<br />
[[image:SkyJumpScreenshot_A.png]]<br />
<br />
[[image:SkyJumpScreenshot_B.png]]<br />
<br />
[[image:SkyJumpScreenshot_C.png]]</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/22/4dis-sky-jump-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; Sky Jump &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/22/4dis-sky-jump-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/22/4dis-sky-jump-unify-wiki-2/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 05:01:23 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=4DIS_-_Sky_Jump</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''Sky Jump''' ==

Sorry, we stopped the production of this game.

----

'''Screenshots :'''

----

[[image:SkyJumpScreenshot_A.png]]

[[image:SkyJumpScreenshot_B.png]]

[[image:SkyJumpScreenshot_C.png]]]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''Sky Jump''' ==<br />
<br />
Sorry, we stopped the production of this game.<br />
<br />
----<br />
<br />
'''Screenshots :'''<br />
<br />
----<br />
<br />
[[image:SkyJumpScreenshot_A.png]]<br />
<br />
[[image:SkyJumpScreenshot_B.png]]<br />
<br />
[[image:SkyJumpScreenshot_C.png]]</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/22/4dis-sky-jump-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; Camera Controller &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/21/4dis-camera-controller-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/21/4dis-camera-controller-unify-wiki/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 19:04:16 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=4DIS_-_Camera_Controller</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''Camera Controllers''' ==

[[4D IS]] - Back

----

'''Camera Controller A.js'''

&#60;javascript&#62;

// An easy camera controller that uses position and rotation...

public var target : Transform;

public var positionOffse...]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''Camera Controllers''' ==<br />
<br />
[[4D IS]] - Back<br />
<br />
----<br />
<br />
'''Camera Controller A.js'''<br />
<br />
&lt;javascript&gt;<br />
<br />
// An easy camera controller that uses position and rotation...<br />
<br />
public var target : Transform;<br />
<br />
public var positionOffset : Vector3 = new Vector3 ( 0, 0, 0 );<br />
public var rotationOffset : Vector3 = new Vector3 ( 0, 0, 0 );<br />
public var positionForce : float = 5.0;<br />
public var rotationForce : float = 5.0;<br />
<br />
private var position : Vector3 = new Vector3 ( 0, 0, 0 );<br />
private var rotation : Quaternion = new Quaternion ( 0, 0, 0, 0 );<br />
<br />
function Update ( )<br />
{<br />
	if ( ! target )<br />
		return null;<br />
	<br />
	position = Vector3.Lerp ( position, target.position, Time.deltaTime * positionForce );<br />
	rotation = Quaternion.Lerp ( rotation, target.rotation, Time.deltaTime * rotationForce );<br />
	<br />
	transform.position = position;<br />
	transform.rotation = rotation;<br />
	<br />
	transform.Rotate ( rotationOffset, Space.Self );<br />
	transform.Translate ( positionOffset, Space.Self );<br />
}<br />
<br />
&lt;/javascript&gt;<br />
<br />
'''Camera Controller B.js'''<br />
<br />
&lt;javascript&gt;<br />
<br />
// A camera controller that follows the target while it´s looking on it...<br />
<br />
public static var target : Transform;<br />
<br />
public var positionOffset : Vector3 = new Vector3 ( 0, 1, 4 );<br />
public var positionForce : float = 5.0;<br />
public var lookFactor : float = 0.3;<br />
public var lookForce : float = 0.6;<br />
<br />
private var position : Vector3 = new Vector3 ( 0, 0, 0 );<br />
private var rotation : Vector3 = new Vector3 ( 0, 0, 0 );<br />
<br />
function Update ( )<br />
{<br />
	if ( ! target )<br />
		return null;<br />
	<br />
	if ( positionForce &gt; 0 )<br />
		position = Vector3.Lerp ( position, target.position, Time.deltaTime * positionForce );<br />
	else<br />
		position = Vector3 ( 0, 0, 0 );<br />
	<br />
	if ( target.rigidbody )<br />
		rotation = Vector3.Lerp ( rotation, target.rigidbody.velocity * lookFactor, Time.deltaTime * lookForce );<br />
	<br />
	transform.rotation = Quaternion ( 0, 0, 0, 0 );<br />
	<br />
	transform.position = position;<br />
	transform.Translate ( positionOffset, Space.Self );<br />
	<br />
	transform.LookAt ( target.position + rotation );<br />
}<br />
<br />
&lt;/javascript&gt;<br />
<br />
'''Camera Controller C.js'''<br />
<br />
&lt;javascript&gt;<br />
<br />
// The same as &quot;Camera Controller B&quot; and this camera controller zooms back if the target is moving with a &quot;Rigidbody&quot;-component...<br />
<br />
public static var target : Transform;<br />
<br />
public var positionOffset : Vector3 = new Vector3 ( 0, 1.5, -4 );<br />
public var positionForce : float = 5.0;<br />
public var lookFactor : float = 0.3;<br />
public var lookForce : float = 0.6;<br />
public var viewForce : float = 5.0;<br />
public var minimalView : float = 60.0;<br />
public var maximalView : float = 140.0;<br />
public var maximalViewSpeed : float = 40.0;<br />
<br />
private var position : Vector3 = new Vector3 ( 0, 0, 0 );<br />
private var rotation : Vector3 = new Vector3 ( 0, 0, 0 );<br />
private var view : float = 0.0;<br />
<br />
function Awake ( )<br />
{<br />
	view = minimalView;<br />
}<br />
<br />
function FixedUpdate ( )<br />
{<br />
	if ( ! target )<br />
		return null;<br />
	<br />
	if ( positionForce &gt; 0 )<br />
		position = Vector3.Lerp ( position, target.position, Time.deltaTime * positionForce );<br />
	else<br />
		position = Vector3 ( 0, 0, 0 );<br />
	<br />
	if ( target.rigidbody )<br />
	{<br />
		rotation = Vector3.Lerp ( rotation, target.rigidbody.velocity * lookFactor, Time.deltaTime * lookForce );<br />
		<br />
		view = Mathf.Lerp ( view, Mathf.Lerp ( minimalView, maximalView, target.rigidbody.velocity.magnitude / maximalViewSpeed ), Time.deltaTime * viewForce );<br />
		<br />
		if ( camera )<br />
		{<br />
			camera.fieldOfView = view;<br />
		}<br />
	}	<br />
	<br />
	transform.rotation = Quaternion ( 0, 0, 0, 0 );<br />
	<br />
	transform.position = position;<br />
	transform.Translate ( positionOffset, Space.Self );<br />
	<br />
	transform.LookAt ( target.position + rotation );<br />
}<br />
<br />
&lt;/javascript&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/21/4dis-camera-controller-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; Camera Controller &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/21/4dis-camera-controller-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/21/4dis-camera-controller-unify-wiki-2/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 19:04:16 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=4DIS_-_Camera_Controller</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/javascript&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

== '''Camera Controllers''' ==

[[4D IS]] - Back

----

'''Camera Controller A.js'''

&#60;syntaxhighlight lang=&#34;javascript&#34;&#62;

// An easy camer...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/javascript&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>== '''Camera Controllers''' ==<br />
<br />
[[4D IS]] - Back<br />
<br />
----<br />
<br />
'''Camera Controller A.js'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
// An easy camera controller that uses position and rotation...<br />
<br />
public var target : Transform;<br />
<br />
public var positionOffset : Vector3 = new Vector3 ( 0, 0, 0 );<br />
public var rotationOffset : Vector3 = new Vector3 ( 0, 0, 0 );<br />
public var positionForce : float = 5.0;<br />
public var rotationForce : float = 5.0;<br />
<br />
private var position : Vector3 = new Vector3 ( 0, 0, 0 );<br />
private var rotation : Quaternion = new Quaternion ( 0, 0, 0, 0 );<br />
<br />
function Update ( )<br />
{<br />
	if ( ! target )<br />
		return null;<br />
	<br />
	position = Vector3.Lerp ( position, target.position, Time.deltaTime * positionForce );<br />
	rotation = Quaternion.Lerp ( rotation, target.rotation, Time.deltaTime * rotationForce );<br />
	<br />
	transform.position = position;<br />
	transform.rotation = rotation;<br />
	<br />
	transform.Rotate ( rotationOffset, Space.Self );<br />
	transform.Translate ( positionOffset, Space.Self );<br />
}<br />
<br />
&lt;/syntaxhighlight&gt;<br />
<br />
'''Camera Controller B.js'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
// A camera controller that follows the target while it´s looking on it...<br />
<br />
public static var target : Transform;<br />
<br />
public var positionOffset : Vector3 = new Vector3 ( 0, 1, 4 );<br />
public var positionForce : float = 5.0;<br />
public var lookFactor : float = 0.3;<br />
public var lookForce : float = 0.6;<br />
<br />
private var position : Vector3 = new Vector3 ( 0, 0, 0 );<br />
private var rotation : Vector3 = new Vector3 ( 0, 0, 0 );<br />
<br />
function Update ( )<br />
{<br />
	if ( ! target )<br />
		return null;<br />
	<br />
	if ( positionForce &gt; 0 )<br />
		position = Vector3.Lerp ( position, target.position, Time.deltaTime * positionForce );<br />
	else<br />
		position = Vector3 ( 0, 0, 0 );<br />
	<br />
	if ( target.rigidbody )<br />
		rotation = Vector3.Lerp ( rotation, target.rigidbody.velocity * lookFactor, Time.deltaTime * lookForce );<br />
	<br />
	transform.rotation = Quaternion ( 0, 0, 0, 0 );<br />
	<br />
	transform.position = position;<br />
	transform.Translate ( positionOffset, Space.Self );<br />
	<br />
	transform.LookAt ( target.position + rotation );<br />
}<br />
<br />
&lt;/syntaxhighlight&gt;<br />
<br />
'''Camera Controller C.js'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
// The same as &quot;Camera Controller B&quot; and this camera controller zooms back if the target is moving with a &quot;Rigidbody&quot;-component...<br />
<br />
public static var target : Transform;<br />
<br />
public var positionOffset : Vector3 = new Vector3 ( 0, 1.5, -4 );<br />
public var positionForce : float = 5.0;<br />
public var lookFactor : float = 0.3;<br />
public var lookForce : float = 0.6;<br />
public var viewForce : float = 5.0;<br />
public var minimalView : float = 60.0;<br />
public var maximalView : float = 140.0;<br />
public var maximalViewSpeed : float = 40.0;<br />
<br />
private var position : Vector3 = new Vector3 ( 0, 0, 0 );<br />
private var rotation : Vector3 = new Vector3 ( 0, 0, 0 );<br />
private var view : float = 0.0;<br />
<br />
function Awake ( )<br />
{<br />
	view = minimalView;<br />
}<br />
<br />
function FixedUpdate ( )<br />
{<br />
	if ( ! target )<br />
		return null;<br />
	<br />
	if ( positionForce &gt; 0 )<br />
		position = Vector3.Lerp ( position, target.position, Time.deltaTime * positionForce );<br />
	else<br />
		position = Vector3 ( 0, 0, 0 );<br />
	<br />
	if ( target.rigidbody )<br />
	{<br />
		rotation = Vector3.Lerp ( rotation, target.rigidbody.velocity * lookFactor, Time.deltaTime * lookForce );<br />
		<br />
		view = Mathf.Lerp ( view, Mathf.Lerp ( minimalView, maximalView, target.rigidbody.velocity.magnitude / maximalViewSpeed ), Time.deltaTime * viewForce );<br />
		<br />
		if ( camera )<br />
		{<br />
			camera.fieldOfView = view;<br />
		}<br />
	}	<br />
	<br />
	transform.rotation = Quaternion ( 0, 0, 0, 0 );<br />
	<br />
	transform.position = position;<br />
	transform.Translate ( positionOffset, Space.Self );<br />
	<br />
	transform.LookAt ( target.position + rotation );<br />
}<br />
<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/21/4dis-camera-controller-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; XLF &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/21/4dis-xlf-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/21/4dis-xlf-unify-wiki/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 19:00:21 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=4DIS_-_XLF</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''X-Language-File''' ==

[[4D IS]] - Back


XLF is a class to read and write files.

'''Functions :'''

&#60;javascript&#62;

var file : XLF = new XLF ( );
var file : XLF = new XLF ( &#34;...url to load on awake...&#34; );
...]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''X-Language-File''' ==<br />
<br />
[[4D IS]] - Back<br />
<br />
<br />
XLF is a class to read and write files.<br />
<br />
'''Functions :'''<br />
<br />
&lt;javascript&gt;<br />
<br />
var file : XLF = new XLF ( );<br />
var file : XLF = new XLF ( &quot;...url to load on awake...&quot; );<br />
var file : XLF = new XLF ( &quot;...url to load on awake...&quot;, key as int );<br />
<br />
file.LoadFile ( &quot;...url...&quot; );<br />
file.LoadFile ( &quot;...url...&quot;, key as int );<br />
<br />
file.SaveFile ( &quot;...url...&quot; );<br />
file.SaveFile ( &quot;...url...&quot;, key as int );<br />
<br />
file.Clear ( ); // Deletes all elements<br />
<br />
file.SetElement ( &quot;...name...&quot;, element as Vector3 Quaternion int float String and boolean );<br />
<br />
file.ReadElement ( &quot;...name...&quot; ) : int float String or boolean;<br />
file.ReadVector3 ( &quot;...name...&quot; ) : Vector3;<br />
file.ReadQuaternion ( &quot;...name...&quot; ) : Quaternion;<br />
<br />
file.AddXLF ( &quot;...name...&quot;, otherFile as XLF );<br />
file.GetXLF ( &quot;...name...&quot; ) : XLF );<br />
<br />
file.ExistsElement ( &quot;...name...&quot; ) : boolean;<br />
<br />
&lt;/javascript&gt;<br />
<br />
----<br />
<br />
'''You need ...'''<br />
<br />
[[4DIS - IO]]<br />
<br />
[[4DIS - FileEncryption]]<br />
<br />
'''... and ...'''<br />
<br />
XLF.js<br />
<br />
&lt;javascript&gt;<br />
<br />
class XLF<br />
{<br />
	function XLF ( )<br />
	{<br />
		data = new Array ( );<br />
	}<br />
	<br />
	function XLF ( url : String )<br />
	{<br />
		data = new Array ( );<br />
		<br />
		LoadFile ( url );<br />
	}<br />
	<br />
	function XLF ( url : String, key : int )<br />
	{<br />
		data = new Array ( );<br />
		<br />
		LoadFile ( url, key );<br />
	}<br />
	<br />
	public var data : Array;<br />
	<br />
	public function FromString ( s : String )<br />
	{<br />
		Clear ( );<br />
		<br />
		var seperator : char = &quot;&#92;n&quot; [ 0 ];<br />
		var list : String [ ] = s.Split ( seperator );<br />
		<br />
		for ( var i : int = 0; i &lt; list.length; i++ )<br />
		{<br />
			data.Push ( XLFVar ( list [ i ] ) );<br />
		}<br />
	}<br />
	<br />
	public function ToString ( )<br />
	{<br />
		var rs : String = &quot;&quot;;<br />
		<br />
		for ( var i : int = 0; i &lt; data.length - 1; i++ )<br />
			rs += data [ i ].ToString ( ) + &quot;&#92;n&quot;;<br />
		<br />
		rs += data [ i ].ToString ( );<br />
		<br />
		return rs;<br />
	}<br />
	<br />
	public function Clear ( )<br />
	{<br />
		while ( data.length &gt; 0 )<br />
			data.RemoveAt ( 0 );<br />
	}<br />
	<br />
	public function LoadFile ( url : String )<br />
	{<br />
		if ( IO.ExistsFile ( url ) )<br />
			FromString ( IO.ReadFile ( url ) );<br />
	}<br />
	<br />
	public function LoadFile ( url : String, key : int )<br />
	{<br />
		if ( IO.ExistsFile ( url ) )<br />
			FromString ( FileEncryption.Encrypt ( IO.ReadFile ( url ), key ) );<br />
	}<br />
	<br />
	public function SaveFile ( url : String )<br />
	{<br />
		IO.WriteFile ( url, ToString ( ) );<br />
	}<br />
	<br />
	public function SaveFile ( url : String, key : int )<br />
	{<br />
		IO.WriteFile ( url, FileEncryption.Encrypt ( ToString ( ), key ) );<br />
	}<br />
	<br />
	public function SetElement ( name : String, value : Vector3 )<br />
	{<br />
		RemoveElement ( name + &quot;_x&quot; );<br />
		RemoveElement ( name + &quot;_y&quot; );<br />
		RemoveElement ( name + &quot;_z&quot; );<br />
		<br />
		AddElement ( name + &quot;_x&quot;, value.x );<br />
		AddElement ( name + &quot;_y&quot;, value.y );<br />
		AddElement ( name + &quot;_z&quot;, value.z );<br />
	}<br />
	<br />
	public function SetElement ( name : String, value : Quaternion )<br />
	{<br />
		RemoveElement ( name + &quot;_x&quot; );<br />
		RemoveElement ( name + &quot;_y&quot; );<br />
		RemoveElement ( name + &quot;_z&quot; );<br />
		RemoveElement ( name + &quot;_w&quot; );<br />
		<br />
		AddElement ( name + &quot;_x&quot;, value.x );<br />
		AddElement ( name + &quot;_y&quot;, value.y );<br />
		AddElement ( name + &quot;_z&quot;, value.z );<br />
		AddElement ( name + &quot;_w&quot;, value.w );<br />
	}<br />
	<br />
	public function ReadVector3 ( name : String )<br />
	{<br />
		var nv3 : Vector3 = new Vector3 ( 0, 0, 0 );<br />
		<br />
		if ( ExistsElement ( name + &quot;_x&quot; ) )<br />
			nv3.x = data [ FindElement ( name + &quot;_x&quot; ) ].value;<br />
		<br />
		if ( ExistsElement ( name + &quot;_y&quot; ) )<br />
			nv3.y = data [ FindElement ( name + &quot;_y&quot; ) ].value;<br />
		<br />
		if ( ExistsElement ( name + &quot;_z&quot; ) )<br />
			nv3.z = data [ FindElement ( name + &quot;_z&quot; ) ].value;<br />
		<br />
		return nv3;<br />
	}<br />
	<br />
	public function ReadQuaternion ( name : String )<br />
	{<br />
		var nv4 : Quaternion = new Quaternion ( 0, 0, 0, 0 );<br />
		<br />
		if ( ExistsElement ( name + &quot;_x&quot; ) )<br />
			nv4.x = data [ FindElement ( name + &quot;_x&quot; ) ].value;<br />
		<br />
		if ( ExistsElement ( name + &quot;_y&quot; ) )<br />
			nv4.y = data [ FindElement ( name + &quot;_y&quot; ) ].value;<br />
		<br />
		if ( ExistsElement ( name + &quot;_z&quot; ) )<br />
			nv4.z = data [ FindElement ( name + &quot;_z&quot; ) ].value;<br />
		<br />
		if ( ExistsElement ( name + &quot;_w&quot; ) )<br />
			nv4.w = data [ FindElement ( name + &quot;_w&quot; ) ].value;<br />
		<br />
		return nv4;<br />
	}<br />
	<br />
	public function AddXLF ( name : String, xlf : XLF )<br />
	{<br />
		for ( var e : XLFVar in xlf.data )<br />
		{<br />
			RemoveElement ( name + &quot;_&quot; + e.name );<br />
			<br />
			AddElement ( name + &quot;_&quot; + e.name, e.value );<br />
		}<br />
	}<br />
	<br />
	public function GetXLF ( name : String )<br />
	{<br />
		var xlf : XLF = new XLF ( );<br />
		<br />
		for ( var e : XLFVar in data )<br />
			if ( name == e.name.Substring ( 0, name.length ) )<br />
				xlf.AddElement ( e.name.Substring ( name.length, e.name.length ), e.value );<br />
	}<br />
	<br />
	public function SetElement ( name : String, value : Object )<br />
	{<br />
		RemoveElement ( name );<br />
		<br />
		AddElement ( name, value );<br />
	}<br />
	<br />
	public function ReadElement ( name : String )<br />
	{<br />
		if ( ExistsElement ( name ) )<br />
			return data [ FindElement ( name ) ].value;<br />
		else<br />
			return null;<br />
	}<br />
	<br />
	public function ExistsElement ( name : String )<br />
	{<br />
		for ( var i : int = 0; i &lt; data.length; i++ )<br />
			if ( data [ i ].name == name )<br />
				return true;<br />
		<br />
		return false;<br />
	}<br />
	<br />
	public function FindElement ( name : String )<br />
	{<br />
		for ( var i : int = 0; i &lt; data.length; i++ )<br />
			if ( data [ i ].name == name )<br />
				return i;<br />
		<br />
		return 0;<br />
	}<br />
	<br />
	public function AddElement ( name : String, value : String )<br />
	{<br />
		if ( ! ExistsElement ( name ) )<br />
			data.Push ( XLFVar ( name, &quot;string&quot;, value ) );<br />
		else<br />
			Debug.LogError ( &quot;Element does already exists&quot; );<br />
	}<br />
	<br />
	public function AddElement ( name : String, value : int )<br />
	{<br />
		if ( ! ExistsElement ( name ) )<br />
			data.Push ( XLFVar ( name, &quot;int&quot;, value ) );<br />
		else<br />
			Debug.LogError ( &quot;Element does already exists&quot; );<br />
	}<br />
	<br />
	public function AddElement ( name : String, value : float )<br />
	{<br />
		if ( ! ExistsElement ( name ) )<br />
			data.Push ( XLFVar ( name, &quot;float&quot;, value ) );<br />
		else<br />
			Debug.LogError ( &quot;Element does already exists&quot; );<br />
	}<br />
	<br />
	public function AddElement ( name : String, value : boolean )<br />
	{<br />
		if ( ! ExistsElement ( name ) )<br />
			data.Push ( XLFVar ( name, &quot;bool&quot;, value ) );<br />
		else<br />
			Debug.LogError ( &quot;Element does already exists&quot; );<br />
	}<br />
	<br />
	public function RemoveElement ( name : String )<br />
	{<br />
		for ( var i : int = 0; i &lt; data.length; i++ )<br />
			if ( data [ i ].name == name )<br />
			{<br />
				data.RemoveAt ( i );<br />
				break;<br />
			}<br />
	}<br />
}<br />
<br />
class XLFVar<br />
{<br />
	function XLFVar ( ) { }<br />
	<br />
	function XLFVar ( n : String, t : String, v : Object )<br />
	{<br />
		name = n;<br />
		type = t;<br />
		value = v;<br />
	}<br />
	<br />
	function XLFVar ( s : String )<br />
	{<br />
		FromString ( s );<br />
	}<br />
	<br />
	public var name : String = &quot;&quot;;<br />
	public var type : String = &quot;&quot;;<br />
	public var value : Object;<br />
	<br />
	public function FromString ( s : String )<br />
	{<br />
		var list : Array = XLFList.Compile ( s );<br />
		<br />
		if ( list.length &lt; 3 )<br />
			return null;<br />
		<br />
		name = list [ 0 ];<br />
		type = list [ 1 ];<br />
		<br />
		if ( type == &quot;string&quot; )<br />
			value = list [ 2 ];<br />
		else if ( type == &quot;int&quot; )<br />
			value = XLFStream.StringToInt ( list [ 2 ] );<br />
		else if ( type == &quot;float&quot; )<br />
			value = XLFStream.StringToFloat ( list [ 2 ] );<br />
		else if ( type == &quot;bool&quot; )<br />
			value = XLFStream.StringToBool ( list [ 2 ] );<br />
	}<br />
	<br />
	public function ToString ( )<br />
	{<br />
		var list : Array = new Array ( );<br />
		<br />
		list.length = 3;<br />
		<br />
		list [ 0 ] = name;<br />
		list [ 1 ] = type;<br />
		<br />
		if ( type == &quot;string&quot; )<br />
			list [ 2 ] = value;<br />
		else if ( type == &quot;int&quot; )<br />
			list [ 2 ] = XLFStream.IntToString ( value );<br />
		else if ( type == &quot;float&quot; )<br />
			list [ 2 ] = XLFStream.FloatToString ( value );<br />
		else if ( type == &quot;bool&quot; )<br />
			list [ 2 ] = XLFStream.BoolToString ( value );<br />
		<br />
		return XLFList.Generate ( list );<br />
	}<br />
}<br />
<br />
class XLFStream<br />
{<br />
	public static function IntToString ( s : int )<br />
	{<br />
		return s.ToString ( );<br />
	}<br />
	<br />
	public static function StringToInt ( s : String )<br />
	{<br />
		var rv : int = 0;<br />
		var factor : int = 1;<br />
		<br />
		for ( var i : int = s.length - 1; i &gt;= 0; i-- )<br />
		{<br />
			for ( var c : int = 0; c &lt; 10; c++ )<br />
				if ( c.ToString ( ) == s [ i ] )<br />
				{<br />
					rv += c * factor;<br />
					factor *= 10;<br />
				}<br />
		}<br />
		<br />
		if ( s.IndexOf ( &quot;-&quot; ) != -1 )<br />
			rv *= -1;<br />
		<br />
		return rv;<br />
	}<br />
	<br />
	public static function FloatToString ( s : float )<br />
	{<br />
		var edit : String = s.ToString ( );<br />
		<br />
		if ( edit.IndexOf ( &quot;,&quot; ) == -1 )<br />
			if ( edit.IndexOf ( &quot;.&quot; ) == -1 )<br />
				edit += &quot;.0&quot;;<br />
		<br />
		return edit;<br />
	}<br />
	<br />
	public static function StringToFloat ( s : String )<br />
	{<br />
		if ( s.IndexOf ( &quot;,&quot; ) == -1 )<br />
			if ( s.IndexOf ( &quot;.&quot; ) == -1 )<br />
				return StringToInt ( s );<br />
		<br />
		var rv : float = 0;<br />
		var factor : float = 1.0;<br />
		var ff : int = 0;<br />
		<br />
		if ( s.IndexOf ( &quot;,&quot; ) != -1 )<br />
			ff = s.IndexOf ( &quot;,&quot; );<br />
		else<br />
			ff = s.IndexOf ( &quot;.&quot; );<br />
		<br />
		ff = s.length - ff - 1;<br />
		<br />
		for ( var f : int = 0; f &lt; ff; f++ )<br />
			factor /= 10;<br />
		<br />
		for ( var i : int = s.length - 1; i &gt;= 0; i-- )<br />
		{<br />
			for ( var c : int = 0; c &lt; 9; c++ )<br />
				if ( c.ToString ( ) == s [ i ] )<br />
				{<br />
					rv += c * factor;<br />
					factor *= 10;<br />
				}<br />
		}<br />
		<br />
		if ( s.IndexOf ( &quot;-&quot; ) != -1 )<br />
			rv *= -1;<br />
		<br />
		return rv;<br />
	}<br />
	<br />
	public static function BoolToString ( s : boolean )<br />
	{<br />
		if ( s )<br />
			return &quot;true&quot;;<br />
		else<br />
			return &quot;false&quot;;<br />
	}<br />
	<br />
	public static function StringToBool ( s : String )<br />
	{<br />
		if ( s == &quot;true&quot; )<br />
			return true;<br />
		else<br />
			return false;<br />
	}<br />
}<br />
<br />
class XLFList<br />
{<br />
	public static function Compile ( s : String )<br />
	{<br />
		var list : Array = new Array ( );<br />
		var index : boolean = false;<br />
		var temp : String = &quot;&quot;;<br />
		<br />
		for ( var i : int = 0; i &lt; s.length; i++ )<br />
		{<br />
			if ( index == false )<br />
			{<br />
				if ( s [ i ] == &quot;&lt;&quot; )<br />
					index = true;<br />
				else if ( s [ i ] == &quot; &quot; )<br />
					index = true;<br />
				else if ( s [ i ] == &quot;&gt;&quot; )<br />
					break;<br />
			}<br />
			else if ( index == true )<br />
			{<br />
				temp += s [ i ];<br />
				<br />
				if ( i &lt; s.length )<br />
				{<br />
					if ( s [ i + 1 ] == &quot; &quot; )<br />
					{<br />
						index = false;<br />
						<br />
						list.Push ( temp );<br />
						temp = &quot;&quot;;<br />
					}<br />
					else if ( s [ i + 1 ] == &quot;&gt;&quot; )<br />
					{<br />
						index = false;<br />
						<br />
						list.Push ( temp );<br />
						temp = &quot;&quot;;<br />
					}<br />
				}<br />
			}<br />
		}<br />
		<br />
		for ( var b : int = 0; b &lt; list.length; b++ )<br />
			list [ b ] = XLFString.PlaceSpecial ( list [ b ] );<br />
		<br />
		return list;<br />
	}<br />
	<br />
	public static function Generate ( s : Array )<br />
	{<br />
		if ( s.length == 0 )<br />
			return &quot;&lt;&gt;&quot;;<br />
		<br />
		var rs : String = &quot;&lt;&quot;;<br />
		<br />
		for ( var i : int = 0; i &lt; s.length - 1; i++ )<br />
		{<br />
			rs += XLFString.ReplaceSpecial ( s [ i ] ) + &quot; &quot;;<br />
		}<br />
		<br />
		var le : String= s [ s.length - 1 ];<br />
		<br />
		rs += XLFString.ReplaceSpecial ( le );<br />
		<br />
		rs += &quot;&gt;&quot;;<br />
		<br />
		return rs;<br />
	}<br />
}<br />
<br />
class XLFString<br />
{<br />
	public static function ReplaceSpecial ( s : String )<br />
	{<br />
		var edit : String = s;<br />
		<br />
		while ( edit.IndexOf ( &quot;[&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[&quot;, &quot;temp:squareBrackedOpen&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;]&quot;, &quot;temp:squareBrackedClose&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;temp:squareBrackedClose&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;temp:squareBrackedClose&quot;, &quot;[squareBrackedClose]&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;temp:squareBrackedOpen&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;temp:squareBrackedOpen&quot;, &quot;[squareBrackedOpen]&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;&lt;&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;&lt;&quot;, &quot;[brackedOpen]&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot; &quot; ) != -1 )<br />
			edit = edit.Replace ( &quot; &quot;, &quot;[space]&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;&gt;&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;&gt;&quot;, &quot;[brackedClose]&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;&#92;n&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;&#92;n&quot;, &quot;[nextLine]&quot; );<br />
		<br />
		return edit;<br />
	}<br />
	<br />
	public static function PlaceSpecial ( s : String )<br />
	{<br />
		var edit : String = s;<br />
		<br />
		while ( edit.IndexOf ( &quot;[squareBrackedOpen]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[squareBrackedOpen]&quot;, &quot;[&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;[squareBrackedClose]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[squareBrackedClose]&quot;, &quot;]&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;[brackedOpen]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[brackedOpen]&quot;, &quot;&lt;&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;[space]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[space]&quot;, &quot; &quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;[brackedClose]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[brackedClose]&quot;, &quot;&gt;&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;[nextLine]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[nextLine]&quot;, &quot;&#92;n&quot; );<br />
		<br />
		return edit;<br />
	}<br />
}<br />
<br />
&lt;/javascript&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/21/4dis-xlf-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4DIS &#8211; XLF &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/21/4dis-xlf-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/21/4dis-xlf-unify-wiki-2/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 19:00:21 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=4DIS_-_XLF</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/javascript&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

== '''X-Language-File''' ==

[[4D IS]] - Back


XLF is a class to read and write files.

'''Functions :'''

&#60;syntaxhighlight lang=&#34;javascript&#34;...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/javascript&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>== '''X-Language-File''' ==<br />
<br />
[[4D IS]] - Back<br />
<br />
<br />
XLF is a class to read and write files.<br />
<br />
'''Functions :'''<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
var file : XLF = new XLF ( );<br />
var file : XLF = new XLF ( &quot;...url to load on awake...&quot; );<br />
var file : XLF = new XLF ( &quot;...url to load on awake...&quot;, key as int );<br />
<br />
file.LoadFile ( &quot;...url...&quot; );<br />
file.LoadFile ( &quot;...url...&quot;, key as int );<br />
<br />
file.SaveFile ( &quot;...url...&quot; );<br />
file.SaveFile ( &quot;...url...&quot;, key as int );<br />
<br />
file.Clear ( ); // Deletes all elements<br />
<br />
file.SetElement ( &quot;...name...&quot;, element as Vector3 Quaternion int float String and boolean );<br />
<br />
file.ReadElement ( &quot;...name...&quot; ) : int float String or boolean;<br />
file.ReadVector3 ( &quot;...name...&quot; ) : Vector3;<br />
file.ReadQuaternion ( &quot;...name...&quot; ) : Quaternion;<br />
<br />
file.AddXLF ( &quot;...name...&quot;, otherFile as XLF );<br />
file.GetXLF ( &quot;...name...&quot; ) : XLF );<br />
<br />
file.ExistsElement ( &quot;...name...&quot; ) : boolean;<br />
<br />
&lt;/syntaxhighlight&gt;<br />
<br />
----<br />
<br />
'''You need ...'''<br />
<br />
[[4DIS - IO]]<br />
<br />
[[4DIS - FileEncryption]]<br />
<br />
'''... and ...'''<br />
<br />
XLF.js<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
class XLF<br />
{<br />
	function XLF ( )<br />
	{<br />
		data = new Array ( );<br />
	}<br />
	<br />
	function XLF ( url : String )<br />
	{<br />
		data = new Array ( );<br />
		<br />
		LoadFile ( url );<br />
	}<br />
	<br />
	function XLF ( url : String, key : int )<br />
	{<br />
		data = new Array ( );<br />
		<br />
		LoadFile ( url, key );<br />
	}<br />
	<br />
	public var data : Array;<br />
	<br />
	public function FromString ( s : String )<br />
	{<br />
		Clear ( );<br />
		<br />
		var seperator : char = &quot;&#92;n&quot; [ 0 ];<br />
		var list : String [ ] = s.Split ( seperator );<br />
		<br />
		for ( var i : int = 0; i &lt; list.length; i++ )<br />
		{<br />
			data.Push ( XLFVar ( list [ i ] ) );<br />
		}<br />
	}<br />
	<br />
	public function ToString ( )<br />
	{<br />
		var rs : String = &quot;&quot;;<br />
		<br />
		for ( var i : int = 0; i &lt; data.length - 1; i++ )<br />
			rs += data [ i ].ToString ( ) + &quot;&#92;n&quot;;<br />
		<br />
		rs += data [ i ].ToString ( );<br />
		<br />
		return rs;<br />
	}<br />
	<br />
	public function Clear ( )<br />
	{<br />
		while ( data.length &gt; 0 )<br />
			data.RemoveAt ( 0 );<br />
	}<br />
	<br />
	public function LoadFile ( url : String )<br />
	{<br />
		if ( IO.ExistsFile ( url ) )<br />
			FromString ( IO.ReadFile ( url ) );<br />
	}<br />
	<br />
	public function LoadFile ( url : String, key : int )<br />
	{<br />
		if ( IO.ExistsFile ( url ) )<br />
			FromString ( FileEncryption.Encrypt ( IO.ReadFile ( url ), key ) );<br />
	}<br />
	<br />
	public function SaveFile ( url : String )<br />
	{<br />
		IO.WriteFile ( url, ToString ( ) );<br />
	}<br />
	<br />
	public function SaveFile ( url : String, key : int )<br />
	{<br />
		IO.WriteFile ( url, FileEncryption.Encrypt ( ToString ( ), key ) );<br />
	}<br />
	<br />
	public function SetElement ( name : String, value : Vector3 )<br />
	{<br />
		RemoveElement ( name + &quot;_x&quot; );<br />
		RemoveElement ( name + &quot;_y&quot; );<br />
		RemoveElement ( name + &quot;_z&quot; );<br />
		<br />
		AddElement ( name + &quot;_x&quot;, value.x );<br />
		AddElement ( name + &quot;_y&quot;, value.y );<br />
		AddElement ( name + &quot;_z&quot;, value.z );<br />
	}<br />
	<br />
	public function SetElement ( name : String, value : Quaternion )<br />
	{<br />
		RemoveElement ( name + &quot;_x&quot; );<br />
		RemoveElement ( name + &quot;_y&quot; );<br />
		RemoveElement ( name + &quot;_z&quot; );<br />
		RemoveElement ( name + &quot;_w&quot; );<br />
		<br />
		AddElement ( name + &quot;_x&quot;, value.x );<br />
		AddElement ( name + &quot;_y&quot;, value.y );<br />
		AddElement ( name + &quot;_z&quot;, value.z );<br />
		AddElement ( name + &quot;_w&quot;, value.w );<br />
	}<br />
	<br />
	public function ReadVector3 ( name : String )<br />
	{<br />
		var nv3 : Vector3 = new Vector3 ( 0, 0, 0 );<br />
		<br />
		if ( ExistsElement ( name + &quot;_x&quot; ) )<br />
			nv3.x = data [ FindElement ( name + &quot;_x&quot; ) ].value;<br />
		<br />
		if ( ExistsElement ( name + &quot;_y&quot; ) )<br />
			nv3.y = data [ FindElement ( name + &quot;_y&quot; ) ].value;<br />
		<br />
		if ( ExistsElement ( name + &quot;_z&quot; ) )<br />
			nv3.z = data [ FindElement ( name + &quot;_z&quot; ) ].value;<br />
		<br />
		return nv3;<br />
	}<br />
	<br />
	public function ReadQuaternion ( name : String )<br />
	{<br />
		var nv4 : Quaternion = new Quaternion ( 0, 0, 0, 0 );<br />
		<br />
		if ( ExistsElement ( name + &quot;_x&quot; ) )<br />
			nv4.x = data [ FindElement ( name + &quot;_x&quot; ) ].value;<br />
		<br />
		if ( ExistsElement ( name + &quot;_y&quot; ) )<br />
			nv4.y = data [ FindElement ( name + &quot;_y&quot; ) ].value;<br />
		<br />
		if ( ExistsElement ( name + &quot;_z&quot; ) )<br />
			nv4.z = data [ FindElement ( name + &quot;_z&quot; ) ].value;<br />
		<br />
		if ( ExistsElement ( name + &quot;_w&quot; ) )<br />
			nv4.w = data [ FindElement ( name + &quot;_w&quot; ) ].value;<br />
		<br />
		return nv4;<br />
	}<br />
	<br />
	public function AddXLF ( name : String, xlf : XLF )<br />
	{<br />
		for ( var e : XLFVar in xlf.data )<br />
		{<br />
			RemoveElement ( name + &quot;_&quot; + e.name );<br />
			<br />
			AddElement ( name + &quot;_&quot; + e.name, e.value );<br />
		}<br />
	}<br />
	<br />
	public function GetXLF ( name : String )<br />
	{<br />
		var xlf : XLF = new XLF ( );<br />
		<br />
		for ( var e : XLFVar in data )<br />
			if ( name == e.name.Substring ( 0, name.length ) )<br />
				xlf.AddElement ( e.name.Substring ( name.length, e.name.length ), e.value );<br />
	}<br />
	<br />
	public function SetElement ( name : String, value : Object )<br />
	{<br />
		RemoveElement ( name );<br />
		<br />
		AddElement ( name, value );<br />
	}<br />
	<br />
	public function ReadElement ( name : String )<br />
	{<br />
		if ( ExistsElement ( name ) )<br />
			return data [ FindElement ( name ) ].value;<br />
		else<br />
			return null;<br />
	}<br />
	<br />
	public function ExistsElement ( name : String )<br />
	{<br />
		for ( var i : int = 0; i &lt; data.length; i++ )<br />
			if ( data [ i ].name == name )<br />
				return true;<br />
		<br />
		return false;<br />
	}<br />
	<br />
	public function FindElement ( name : String )<br />
	{<br />
		for ( var i : int = 0; i &lt; data.length; i++ )<br />
			if ( data [ i ].name == name )<br />
				return i;<br />
		<br />
		return 0;<br />
	}<br />
	<br />
	public function AddElement ( name : String, value : String )<br />
	{<br />
		if ( ! ExistsElement ( name ) )<br />
			data.Push ( XLFVar ( name, &quot;string&quot;, value ) );<br />
		else<br />
			Debug.LogError ( &quot;Element does already exists&quot; );<br />
	}<br />
	<br />
	public function AddElement ( name : String, value : int )<br />
	{<br />
		if ( ! ExistsElement ( name ) )<br />
			data.Push ( XLFVar ( name, &quot;int&quot;, value ) );<br />
		else<br />
			Debug.LogError ( &quot;Element does already exists&quot; );<br />
	}<br />
	<br />
	public function AddElement ( name : String, value : float )<br />
	{<br />
		if ( ! ExistsElement ( name ) )<br />
			data.Push ( XLFVar ( name, &quot;float&quot;, value ) );<br />
		else<br />
			Debug.LogError ( &quot;Element does already exists&quot; );<br />
	}<br />
	<br />
	public function AddElement ( name : String, value : boolean )<br />
	{<br />
		if ( ! ExistsElement ( name ) )<br />
			data.Push ( XLFVar ( name, &quot;bool&quot;, value ) );<br />
		else<br />
			Debug.LogError ( &quot;Element does already exists&quot; );<br />
	}<br />
	<br />
	public function RemoveElement ( name : String )<br />
	{<br />
		for ( var i : int = 0; i &lt; data.length; i++ )<br />
			if ( data [ i ].name == name )<br />
			{<br />
				data.RemoveAt ( i );<br />
				break;<br />
			}<br />
	}<br />
}<br />
<br />
class XLFVar<br />
{<br />
	function XLFVar ( ) { }<br />
	<br />
	function XLFVar ( n : String, t : String, v : Object )<br />
	{<br />
		name = n;<br />
		type = t;<br />
		value = v;<br />
	}<br />
	<br />
	function XLFVar ( s : String )<br />
	{<br />
		FromString ( s );<br />
	}<br />
	<br />
	public var name : String = &quot;&quot;;<br />
	public var type : String = &quot;&quot;;<br />
	public var value : Object;<br />
	<br />
	public function FromString ( s : String )<br />
	{<br />
		var list : Array = XLFList.Compile ( s );<br />
		<br />
		if ( list.length &lt; 3 )<br />
			return null;<br />
		<br />
		name = list [ 0 ];<br />
		type = list [ 1 ];<br />
		<br />
		if ( type == &quot;string&quot; )<br />
			value = list [ 2 ];<br />
		else if ( type == &quot;int&quot; )<br />
			value = XLFStream.StringToInt ( list [ 2 ] );<br />
		else if ( type == &quot;float&quot; )<br />
			value = XLFStream.StringToFloat ( list [ 2 ] );<br />
		else if ( type == &quot;bool&quot; )<br />
			value = XLFStream.StringToBool ( list [ 2 ] );<br />
	}<br />
	<br />
	public function ToString ( )<br />
	{<br />
		var list : Array = new Array ( );<br />
		<br />
		list.length = 3;<br />
		<br />
		list [ 0 ] = name;<br />
		list [ 1 ] = type;<br />
		<br />
		if ( type == &quot;string&quot; )<br />
			list [ 2 ] = value;<br />
		else if ( type == &quot;int&quot; )<br />
			list [ 2 ] = XLFStream.IntToString ( value );<br />
		else if ( type == &quot;float&quot; )<br />
			list [ 2 ] = XLFStream.FloatToString ( value );<br />
		else if ( type == &quot;bool&quot; )<br />
			list [ 2 ] = XLFStream.BoolToString ( value );<br />
		<br />
		return XLFList.Generate ( list );<br />
	}<br />
}<br />
<br />
class XLFStream<br />
{<br />
	public static function IntToString ( s : int )<br />
	{<br />
		return s.ToString ( );<br />
	}<br />
	<br />
	public static function StringToInt ( s : String )<br />
	{<br />
		var rv : int = 0;<br />
		var factor : int = 1;<br />
		<br />
		for ( var i : int = s.length - 1; i &gt;= 0; i-- )<br />
		{<br />
			for ( var c : int = 0; c &lt; 10; c++ )<br />
				if ( c.ToString ( ) == s [ i ] )<br />
				{<br />
					rv += c * factor;<br />
					factor *= 10;<br />
				}<br />
		}<br />
		<br />
		if ( s.IndexOf ( &quot;-&quot; ) != -1 )<br />
			rv *= -1;<br />
		<br />
		return rv;<br />
	}<br />
	<br />
	public static function FloatToString ( s : float )<br />
	{<br />
		var edit : String = s.ToString ( );<br />
		<br />
		if ( edit.IndexOf ( &quot;,&quot; ) == -1 )<br />
			if ( edit.IndexOf ( &quot;.&quot; ) == -1 )<br />
				edit += &quot;.0&quot;;<br />
		<br />
		return edit;<br />
	}<br />
	<br />
	public static function StringToFloat ( s : String )<br />
	{<br />
		if ( s.IndexOf ( &quot;,&quot; ) == -1 )<br />
			if ( s.IndexOf ( &quot;.&quot; ) == -1 )<br />
				return StringToInt ( s );<br />
		<br />
		var rv : float = 0;<br />
		var factor : float = 1.0;<br />
		var ff : int = 0;<br />
		<br />
		if ( s.IndexOf ( &quot;,&quot; ) != -1 )<br />
			ff = s.IndexOf ( &quot;,&quot; );<br />
		else<br />
			ff = s.IndexOf ( &quot;.&quot; );<br />
		<br />
		ff = s.length - ff - 1;<br />
		<br />
		for ( var f : int = 0; f &lt; ff; f++ )<br />
			factor /= 10;<br />
		<br />
		for ( var i : int = s.length - 1; i &gt;= 0; i-- )<br />
		{<br />
			for ( var c : int = 0; c &lt; 9; c++ )<br />
				if ( c.ToString ( ) == s [ i ] )<br />
				{<br />
					rv += c * factor;<br />
					factor *= 10;<br />
				}<br />
		}<br />
		<br />
		if ( s.IndexOf ( &quot;-&quot; ) != -1 )<br />
			rv *= -1;<br />
		<br />
		return rv;<br />
	}<br />
	<br />
	public static function BoolToString ( s : boolean )<br />
	{<br />
		if ( s )<br />
			return &quot;true&quot;;<br />
		else<br />
			return &quot;false&quot;;<br />
	}<br />
	<br />
	public static function StringToBool ( s : String )<br />
	{<br />
		if ( s == &quot;true&quot; )<br />
			return true;<br />
		else<br />
			return false;<br />
	}<br />
}<br />
<br />
class XLFList<br />
{<br />
	public static function Compile ( s : String )<br />
	{<br />
		var list : Array = new Array ( );<br />
		var index : boolean = false;<br />
		var temp : String = &quot;&quot;;<br />
		<br />
		for ( var i : int = 0; i &lt; s.length; i++ )<br />
		{<br />
			if ( index == false )<br />
			{<br />
				if ( s [ i ] == &quot;&lt;&quot; )<br />
					index = true;<br />
				else if ( s [ i ] == &quot; &quot; )<br />
					index = true;<br />
				else if ( s [ i ] == &quot;&gt;&quot; )<br />
					break;<br />
			}<br />
			else if ( index == true )<br />
			{<br />
				temp += s [ i ];<br />
				<br />
				if ( i &lt; s.length )<br />
				{<br />
					if ( s [ i + 1 ] == &quot; &quot; )<br />
					{<br />
						index = false;<br />
						<br />
						list.Push ( temp );<br />
						temp = &quot;&quot;;<br />
					}<br />
					else if ( s [ i + 1 ] == &quot;&gt;&quot; )<br />
					{<br />
						index = false;<br />
						<br />
						list.Push ( temp );<br />
						temp = &quot;&quot;;<br />
					}<br />
				}<br />
			}<br />
		}<br />
		<br />
		for ( var b : int = 0; b &lt; list.length; b++ )<br />
			list [ b ] = XLFString.PlaceSpecial ( list [ b ] );<br />
		<br />
		return list;<br />
	}<br />
	<br />
	public static function Generate ( s : Array )<br />
	{<br />
		if ( s.length == 0 )<br />
			return &quot;&lt;&gt;&quot;;<br />
		<br />
		var rs : String = &quot;&lt;&quot;;<br />
		<br />
		for ( var i : int = 0; i &lt; s.length - 1; i++ )<br />
		{<br />
			rs += XLFString.ReplaceSpecial ( s [ i ] ) + &quot; &quot;;<br />
		}<br />
		<br />
		var le : String= s [ s.length - 1 ];<br />
		<br />
		rs += XLFString.ReplaceSpecial ( le );<br />
		<br />
		rs += &quot;&gt;&quot;;<br />
		<br />
		return rs;<br />
	}<br />
}<br />
<br />
class XLFString<br />
{<br />
	public static function ReplaceSpecial ( s : String )<br />
	{<br />
		var edit : String = s;<br />
		<br />
		while ( edit.IndexOf ( &quot;[&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[&quot;, &quot;temp:squareBrackedOpen&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;]&quot;, &quot;temp:squareBrackedClose&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;temp:squareBrackedClose&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;temp:squareBrackedClose&quot;, &quot;[squareBrackedClose]&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;temp:squareBrackedOpen&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;temp:squareBrackedOpen&quot;, &quot;[squareBrackedOpen]&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;&lt;&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;&lt;&quot;, &quot;[brackedOpen]&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot; &quot; ) != -1 )<br />
			edit = edit.Replace ( &quot; &quot;, &quot;[space]&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;&gt;&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;&gt;&quot;, &quot;[brackedClose]&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;&#92;n&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;&#92;n&quot;, &quot;[nextLine]&quot; );<br />
		<br />
		return edit;<br />
	}<br />
	<br />
	public static function PlaceSpecial ( s : String )<br />
	{<br />
		var edit : String = s;<br />
		<br />
		while ( edit.IndexOf ( &quot;[squareBrackedOpen]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[squareBrackedOpen]&quot;, &quot;[&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;[squareBrackedClose]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[squareBrackedClose]&quot;, &quot;]&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;[brackedOpen]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[brackedOpen]&quot;, &quot;&lt;&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;[space]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[space]&quot;, &quot; &quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;[brackedClose]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[brackedClose]&quot;, &quot;&gt;&quot; );<br />
		<br />
		while ( edit.IndexOf ( &quot;[nextLine]&quot; ) != -1 )<br />
			edit = edit.Replace ( &quot;[nextLine]&quot;, &quot;&#92;n&quot; );<br />
		<br />
		return edit;<br />
	}<br />
}<br />
<br />
&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/21/4dis-xlf-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4D IS &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/21/4d-is-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/21/4d-is-unify-wiki/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 17:17:41 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=4D_IS</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''4D Interactive Studio''' ==

'''Free Scripts'''

----

[[4DIS - IO]] - You need this class to save and load strings

[[4DIS - FileEncryption]] - This is a class for encrypting strings or files

[[4DIS - XLF]] - A class to...]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''4D Interactive Studio''' ==<br />
<br />
'''Free Scripts'''<br />
<br />
----<br />
<br />
[[4DIS - IO]] - You need this class to save and load strings<br />
<br />
[[4DIS - FileEncryption]] - This is a class for encrypting strings or files<br />
<br />
[[4DIS - XLF]] - A class to write and read files<br />
<br />
[[4DIS - Camera Controller]] - Different camera controllers<br />
<br />
[[4DIS - Character Controllers]] - Different character controllers<br />
<br />
----<br />
<br />
'''Tutorials'''<br />
<br />
----<br />
<br />
[[4DIS - JavascriptTutorial]]</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/21/4d-is-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4D IS &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/21/4d-is-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/21/4d-is-unify-wiki-2/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 17:17:41 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=4D_IS</guid>
		<description><![CDATA[4D Interactive Studio: 

== '''4D Interactive Studio''' ==

'''Free Scripts'''

----

[[4DIS - IO]] - You need this class to save and load strings

[[4DIS - FileEncryption]] - This is a class for encrypting strings or files

[[4DIS - XLF]] - A class to...]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: </p>
<hr />
<div>== '''4D Interactive Studio''' ==<br />
<br />
'''Free Scripts'''<br />
<br />
----<br />
<br />
[[4DIS - IO]] - You need this class to save and load strings<br />
<br />
[[4DIS - FileEncryption]] - This is a class for encrypting strings or files<br />
<br />
[[4DIS - XLF]] - A class to write and read files<br />
<br />
[[4DIS - Camera Controller]] - Different camera controllers<br />
<br />
[[4DIS - Character Controllers]] - Different character controllers<br />
<br />
----<br />
<br />
'''Tutorials'''<br />
<br />
----<br />
<br />
[[4DIS - JavascriptTutorial]]</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/21/4d-is-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build Engineering and Infrastructure: How Unity Does It &#124; Unity Technologies</title>
		<link>http://www.bydesigngames.com/2011/10/21/build-engineering-and-infrastructure-how-unity-does-it-unity-technologies/</link>
		<comments>http://www.bydesigngames.com/2011/10/21/build-engineering-and-infrastructure-how-unity-does-it-unity-technologies/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 11:35:43 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://blogs.unity3d.com/?p=5929</guid>
		<description><![CDATA[Hello!  I&#8217;m Na&#8217;Tosha and I&#8217;m the Build and Infrastructure Developer here at Unity Technologies.  While speaking with users at the awesome Unite 2011, I had several people ask me to write a blog post about how Unity Technologies manages to develop, build, and test Unity. We do this with a combination of: Continuous Integration Automated...]]></description>
			<content:encoded><![CDATA[<p>Hello!  I&#8217;m Na&#8217;Tosha and I&#8217;m the Build and Infrastructure Developer here at Unity Technologies.  While  speaking with users at the awesome Unite 2011, I had several people ask  me to write a blog post about how Unity Technologies manages to  develop, build, and test Unity.</p>
<p>We do this with a combination of:</p>
<ul>
<li>Continuous Integration</li>
<li>Automated Testing</li>
<li>Code Hosting</li>
<li>Code Reviews</li>
<li>Manual Testing</li>
</ul>
<p>I’ll talk about how we do the first four of those things here.</p>
<h1>Continuous Integration</h1>
<h2>The Continuous Integration Server</h2>
<p>&nbsp;</p>
<div id="attachment_5958" class="wp-caption aligncenter" style="width:560px;"><a rel="nofollow"  href="http://blogs.unity3d.com/2011/10/21/build-engineering-and-infrastructure-how-unity-does-it/teamcity/"><img class="size-full wp-image-5958 " title="TeamCity" src="http://blogs.unity3d.com/wp-content/uploads/2011/10/TeamCity.png" alt="TeamCity" width="550" height="316"/></a><p class="wp-caption-text">Our builds and automated tests are all run by TeamCity.</p></div>
<p>We  use <a rel="nofollow" title="TeamCity"  href="http://www.jetbrains.com/teamcity/">TeamCity</a> from <a rel="nofollow" title="JetBrains"  href="http://www.jetbrains.com/company/index.html">JetBrains</a> as our continuous integration  solution.  One of the things we like best about TeamCity is that it has a very clear UI that gives the end user a good  indication of the state of a project.  For testsuites, it’s easy to see  at a glance whether the suite passes or fails and what tests are  failing.  It can farm builds out to agents on Windows, OS X, and Linux,  and keeps an extensive history of builds and tests, which are very  useful when trying to figure out why a test is failing or whether there  is something wrong with an agent.  Generally speaking, we are quite  happy with the feature-set and also with the support we’ve received from  JetBrains.</p>
<p>Our only  real complaint now is regarding the web UI &#8212; it can still  be  slow to load at times (specifically, when loading a large project  page  that hasn’t been loaded for a while, or when opening the custom  build  run dialog when a lot of agents are attached).  It can also be   difficult regarding managing multiple branch projects, as there is   currently no way to synchronize changes between branches that are copies   of each other.  However, the projects are stored in XML, and the  schema  is not complicated, so I have written a tool to do this instead  by  modifying the XML directly.</p>
<h2>The Build Farm</h2>
<div id="attachment_5959" class="wp-caption aligncenter" style="width:560px;"><a rel="nofollow"  href="http://blogs.unity3d.com/2011/10/21/build-engineering-and-infrastructure-how-unity-does-it/teamcityagents/"><img class="size-full wp-image-5959 " title="TeamCityAgents" src="http://blogs.unity3d.com/wp-content/uploads/2011/10/TeamCityAgents.png" alt="TeamCity Agents Page" width="550" height="574"/></a><p class="wp-caption-text">TeamCity farms builds out to a distributed build farm of between 40 and 50 machines.</p></div>
<p>Along  with TeamCity, we have a build farm of approximately 45 machines, known  as build agents.  Most of these are virtual machines running Windows,  Mac OS X, and Linux.  We also have a few physical machines used for  graphics tests, because testing graphics functionality requires a level  of GPU manipulation that we could not achieve with virtual machines.   Our virtual build agents are virtualized with <a rel="nofollow" title="VMware Workstation"  href="http://www.vmware.com/products/workstation/overview.html">VMWare Workstation</a> on  Linux hosts, using a combination of Apple and non-Apple hardware.</p>
<p>The  reason for choosing virtual machines, despite the performance hit it  gives us, is that virtualization allows us to easily maintain the system  &#8212; instead of updating 45 machines separately, we update the template  virtual machine image for a given operating system, then copy it to the  live buildservers.  It also allows us to make every agent appear to be  the same hardware-wise, even if they are running on different types of  host hardware.  This is important because as we add more build agents,  they will be running on different generations of hardware, and for the  purposes of testing, we need them to all appear the same.</p>
<h1>Automated Testing</h1>
<div id="attachment_5964" class="wp-caption aligncenter" style="width:560px;"><a rel="nofollow"  href="http://blogs.unity3d.com/2011/10/21/build-engineering-and-infrastructure-how-unity-does-it/teamcitytests/"><img class="size-full wp-image-5964 " title="TeamCityTests" src="http://blogs.unity3d.com/wp-content/uploads/2011/10/TeamCityTests.png" alt="TeamCity Tests" width="550" height="30"/></a><p class="wp-caption-text">TeamCity provides a very clear interface for seeing the status of test suites.</p></div>
<p>We  have several automated test suites that we run on a regular basis.   These are used, along with manual testing, as a metric for how stable  our mainline codebase is, as well as when a feature branch is stable  enough to be merged back into trunk.  We currently have four types of  test suites:</p>
<ul>
<li>Unit Tests  &#8212; these test the correctness of individual functions / small bits of  functionality in the code, but they do not test high-level features of  the product.  These are used by developers, but not by our continuous  integration server.</li>
<li>Graphics Tests  &#8212; these work by building a Unity project that renders a set of static  scenes.  The project is then run on the target platform (desktop,  console, or mobile), and screenshots of each scene are saved.  We then  compare the saved screenshots against a set of “known good” screenshots.   If the difference is greater than a certain amount, we assert that the  test has “failed”.</li>
<li>Functional Tests &#8212; these work by launching one instance of the editor or player, and testing various aspects of its functionality.</li>
<li>Integration Tests  &#8212; these are the most high level tests.  They work by launching an  instance of the editor or player, testing a particular action or series  of actions, and shutting down the editor or player and going on to the  next test.</li>
</ul>
<p>Our  integration tests are executed by our continuous integration server as  NUnit tests.  TeamCity can run MSBuild projects directly, and we have a  script that runs them with Mono’s Xbuild on Mac OS X.  We developed our  own framework for running the graphics tests.</p>
<div id="attachment_5971" class="wp-caption aligncenter" style="width:560px;"><a rel="nofollow"  href="http://blogs.unity3d.com/2011/10/21/build-engineering-and-infrastructure-how-unity-does-it/regressionrig-2/"><img class="size-full wp-image-5971 " title="Regression rig" src="http://blogs.unity3d.com/wp-content/uploads/2011/10/RegressionRig.png" alt="Regression rig" width="550" height="443"/></a><p class="wp-caption-text">Our regression rig tells us if anything has changed in the playback of previously-recorded content.</p></div>
<p>We  also have a regression rig that we developed ourselves.  The regression  rig, similar to the graphics tests, compares content played in Unity  against previously recorded content, and checks for regressions.  This  is a good way to catch high-level regressions (for example audio having  become bit-shifted).</p>
<p>Our  test suites are always being expanded, and, along with our regression  rig, they have helped us catch a number of regressions and bugs.</p>
<h1>Code Hosting and Reviews</h1>
<p>Like  many software companies, Unity Technologies has run through a  few  different version control systems.  In the beginning, there was no   version control.  Eventually the first Unity Ninjas began using CVS,  and  eventually Subversion. About a year ago, we started to investigate   distributed version control systems and eventually settled on <a rel="nofollow" title="Mercurial"  href="http://mercurial.selenic.com/">Mercurial</a>.    Now all of our source code is versioned in Mercurial, except for our   public Mono, MonoDevelop, and Boo-related repositories on <a rel="nofollow" title="GitHub"  href="https://github.com/Unity-Technologies">GitHub</a>.</p>
<h2>Why Mercurial?</h2>
<p>Well,  we had a few requirements.  The first was that the version  control  system work with our continuous integration server, which is  TeamCity,  so we started off considering Git, Mercurial, and Bazaar, and  Perforce.   We also wanted something distributed because we have  developers working  in several different locations, and we also work on  multiple platforms.   A distributed system allows our developers around  the globe to  interact with the remote server less frequently, and it  also allows all  of us to easily test our changes on multiple local  machines without  having to share changes that potentially break some  other platform with  each other.  We also wanted to be able to do  feature development in  branches and merge them back together  successfully.  So we were left  with Git, Mercurial, and Bazaar.  We  spent some time evaluating these  three systems.  We were interested in:</p>
<ol>
<li>A simple, easy to use and understand command-line interface</li>
<li>Good GUI tools for the system on OS X and Windows</li>
<li>A good code review tool that works well with the system.</li>
</ol>
<p>We  also wanted a system that we felt had a lot of momentum &#8212; an  ecosystem  that is growing and developing around it.  After a few weeks  of  testing, we eventually decided on Mercurial because:</p>
<ol>
<li>It was substantially more simple to learn and use than Git</li>
<li>It had good GUI tools for both Windows (<a rel="nofollow" title="TortoiseHg"  href="http://tortoisehg.bitbucket.org/">TortoiseHg</a>) and Mac (<a rel="nofollow" title="SourceTree"  href="http://www.sourcetreeapp.com/">SourceTree</a>, and now <a rel="nofollow" title="TortoiseHg"  href="http://tortoisehg.bitbucket.org/">TortoiseHg</a>)</li>
<li>It had a couple of different options for large-scale code review tools</li>
<li>It  had a good-sized user-base (which is growing), a regular  development  cycle, and seemed to be well-adopted by both open-source  and and  commercial projects</li>
</ol>
<p>Another  very big win for Mercurial is that it was the only DVCS (at  the time,  at least) that had even attempted to handle the issue of  large binaries  in the repository.  This was done through a few  different publicly-available extensions to  Mercurial.  Distributed  version control systems, by nature, don’t lend  themselves well to  codebases with a lot of large binaries, so we knew we  would need some  system that can cooperate with the version control  system to store the  large binaries outside of the repository, but still  let us version them  in some way.  Not having to develop our own system  completely from  scratch was a really big win.</p>
<h3>How to Host Mercurial and What to Use for Code Reviews?</h3>
<p>After  we decided on Mercurial, we needed to figure out how to host  it and how  we would review code.  With this switch, we also wanted to  implement a  new development policy.  Up until this point, we had always  worked with  just one central copy of the codebase, except for when we  branched for  release.  This led to something almost always being  broken, which had a  serious effect on productivity.  We wanted to be  able to easily do  feature development in branches; perform peer code  reviews, build, and  test verification on the branch; then merge it back  into the mainline  repository once it is complete.  The goal is that  trunk is always in a  releasable, or nearly releasable, state.</p>
<div class="wp-caption aligncenter" style="width:560px;"><a rel="nofollow"  href="http://blogs.unity3d.com/2011/10/21/build-engineering-and-infrastructure-how-unity-does-it/codereview/"><img title="CodeReview" src="http://blogs.unity3d.com/wp-content/uploads/2011/10/CodeReview.png" alt="Code Review in Kiln" width="550" height="176"/></a><p class="wp-caption-text">A Code Review in Kiln.</p></div>
<p style="text-align:center;">&nbsp;</p>
<p>We  looked at a few different code review systems, and eventually settled  on <a rel="nofollow" title="Kiln"  href="http://www.fogcreek.com/kiln/">Kiln</a> from <a rel="nofollow" title="Fog Creek Software"  href="http://www.fogcreek.com/">Fog Creek Software</a>.  Many people already know that we have  used <a rel="nofollow" title="FogBugz"  href="http://www.fogcreek.com/fogbugz/">FogBugz</a> as our issue tracking system for a while now.  While  FogBugz has some  room for improvement (specifically, it doesn’t work very  well as a  public-facing bug tracker), it has done a pretty good job of  serving  our needs, and we have a really large amount of data in the  system.  At  this point, we would need a pretty compelling reason to put  in the  effort to move all of that data to a new system.  Kiln is a  Mercurial  code hosting system that interfaces with FogBugz and provides  nice  web-browsing of the repositories, code reviews on a per-changeset  basis  with one or more reviewers, and a server-side implementation of a   Mercurial extension that handles large binaries. We have had some ups   and downs with Kiln, mostly with regards to performance.  Our repository   size, which is about 1.6 GB with a clean working copy, and has several   fairly large binaries, as well as our number of concurrent developers,   about 65 and growing, and our build farm, another 45 or so machines,   seem to have pushed it to its limits performance-wise.  The self-hosted version of Kiln is currently not built with scalability to large teams (with large repositories) in mind, which results in very slow clones &amp; pushes when there is heavy load. Hopefully, this will get resolved in the future. We’re not sure   what our own future is with Kiln, but I will say that its feature set is   quite nice, and it has allowed us to move to our desired development   model of feature development in branches rather than in mainline.    Beware that it is written in .NET and does not run on Mono, so if you   want to consider Kiln, you will need to run a Windows server.  I can   say, however, that the Fog Creek support staff has spent countless hours   trying to help us work through our various issues with Kiln.</p>
<h1>Conclusion</h1>
<p>Building  and testing for so many platforms is a really difficult task &#8212;  especially as our development team is rapidly growing, and we find  ourselves putting strains on infrastructure and processes in areas we  didn’t expect.  These tools and processes are fundamental to how the  development team gets things done here at Unity.</p>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/21/build-engineering-and-infrastructure-how-unity-does-it-unity-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NotificationCenterGenerics &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/20/notificationcentergenerics-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/20/notificationcentergenerics-unify-wiki/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 20:53:18 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=NotificationCenterGenerics</guid>
		<description><![CDATA[Superchop: 3 spelling corrections in the comments

[[Category:Concepts]]
[[Category:Design Patterns]]
[[Category:MonoBehaviour]]
[[Category:Messaging]]
[[Category:JavaScript]]
Author: capnbishop

Update: chrisg
==Update Notes==
The original script brea...]]></description>
			<content:encoded><![CDATA[<p>Superchop: 3 spelling corrections in the comments</p>
<hr />
<div>[[Category:Concepts]]<br />
[[Category:Design Patterns]]<br />
[[Category:MonoBehaviour]]<br />
[[Category:Messaging]]<br />
[[Category:JavaScript]]<br />
Author: capnbishop<br />
<br />
Update: chrisg<br />
==Update Notes==<br />
The original script breaks with #pragma strict or mobile development since it's using dynamic typing for the observer, so this script uses a Generic List of Components instead of a type-less ArrayList. Code changed, but the rest is copied from the original page [http://www.unifycommunity.com/wiki/index.php?title=NotificationCenter NotificationCenter].<br />
== Description ==<br />
NotificationCenter.js allows for easy and powerful messaging between objects in Unity.  An object can register as an observer and receive notifications of a certain type when they occur.  When that notification type is posted elsewhere, all objects that registered as an observer for that notification type will receive a message that it has occurred, along with the associated data.<br />
<br />
This system allows for objects to communicate their status and events with one another, without having to directly reference each object that receives the notification.  An object can simply post an event when it occurs, and any interested party can register to receive notification when it happens.<br />
<br />
Using a notification center will allow for dynamic and flexible coding practices.  For example, a pinball game can have a bumper that posts a notification when the ball collides with it.  An object that keeps track of score can register to receive a notification when this event occurs, and increment the score accordingly without having to communicate directly with or keep track of the bumper.  Another object can play a sound when it receives notification of a bumper impact.  Another object can display a particle effect when it receives notification of a bumper impact.  Other features can be added to respond to this event later on without having to modify the existing objects, because they independently choose to receive and act on the notification event.<br />
<br />
This script was inspired by [http://technology.blurst.com/unityscript-messaging-system Blurst Technology's Messenger system], with a convention twist to make it easier to use and a little more similar to the Cocoa framework's [http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/Notifications/Introduction/introNotifications.html NSNotificationCenter].<br />
<br />
== Usage ==<br />
This is an auto-instantiating singleton class.  There is no need to attach it to an object.  Simply place it in a project's assets and use it by calling to the DefaultCenter.  The static method will automatically create a game object, add a NotificationCenter component, and create a reference to that component.<br />
<br />
Post a notification by calling the PostNotification method:<br />
<br />
&lt;javascript&gt;NotificationCenter.DefaultCenter().PostNotification(this, &quot;OnBumperCollision&quot;);<br />
NotificationCenter.DefaultCenter().PostNotification(this, &quot;OnBumperCollision&quot;, anyObject);<br />
NotificationCenter.DefaultCenter().PostNotification(new Notification(this, &quot;OnBumperCollision&quot;));<br />
NotificationCenter.DefaultCenter().PostNotification(new Notification(this, &quot;OnBumperCollision&quot;, anyObject));&lt;/javascript&gt;<br />
<br />
The PostNotification() method comes in several varieties, all of which are valid.  It only requires two parameters: the sender, and the notification name.  Optionally it can accept a miscellaneous data object.  This can be anything that needs to be communicated.  For instance, the OnBumperCollision notification could send information about the collision, or even send the Collision object itself.  Often the data object is best used as a Hashtable, so that it can include a variety of keyed information.<br />
<br />
Notice that PostNotification() can be called by either passing individual parameters, or by passing a Notification object.  The Notification object can be subclassed to make a streamlined set of notification data.  The Notification object also must hold the sender, the notification name, and (optionally) a data object.<br />
<br />
Register to receive notifications by calling the AddObserver method:<br />
<br />
&lt;javascript&gt;NotificationCenter.DefaultCenter().AddObserver(this, &quot;OnBumperCollision&quot;);&lt;/javascript&gt;<br />
<br />
DefaultCenter() is a static method that returns an instance of the default notification center.  If it doesn't exist yet, it will be automatically instantiated.  AddObserver() accepts two parameters for the object that wishes to receive notifications, and the notification to be received.  The notification that's being registered is the function call that will be executed for the event.<br />
<br />
Remove an observer with the RemoveObserver() method:<br />
<br />
&lt;javascript&gt;NotificationCenter.DefaultCenter().RemoveObserver(this, &quot;OnBumperCollision&quot;);&lt;/javascript&gt;<br />
<br />
RemoveObserver() simply removes the object from the list of observers for the specified notification event.<br />
<br />
To receive notification, simply implement a method with the notification name:<br />
<br />
&lt;javascript&gt;function OnBumperCollision (notification: Notification) {<br />
    Debug.Log(&quot;Received notification from: &quot; + notification.sender);<br />
    if (notification.data == null)<br />
        Debug.Log(&quot;And the data object was null!&quot;);<br />
    else<br />
        Debug.Log(&quot;And it included a data object: &quot; + notification.data);<br />
}&lt;/javascript&gt;<br />
<br />
Notification methods must accept the Notification object.  It contains the three properties for sender, name (of the notification), and data (optional object).<br />
<br />
== Javascript - NotificationCenter.js ==<br />
&lt;javascript&gt;<br />
<br />
import System.Collections.Generic;<br />
//    NotificationCenter is used for handling messages between GameObjects.<br />
   <br />
//    GameObjects can register to receive specific notifications.  When another objects sends a notification of that type, all GameObjects that registered for it and implement the appropriate message will receive that notification.<br />
   <br />
//    Observing GameObjects must register to receive notifications with the AddObserver function, and pass their selves, and the name of the notification.  Observing GameObjects can also unregister themselves with the RemoveObserver function.  GameObjects must request to receive and remove notification types on a type by type basis.<br />
   <br />
//    Posting notifications is done by creating a Notification object and passing it to PostNotification.  All receiving GameObjects will accept that Notification object.  The Notification object contains the sender, the notification type name, and an option hashtable containing data.<br />
<br />
//    To use NotificationCenter, either create and manage a unique instance of it somewhere, or use the static NotificationCenter.<br />
<br />
<br />
// We need a static method for objects to be able to obtain the default notification center.<br />
// This default center is what all objects will use for most notifications.  We can of course create our own separate instances of NotificationCenter, but this is the static one used by all.<br />
private static var defaultCenter : NotificationCenter;<br />
static function DefaultCenter () {<br />
    // If the defaultCenter doesn't already exist, we need to create it<br />
    if (!defaultCenter) {<br />
        // Because the NotificationCenter is a component, we have to create a GameObject to attach it to.<br />
        var notificationObject: GameObject = new GameObject(&quot;Default Notification Center&quot;);<br />
        // Add the NotificationCenter component, and set it as the defaultCenter<br />
        defaultCenter = notificationObject.AddComponent(NotificationCenter);<br />
    }<br />
   <br />
    return defaultCenter;<br />
}<br />
<br />
// Our hashtable containing all the notifications.  Each notification in the hash table is an ArrayList that contains all the observers for that notification.<br />
var notifications: Hashtable = new Hashtable();<br />
<br />
// AddObserver includes a version where the observer can request to only receive notifications from a specific object.  We haven't implemented that yet, so the sender value is ignored for now.<br />
function AddObserver (observer, name: String) { AddObserver(observer, name, null); }<br />
function AddObserver (observer, name: String, sender) {<br />
    // If the name isn't good, then throw an error and return.<br />
    if (name == null || name == &quot;&quot;) { Debug.Log(&quot;Null name specified for notification in AddObserver.&quot;); return; }<br />
    // If this specific notification doens't exist yet, then create it.<br />
    if (!notifications[name]) {<br />
        notifications[name] = new List.&lt;Component&gt;();<br />
    }<br />
   <br />
    var notifyList: List.&lt;Component&gt; = notifications[name];<br />
   <br />
    // If the list of observers doesn't already contain the one that's registering, then add it.<br />
    if (!notifyList.Contains(observer)) { notifyList.Add(observer); }<br />
}<br />
<br />
// RemoveObserver removes the observer from the notification list for the specified notification type<br />
function RemoveObserver (observer, name: String) {<br />
    var notifyList: List.&lt;Component&gt; = notifications[name]; //change from original<br />
   <br />
    // Assuming that this is a valid notification type, remove the observer from the list.<br />
    // If the list of observers is now empty, then remove that notification type from the notifications hash.  This is for housekeeping purposes.<br />
    if (notifyList) {<br />
        if (notifyList.Contains(observer)) { notifyList.Remove(observer); }<br />
        if (notifyList.Count == 0) { notifications.Remove(name); }<br />
    }<br />
}<br />
<br />
// PostNotification sends a notification object to all objects that have requested to receive this type of notification.<br />
// A notification can either be posted with a notification object or by just sending the individual components.<br />
function PostNotification (aSender, aName: String) { PostNotification(aSender, aName, null); }<br />
function PostNotification (aSender, aName: String, aData) { PostNotification(new Notification(aSender, aName, aData)); }<br />
function PostNotification (aNotification: Notification) {<br />
    // First make sure that the name of the notification is valid.<br />
    if (aNotification.name == null || aNotification.name == &quot;&quot;) { Debug.Log(&quot;Null name sent to PostNotification.&quot;); return; }<br />
    // Obtain the notification list, and make sure that it is valid as well<br />
    var notifyList: List.&lt;Component&gt; = notifications[aNotification.name]; //change from original<br />
    if (!notifyList) { Debug.Log(&quot;Notify list not found in PostNotification.&quot;); return; }<br />
   <br />
    // Create an array to keep track of invalid observers that we need to remove<br />
    var observersToRemove = new List.&lt;Component&gt;(); //change from original<br />
<br />
    // Itterate through all the objects that have signed up to be notified by this type of notification.<br />
    for (var observer in notifyList) {<br />
        // If the observer isn't valid, then keep track of it so we can remove it later.<br />
        // We can't remove it right now, or it will mess the for loop up.<br />
        if (!observer) { observersToRemove.Add(observer);<br />
        } else {<br />
            // If the observer is valid, then send it the notification.  The message that's sent is the name of the notification.<br />
            observer.SendMessage(aNotification.name, aNotification, SendMessageOptions.DontRequireReceiver);<br />
        }<br />
    }<br />
   <br />
    // Remove all the invalid observers<br />
    for (observer in observersToRemove) {<br />
        notifyList.Remove(observer);<br />
    }<br />
}<br />
<br />
// The Notification class is the object that is sent to receiving objects of a notification type.<br />
// This class contains the sending GameObject, the name of the notification, and optionally a hashtable containing data.<br />
class Notification {<br />
    var sender;<br />
    var name : String;<br />
    var data;<br />
    function Notification (aSender,  aName: String) { sender = aSender; name = aName; data = null; }<br />
    function Notification (aSender, aName: String, aData) { sender = aSender; name = aName; data = aData; }<br />
}&lt;/javascript&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/20/notificationcentergenerics-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NotificationCenterGenerics &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/20/notificationcentergenerics-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/20/notificationcentergenerics-unify-wiki-2/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 20:53:18 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=NotificationCenterGenerics</guid>
		<description><![CDATA[NCarter: Text replace - &#34;&#60;/javascript&#62;&#34; to &#34;&#60;/syntaxhighlight&#62;&#34;

[[Category:Concepts]]
[[Category:Design Patterns]]
[[Category:MonoBehaviour]]
[[Category:Messaging]]
[[Category:JavaScript]]
Author: capnbishop

Update: ch...]]></description>
			<content:encoded><![CDATA[<p>NCarter: Text replace - &quot;&lt;/javascript&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</p>
<hr />
<div>[[Category:Concepts]]<br />
[[Category:Design Patterns]]<br />
[[Category:MonoBehaviour]]<br />
[[Category:Messaging]]<br />
[[Category:JavaScript]]<br />
Author: capnbishop<br />
<br />
Update: chrisg<br />
==Update Notes==<br />
The original script breaks with #pragma strict or mobile development since it's using dynamic typing for the observer, so this script uses a Generic List of Components instead of a type-less ArrayList. Code changed, but the rest is copied from the original page [http://www.unifycommunity.com/wiki/index.php?title=NotificationCenter NotificationCenter].<br />
== Description ==<br />
NotificationCenter.js allows for easy and powerful messaging between objects in Unity.  An object can register as an observer and receive notifications of a certain type when they occur.  When that notification type is posted elsewhere, all objects that registered as an observer for that notification type will receive a message that it has occurred, along with the associated data.<br />
<br />
This system allows for objects to communicate their status and events with one another, without having to directly reference each object that receives the notification.  An object can simply post an event when it occurs, and any interested party can register to receive notification when it happens.<br />
<br />
Using a notification center will allow for dynamic and flexible coding practices.  For example, a pinball game can have a bumper that posts a notification when the ball collides with it.  An object that keeps track of score can register to receive a notification when this event occurs, and increment the score accordingly without having to communicate directly with or keep track of the bumper.  Another object can play a sound when it receives notification of a bumper impact.  Another object can display a particle effect when it receives notification of a bumper impact.  Other features can be added to respond to this event later on without having to modify the existing objects, because they independently choose to receive and act on the notification event.<br />
<br />
This script was inspired by [http://technology.blurst.com/unityscript-messaging-system Blurst Technology's Messenger system], with a convention twist to make it easier to use and a little more similar to the Cocoa framework's [http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/Notifications/Introduction/introNotifications.html NSNotificationCenter].<br />
<br />
== Usage ==<br />
This is an auto-instantiating singleton class.  There is no need to attach it to an object.  Simply place it in a project's assets and use it by calling to the DefaultCenter.  The static method will automatically create a game object, add a NotificationCenter component, and create a reference to that component.<br />
<br />
Post a notification by calling the PostNotification method:<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;NotificationCenter.DefaultCenter().PostNotification(this, &quot;OnBumperCollision&quot;);<br />
NotificationCenter.DefaultCenter().PostNotification(this, &quot;OnBumperCollision&quot;, anyObject);<br />
NotificationCenter.DefaultCenter().PostNotification(new Notification(this, &quot;OnBumperCollision&quot;));<br />
NotificationCenter.DefaultCenter().PostNotification(new Notification(this, &quot;OnBumperCollision&quot;, anyObject));&lt;/syntaxhighlight&gt;<br />
<br />
The PostNotification() method comes in several varieties, all of which are valid.  It only requires two parameters: the sender, and the notification name.  Optionally it can accept a miscellaneous data object.  This can be anything that needs to be communicated.  For instance, the OnBumperCollision notification could send information about the collision, or even send the Collision object itself.  Often the data object is best used as a Hashtable, so that it can include a variety of keyed information.<br />
<br />
Notice that PostNotification() can be called by either passing individual parameters, or by passing a Notification object.  The Notification object can be subclassed to make a streamlined set of notification data.  The Notification object also must hold the sender, the notification name, and (optionally) a data object.<br />
<br />
Register to receive notifications by calling the AddObserver method:<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;NotificationCenter.DefaultCenter().AddObserver(this, &quot;OnBumperCollision&quot;);&lt;/syntaxhighlight&gt;<br />
<br />
DefaultCenter() is a static method that returns an instance of the default notification center.  If it doesn't exist yet, it will be automatically instantiated.  AddObserver() accepts two parameters for the object that wishes to receive notifications, and the notification to be received.  The notification that's being registered is the function call that will be executed for the event.<br />
<br />
Remove an observer with the RemoveObserver() method:<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;NotificationCenter.DefaultCenter().RemoveObserver(this, &quot;OnBumperCollision&quot;);&lt;/syntaxhighlight&gt;<br />
<br />
RemoveObserver() simply removes the object from the list of observers for the specified notification event.<br />
<br />
To receive notification, simply implement a method with the notification name:<br />
<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;function OnBumperCollision (notification: Notification) {<br />
    Debug.Log(&quot;Received notification from: &quot; + notification.sender);<br />
    if (notification.data == null)<br />
        Debug.Log(&quot;And the data object was null!&quot;);<br />
    else<br />
        Debug.Log(&quot;And it included a data object: &quot; + notification.data);<br />
}&lt;/syntaxhighlight&gt;<br />
<br />
Notification methods must accept the Notification object.  It contains the three properties for sender, name (of the notification), and data (optional object).<br />
<br />
== Javascript - NotificationCenter.js ==<br />
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;<br />
<br />
import System.Collections.Generic;<br />
//    NotificationCenter is used for handling messages between GameObjects.<br />
   <br />
//    GameObjects can register to receive specific notifications.  When another objects sends a notification of that type, all GameObjects that registered for it and implement the appropriate message will receive that notification.<br />
   <br />
//    Observing GameObjects must register to receive notifications with the AddObserver function, and pass their selves, and the name of the notification.  Observing GameObjects can also unregister themselves with the RemoveObserver function.  GameObjects must request to receive and remove notification types on a type by type basis.<br />
   <br />
//    Posting notifications is done by creating a Notification object and passing it to PostNotification.  All receiving GameObjects will accept that Notification object.  The Notification object contains the sender, the notification type name, and an option hashtable containing data.<br />
<br />
//    To use NotificationCenter, either create and manage a unique instance of it somewhere, or use the static NotificationCenter.<br />
<br />
<br />
// We need a static method for objects to be able to obtain the default notification center.<br />
// This default center is what all objects will use for most notifications.  We can of course create our own separate instances of NotificationCenter, but this is the static one used by all.<br />
private static var defaultCenter : NotificationCenter;<br />
static function DefaultCenter () {<br />
    // If the defaultCenter doesn't already exist, we need to create it<br />
    if (!defaultCenter) {<br />
        // Because the NotificationCenter is a component, we have to create a GameObject to attach it to.<br />
        var notificationObject: GameObject = new GameObject(&quot;Default Notification Center&quot;);<br />
        // Add the NotificationCenter component, and set it as the defaultCenter<br />
        defaultCenter = notificationObject.AddComponent(NotificationCenter);<br />
    }<br />
   <br />
    return defaultCenter;<br />
}<br />
<br />
// Our hashtable containing all the notifications.  Each notification in the hash table is an ArrayList that contains all the observers for that notification.<br />
var notifications: Hashtable = new Hashtable();<br />
<br />
// AddObserver includes a version where the observer can request to only receive notifications from a specific object.  We haven't implemented that yet, so the sender value is ignored for now.<br />
function AddObserver (observer, name: String) { AddObserver(observer, name, null); }<br />
function AddObserver (observer, name: String, sender) {<br />
    // If the name isn't good, then throw an error and return.<br />
    if (name == null || name == &quot;&quot;) { Debug.Log(&quot;Null name specified for notification in AddObserver.&quot;); return; }<br />
    // If this specific notification doens't exist yet, then create it.<br />
    if (!notifications[name]) {<br />
        notifications[name] = new List.&lt;Component&gt;();<br />
    }<br />
   <br />
    var notifyList: List.&lt;Component&gt; = notifications[name];<br />
   <br />
    // If the list of observers doesn't already contain the one that's registering, then add it.<br />
    if (!notifyList.Contains(observer)) { notifyList.Add(observer); }<br />
}<br />
<br />
// RemoveObserver removes the observer from the notification list for the specified notification type<br />
function RemoveObserver (observer, name: String) {<br />
    var notifyList: List.&lt;Component&gt; = notifications[name]; //change from original<br />
   <br />
    // Assuming that this is a valid notification type, remove the observer from the list.<br />
    // If the list of observers is now empty, then remove that notification type from the notifications hash.  This is for housekeeping purposes.<br />
    if (notifyList) {<br />
        if (notifyList.Contains(observer)) { notifyList.Remove(observer); }<br />
        if (notifyList.Count == 0) { notifications.Remove(name); }<br />
    }<br />
}<br />
<br />
// PostNotification sends a notification object to all objects that have requested to receive this type of notification.<br />
// A notification can either be posted with a notification object or by just sending the individual components.<br />
function PostNotification (aSender, aName: String) { PostNotification(aSender, aName, null); }<br />
function PostNotification (aSender, aName: String, aData) { PostNotification(new Notification(aSender, aName, aData)); }<br />
function PostNotification (aNotification: Notification) {<br />
    // First make sure that the name of the notification is valid.<br />
    if (aNotification.name == null || aNotification.name == &quot;&quot;) { Debug.Log(&quot;Null name sent to PostNotification.&quot;); return; }<br />
    // Obtain the notification list, and make sure that it is valid as well<br />
    var notifyList: List.&lt;Component&gt; = notifications[aNotification.name]; //change from original<br />
    if (!notifyList) { Debug.Log(&quot;Notify list not found in PostNotification.&quot;); return; }<br />
   <br />
    // Create an array to keep track of invalid observers that we need to remove<br />
    var observersToRemove = new List.&lt;Component&gt;(); //change from original<br />
<br />
    // Itterate through all the objects that have signed up to be notified by this type of notification.<br />
    for (var observer in notifyList) {<br />
        // If the observer isn't valid, then keep track of it so we can remove it later.<br />
        // We can't remove it right now, or it will mess the for loop up.<br />
        if (!observer) { observersToRemove.Add(observer);<br />
        } else {<br />
            // If the observer is valid, then send it the notification.  The message that's sent is the name of the notification.<br />
            observer.SendMessage(aNotification.name, aNotification, SendMessageOptions.DontRequireReceiver);<br />
        }<br />
    }<br />
   <br />
    // Remove all the invalid observers<br />
    for (observer in observersToRemove) {<br />
        notifyList.Remove(observer);<br />
    }<br />
}<br />
<br />
// The Notification class is the object that is sent to receiving objects of a notification type.<br />
// This class contains the sending GameObject, the name of the notification, and optionally a hashtable containing data.<br />
class Notification {<br />
    var sender;<br />
    var name : String;<br />
    var data;<br />
    function Notification (aSender,  aName: String) { sender = aSender; name = aName; data = null; }<br />
    function Notification (aSender, aName: String, aData) { sender = aSender; name = aName; data = aData; }<br />
}&lt;/syntaxhighlight&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/20/notificationcentergenerics-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XLF &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/20/xlf-unify-wiki/</link>
		<comments>http://www.bydesigngames.com/2011/10/20/xlf-unify-wiki/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 19:50:46 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://www.unifycommunity.com/wiki/index.php?title=XLF</guid>
		<description><![CDATA[4D Interactive Studio: Blanked the page

]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: Blanked the page</p>
<hr />
<div></div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/20/xlf-unify-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XLF &#124; Unify Wiki</title>
		<link>http://www.bydesigngames.com/2011/10/20/xlf-unify-wiki-2/</link>
		<comments>http://www.bydesigngames.com/2011/10/20/xlf-unify-wiki-2/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 19:50:46 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://unifycommunity.com/wiki/index.php?title=XLF</guid>
		<description><![CDATA[4D Interactive Studio: Blanked the page

]]></description>
			<content:encoded><![CDATA[<p>4D Interactive Studio: Blanked the page</p>
<hr />
<div></div>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/20/xlf-unify-wiki-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asset Store Action News – October 2011! &#124; Unity Technologies</title>
		<link>http://www.bydesigngames.com/2011/10/19/asset-store-action-news-%e2%80%93-october-2011-unity-technologies/</link>
		<comments>http://www.bydesigngames.com/2011/10/19/asset-store-action-news-%e2%80%93-october-2011-unity-technologies/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 20:01:47 +0000</pubDate>
		<dc:creator>Unity3D News Pipe</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://blogs.unity3d.com/?p=6325</guid>
		<description><![CDATA[Autumn is here.. and for those of us in the northern hemisphere, this means cooler weather, colorful falling leaves, pumpkins and Halloween monsters. And on the Unity Asset Store, you&#8217;ll find things are equally cool, colorful, and there&#8217;s no shortage of monsters! If you&#8217;re not already familiar with the Unity Asset Store, it&#8217;s the place...]]></description>
			<content:encoded><![CDATA[<p>Autumn is here.. and for those of us in the northern hemisphere, this means cooler weather, colorful falling leaves, pumpkins and Halloween monsters.  And on the <a rel="nofollow" title="Asset Store main page"  href="http://unity3d.com/unity/editor/asset-store">Unity Asset Store</a>, you&#8217;ll find things are equally cool, colorful, and there&#8217;s <a rel="nofollow" title="Goblin Frog Warrior!!"  href="http://u3d.as/content/digital-frame-studio/goblin-frog-warrior/22o">no shortage</a> of <a rel="nofollow" title="ZOMBIES!"  href="http://u3d.as/content/kalamona/animated-zombie-pack/2o3">monsters</a>! If you&#8217;re not already familiar with the Unity Asset Store, it&#8217;s <em>the place</em> to find time-saving, high-quality tools, models, animated characters, music, sound effects, particle systems, script libraries and more, for your games&#8211; ready to use without any royalties or licensing headaches.</p>
<p>We&#8217;re pleased to announce that we&#8217;ve reached well over 2,000 packages this month, and our customer base has expanded to over 43K registered users!  Top selling developers are making over $10K+ per month, and frankly things couldn&#8217;t be more exciting.  Some amazing new packages have arrived this month&#8230; Here are some of our favorites!</p>
<p><a rel="nofollow"  href="http://blogs.unity3d.com/2011/10/19/asset-store-action-news-october-2011/multiplat-2/"><img class="alignnone size-full wp-image-6329" title="MultipLat" src="http://blogs.unity3d.com/wp-content/uploads/2011/10/MultipLat1.jpg" alt="" width="640" height="394"/></a></p>
<p><a rel="nofollow"  href="http://u3d.as/content/owlchemy-labs/multi-platform-tool-kit/2nR"><br />
</a><a rel="nofollow" title="Multiplatform Toolkit"  href="http://u3d.as/content/owlchemy-labs/multi-platform-tool-kit/2nR"><strong>Multiplatform Toolkit</strong></a><br />
Owlchemy Labs, creators of the smash-hit mobile game <a rel="nofollow" title="Snuggle Truck"  href="http://itunes.apple.com/us/app/snuggle-truck/id431637920?mt=8">SnuggleTruck</a>, bring their amazing multiplatform toolkit to the Asset Store!  Owlchemy&#8217;s new tool makes it easy to quickly reconfigure your project for multiple platforms with just a few quick clicks.  You can easily change textures, buttons, text clips, font sizes and other graphical elements to fit the various aspect ratios and performance capabilities of multiple platforms.   Unity already makes cross-platform development easy enough, and if you&#8217;re armed with Owlchemy&#8217;s Multiplatform Toolkit, you&#8217;ve got everything you need to make multiplatform development a no-brainer!</p>
<p><a rel="nofollow"  href="http://blogs.unity3d.com/2011/10/19/asset-store-action-news-october-2011/ragetools/"><img class="alignnone size-full wp-image-6330" title="ragetools" src="http://blogs.unity3d.com/wp-content/uploads/2011/10/ragetools.jpg" alt="" width="600" height="313"/></a></p>
<p><a rel="nofollow" title="Rage Tools"  href="http://u3d.as/content/freakow/rage-tools/2nj"><strong>RageTools</strong></a><br />
An exciting new addition to the Asset Store is Freakow&#8217;s <a rel="nofollow" title="Rage tools"  href="http://u3d.as/content/freakow/rage-tools/2nj">RageTools</a>, a collection of tools to enhance the <a rel="nofollow"  href="http://u3d.as/content/juhakiili-oy/rage-spline/1DK">RageSpline</a> vector art tool.  The very cool extension, Rage SVG-In allows you to directly import vector artwork made with Inkscape and Adobe Illustrator™ into Unity for immediate use!  RageTools also brings RageSpline group management, pivot point adjustments, canvas alignment tools, and a brilliant LOD system to control anti-aliasing and curve smoothness in runtime.</p>
<p><strong><a rel="nofollow" title="Substances"  href="http://u3d.as/content/allegorithmic/18-free-substances/26a">Substances</a></strong><br />
Substance abuse is rampant in the Unity developer community, as Allegorithmic&#8217;s  dynamic material integration gains more and more popularity among Unity users.  You&#8217;ll find over 600 tweakable, space-saving Allegorithmic substances on the store, as well as the powerful <a rel="nofollow" title="Bitmap2Material"  href="http://u3d.as/content/allegorithmic/bitmap2material/23u">Bitmap2Material</a> tool&#8211; check out the <a rel="nofollow" title="Bitmap2Material Free Trial"  href="http://u3d.as/content/allegorithmic/bitmap2material-free-trial/26F">free trial version</a> first.  The <a rel="nofollow" title="18 Free Substances"  href="http://u3d.as/content/allegorithmic/18-free-substances/26a">18 Free Substances Pack</a> is a great way to familiarize yourself with this time and space saving technology.  We&#8217;ve got a couple of very popular example products up on the store, including the <a rel="nofollow" title="Airstream Demo"  href="http://u3d.as/content/allegorithmic/airstream-substance-demo/26X">Airstream Demo</a> and Pimp Your Hooligan example projects.  Get hooked on Substances today!</p>
<p><strong>uScript, Playmaker and Antares Universe</strong><br />
The latest contender to the visual, node-based scripting tool arena, <a rel="nofollow"  href="http://u3d.as/content/detox-studios-llc/u-script-visual-scripting-tool/2fc">uScript</a> from Detox Studios is the way to create game logic without writing a single line of code.   The uScript editor integrates nicely into the Unity editor environment, for a basically seamless development experience!  Our other two popular visual scripting toolkits, <a rel="nofollow" title="Playmaker"  href="http://u3d.as/content/hutong-games-llc/playmaker/1Az">Playmaker</a> and <a rel="nofollow" title="Antares Universe"  href="http://u3d.as/content/neo-pax/antares-universe-vizio-/1CJ">Antares Universe</a>, are also incredibly popular, five-star solutions.</p>
<p>Other noteworthy additions to the store include <a rel="nofollow" title="Dynamic Elements Effects Pack"  href="http://u3d.as/content/kalamona/dynamic-elements-effect-pack/2kq">Dynamic Elements Effects Pack</a>, from Kalamona, which brings over thirty top-quality RPG-style spell and magic effects to Unity.  You&#8217;ll find even more AAA <a rel="nofollow" title="Fantasy Walls and Towers"  href="http://u3d.as/content/dexsoft-games/fantasy-walls-and-towers/2n6">environments</a> and <a rel="nofollow"  href="http://u3d.as/content/dexsoft-games/barbarian/2oe">characters</a> rolling in from the incredibly prolific Dexsoft, and run, don&#8217;t walk, to get the free <a rel="nofollow" title="Strumpy Shader Editor"  href="http://u3d.as/content/strumpy-games/strumpy-shader-editor/1C4">Strumpy Shader Editor</a>&#8211; the tool so cool we had to hunt down and hire its developer!  We&#8217;ve also added new <a rel="nofollow" title="APM music example"  href="http://u3d.as/content/apm-music/affinia-biker-s-ball/2k6">high quality music</a> from one of Hollywood&#8217;s biggest production music houses, <a rel="nofollow" title="APM"  href="http://www.apmmusic.com/">APM Music</a>!</p>
<p>The Unity Asset Store is always on the lookout for great new content.  We&#8217;ve even expanded our team to actively hunt down and scout out top quality assets. We offer content sellers a 70/30% rev share split (you get the 70%) and monthly payouts by PayPal, with no transaction fee, either!  Some content sellers have earned so much that they quit their day jobs to focus exclusively on the Asset Store, while some smaller sellers make enough on the side to buy videogames, motorcycles, pizza and beer. Top seller or not, nearly all of them have had a great time bringing their creations to the Unity developer community.  Got what it takes?  We&#8217;re picky, but <a rel="nofollow" title="Submit your content"  href="http://unity3d.com/unity/editor/asset-store-submit">send us your stuff</a>!</p>
<p>&nbsp;</p>]]></content:encoded>
			<wfw:commentRss>http://www.bydesigngames.com/2011/10/19/asset-store-action-news-%e2%80%93-october-2011-unity-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

