You are looking at the HTML representation of the XML format.
HTML is good for debugging, but probably is not suitable for your application.
See complete documentation, or API help for more information.
<?xml version="1.0"?>
<api>
  <query-continue>
    <allpages gapfrom="ReflectiveVertexlitSimple" />
  </query-continue>
  <query>
    <pages>
      <page pageid="1977" ns="0" title="RectangleWipe">
        <revisions>
          <rev xml:space="preserve">[[Category: Camera]]
[[Category: MonoBehaviour]]
[[Category: JavaScript]]

Author: Eric Haines (Eric5h5)

==Description==
Makes an animated rectangular wipe from one camera view to another, that can either zoom in or out.

[[Image:RectWipe.jpg]]

==Usage==
See [[ScreenWipes]] for an example scene and the actual script that performs the wipe.  The script below is an example of usage.  It should be attached to an object, such as a manager object, and the [[ScreenWipes]] script should also be attached to the manager object.  Also needed are two cameras, which must be in the same scene, naturally.  In this example, you can press the up and down arrow keys to make the rectangle wipe zoom in or out.

Drag the two cameras onto the appropriate slots in the inspector after you've attached the script to an object.  The script has a '''WipeTime''' public variable; this is the time it will take for the wipe to complete.

Any GUIElements (GUITexts and GUITextures) will move along with the cameras during the transition. To avoid this, make another camera that only renders GUIElements on top of the other cameras, and nothing else. If you're using OnGUI, then the GUI won't be affected.

The function is a coroutine:

function '''RectWipe (camera1 : '''Camera''', camera2 : '''Camera''', wipeTime : '''float''', zoom : '''ZoomType''') :''' IEnumerator

'''camera1''' is the camera that you are wiping from and '''camera2''' is the camera you are wiping to. '''wipeTime''' is the length of time, in seconds, it takes to complete the wipe. '''zoom''' is the ZoomType, which should be either ZoomType.Grow to zoom in or ZoomType.Shrink to zoom out.

==JavaScript - RectWipeExample.js==
&lt;syntaxhighlight lang=&quot;javascript&quot;&gt;var camera1 : Camera;
var camera2 : Camera;
var wipeTime = 2.0;
var curve : AnimationCurve;
private var inProgress = false;
private var swap = false;

function Update () {
	if (Input.GetKeyDown(&quot;up&quot;)) {
		DoWipe(ZoomType.Grow);
	}
	else if (Input.GetKeyDown(&quot;down&quot;)) {
		DoWipe(ZoomType.Shrink);
	}
}

function DoWipe (zoom : ZoomType) {
	if (inProgress) return;
	inProgress = true;
	
	swap = !swap;
	yield ScreenWipe.use.RectWipe (swap? camera1 : camera2, swap? camera2 : camera1, wipeTime, zoom);	
	//yield ScreenWipe.use.RectWipe (swap? camera1 : camera2, swap? camera2 : camera1, wipeTime, zoom, curve);

	inProgress = false;
}&lt;/syntaxhighlight&gt;

To use this you also need the [[ScreenWipes]] script.</rev>
        </revisions>
      </page>
      <page pageid="3471" ns="0" title="ReflectedObject">
        <revisions>
          <rev xml:space="preserve">[[Category: Reflection]]
== About ==
'''ReflectedObject Script'''

Reflects a target object, providing quick access by name to reading and writing its fields and properties, and calling its methods.
===== Script Version =====
''0.1.0.0''
===== Script Revision =====
''5/24/2011''


== Description ==
The ReflectedObject is useful when you need to read and write, or call the methods of, a raw object instance.  Create an instance
of ReflectedObject on a target object to build a collection of that object's fields, properties, and methods which can then be
quickly accessed by name.  Fields and properties can be read or written to, and fields in particular can return values as bools,
colors, floats, integers, strings, and vector3. Fields also have type-safe methods which will return true if the field can be
returned as the desired type and will fill a reference parameter with the return value, and will return false if they cannot.
In addition to reading and writing fields and properties, methods can be called and allow passing parameters and returning values.


You should create only one ReflectedObject per object instance and reuse it as long as possible.  You should call Dispose() on the
ReflectedObject when you are finished with it in order to release the internal reference to the root object that was reflected.


== Script - C# ==
&lt;syntaxhighlight lang=&quot;csharp&quot;&gt;
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

/// &lt;summary&gt;
/// Reflects a target object, providing quick access by name to reading and writing its fields and properties, and calling its methods.
/// &lt;/summary&gt;
/// &lt;!-- 
/// Version 0.1.0.0
/// By Reed Kimble
/// Last Revision 5/24/2011
/// --&gt;
/// &lt;remarks&gt;
/// The ReflectedObject is useful when you need to read and write, or call the methods of, a raw object instance.  Create an instance
/// of ReflectedObject on a target object to build a collection of that object's fields, properties, and methods which can then be
/// quickly accessed by name.  Fields and properties can be read or written to, and fields in particular can return values as bools,
/// colors, floats, integers, strings, and vector3. Fields also have type-safe methods which will return true if the field can be
/// returned as the desired type and will fill a reference parameter with the return value, and will return false if they cannot.
/// In addition to reading and writing fields and properties, methods can be called and allow passing parameters and returning values.
/// 
/// You should create only one ReflectedObject per object instance and reuse it as long as possible.  Be sure to call Dispose() on the
/// ReflectedObject when you are finished with it in order to release the internal reference to the root object that was reflected.
/// &lt;/remarks&gt;
public class ReflectedObject : System.IDisposable
{
    private object _RootObject;
    /// &lt;summary&gt;
    /// The object instance reflected by this ReflectedObject.
    /// &lt;/summary&gt;
    public object RootObject { get { return _RootObject; } }

    /// &lt;summary&gt;
    /// Stores the list of reflected fields found on the root object.
    /// &lt;/summary&gt;
    private Dictionary&lt;string, FieldInfo&gt; _Fields = new Dictionary&lt;string, FieldInfo&gt;();
    /// &lt;summary&gt;
    /// Stores the list of reflected methods found on the root object.
    /// &lt;/summary&gt;
    private Dictionary&lt;string, MethodInfo&gt; _Methods = new Dictionary&lt;string, MethodInfo&gt;();
    /// &lt;summary&gt;
    /// Stores the list of reflected properties found on the root object.
    /// &lt;/summary&gt;
    private Dictionary&lt;string, PropertyInfo&gt; _Properties = new Dictionary&lt;string, PropertyInfo&gt;();

    /// &lt;summary&gt;
    /// Creates a new instance of ReflectedObject for the specified object instance.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;rootObject&quot;&gt;The object to reflect.&lt;/param&gt;
    public ReflectedObject(object rootObject)
    {
        System.Type rootType = rootObject.GetType();
        foreach (FieldInfo field in rootType.GetFields())
        {
            _Fields.Add(field.Name, field);
        }
        foreach (MethodInfo method in rootType.GetMethods())
        {
            _Methods.Add(method.Name, method);
        }
        foreach (PropertyInfo property in rootType.GetProperties())
        {
            _Properties.Add(property.Name, property);
        }
    }

    /// &lt;summary&gt;
    /// Checks to see if this object contains the named field.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field to look for.&lt;/param&gt;
    /// &lt;returns&gt;True if this object contains the named field, otherwise false.&lt;/returns&gt;
    public bool ContainsField(string fieldName)
    { return _Fields.ContainsKey(fieldName); }

    /// &lt;summary&gt;
    /// Checks to see if this object contains the named method.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;methodName&quot;&gt;The name of the method to look for.&lt;/param&gt;
    /// &lt;returns&gt;True if this object contains the named method, otherwise false.&lt;/returns&gt;
    public bool ContainsMethod(string methodName)
    { return _Methods.ContainsKey(methodName); }

    /// &lt;summary&gt;
    /// Checks to see if this object contains the named property.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;propertyName&quot;&gt;The name of the property to look for.&lt;/param&gt;
    /// &lt;returns&gt;True if this object contains the named property, otherwise false.&lt;/returns&gt;
    public bool ContainsProperty(string propertyName)
    { return _Properties.ContainsKey(propertyName); }

    /// &lt;summary&gt;
    /// Executes the method named using the supplied parameters. Use null if the method takes no parameters.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;methodName&quot;&gt;The name of the method to execute.&lt;/param&gt;
    /// &lt;param name=&quot;parameters&quot;&gt;The methods parameters in order, or null if the method has no parameters.&lt;/param&gt;
    /// &lt;returns&gt;The return value of the method, or null if the method is a void subroutine.&lt;/returns&gt;
    public object ExecuteMethod(string methodName, params object[] parameters)
    {
        if (ContainsMethod(methodName))
        {
            return _Methods[methodName].Invoke(_RootObject, parameters);
        }
        return null;
    }

    /// &lt;summary&gt;
    /// Gets the expected value type for the named field.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field to check.&lt;/param&gt;
    /// &lt;returns&gt;The System.Type of the field's value.&lt;/returns&gt;
    public System.Type GetFieldType(string fieldName)
    {
        if (_Fields.ContainsKey(fieldName))
        {
            return _Fields[fieldName].FieldType;
        }
        return null;
    }

    /// &lt;summary&gt;
    /// Gets the name of the expected value type for the named field.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field to check.&lt;/param&gt;
    /// &lt;returns&gt;The string name of the System.Type of the field's value.&lt;/returns&gt;
    public string GetFieldTypeName(string fieldName)
    {
        if (_Fields.ContainsKey(fieldName))
        {
            return _Fields[fieldName].FieldType.Name;
        }
        return null;
    }

    /// &lt;summary&gt;
    /// Gets the expected value type for the named property.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;propertyName&quot;&gt;The name of the property to check.&lt;/param&gt;
    /// &lt;returns&gt;The System.Type of the property's value.&lt;/returns&gt;
    public System.Type GetPropertyType(string propertyName)
    {
        if (_Properties.ContainsKey(propertyName))
        {
            return _Properties[propertyName].PropertyType;
        }
        return null;
    }

    /// &lt;summary&gt;
    /// Gets the name of the expected value type for the named property.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;propertyName&quot;&gt;The name of the property to check.&lt;/param&gt;
    /// &lt;returns&gt;The string name of the System.Type of the property's value.&lt;/returns&gt;
    public string GetPropertyTypeName(string propertyName)
    {
        if (_Properties.ContainsKey(propertyName))
        {
            return _Properties[propertyName].PropertyType.Name;
        }
        return null;
    }

    /// &lt;summary&gt;
    /// Returns the value of the named field as a boolean. Be sure the field requested is a boolean type, or use TryGetFieldBool().
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;returns&gt;The boolean value of the field.&lt;/returns&gt;
    public bool GetFieldBool(string fieldName)
    { return (bool)GetFieldValue(fieldName); }

    /// &lt;summary&gt;
    /// Returns the value of the named field as a color. Be sure the field requested is a color type, or use TryGetFieldColor().
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;returns&gt;The color value of the field.&lt;/returns&gt;
    public UnityEngine.Color GetFieldColor(string fieldName)
    { return (UnityEngine.Color)GetFieldValue(fieldName); }

    /// &lt;summary&gt;
    /// Returns the value of the named field as a float. Be sure the field requested is a float type, or use TryGetFieldFloat().
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;returns&gt;The float value of the field.&lt;/returns&gt;
    public float GetFieldFloat(string fieldName)
    { return (float)GetFieldValue(fieldName); }

    /// &lt;summary&gt;
    /// Returns the value of the named field as an integer. Be sure the field requested is an integer type, or use TryGetFieldInteger().
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;returns&gt;The integer value of the field.&lt;/returns&gt;
    public float GetFieldInteger(string fieldName)
    { return (int)GetFieldValue(fieldName); }

    /// &lt;summary&gt;
    /// Returns the value of the named field as a string. Be sure the field requested is a string type, or use TryGetFieldString().
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;returns&gt;The string value of the field.&lt;/returns&gt;
    public string GetFieldString(string fieldName)
    { return (string)GetFieldValue(fieldName); }

    /// &lt;summary&gt;
    /// Returns the value of the named field as a Vector3. Be sure the field requested is a Vector3 type, or use TryGetFieldVector3().
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;returns&gt;The Vector3 value of the field.&lt;/returns&gt;
    public UnityEngine.Vector3 GetFieldVector3(string fieldName)
    { return (UnityEngine.Vector3)GetFieldValue(fieldName); }

    /// &lt;summary&gt;
    /// Returns the value of the named field as an object.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;returns&gt;The object value of the field.&lt;/returns&gt;
    public object GetFieldValue(string fieldName)
    {
        if (ContainsField(fieldName))
        {
            return _Fields[fieldName].GetValue(_RootObject);
        }
        return null;
    }

    /// &lt;summary&gt;
    /// Returns the value of the named property as an object.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;propertyName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;returns&gt;The object value of the property.&lt;/returns&gt;
    public object GetPropertyValue(string propertyName)
    {
        if (ContainsProperty(propertyName))
        {
            return _Properties[propertyName].GetValue(_RootObject, null);
        }
        return null;
    }

    /// &lt;summary&gt;
    /// Sets the value of the named field to the specified object.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be set.&lt;/param&gt;
    /// &lt;param name=&quot;value&quot;&gt;The object value the field is set to.&lt;/param&gt;
    /// &lt;returns&gt;True if the field is found and set, otherwise false.&lt;/returns&gt;
    public bool SetFieldValue(string fieldName, object value)
    {
        if (ContainsField(fieldName))
        {
            _Fields[fieldName].SetValue(_RootObject, value);
            return true;
        }
        return false;
    }

    /// &lt;summary&gt;
    /// Sets the value of the named property to the specified object.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;propertyName&quot;&gt;The name of the property whose value should be set.&lt;/param&gt;
    /// &lt;param name=&quot;value&quot;&gt;The object value the property is set to.&lt;/param&gt;
    /// &lt;returns&gt;True if the property is found and set, otherwise false.&lt;/returns&gt;
    public bool SetPropertyValue(string propertyName, object value)
    {
        if (ContainsProperty(propertyName))
        {
            _Properties[propertyName].SetValue(_RootObject, value, null);
        }
        return false;
    }

    /// &lt;summary&gt;
    /// Gets the value of the named field as a boolean, if it is of the appropriate type and returns true, otherwise returns false.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;param name=&quot;result&quot;&gt;The boolean object instance used to return the field value, if found.&lt;/param&gt;
    /// &lt;returns&gt;True if the field is found and the result is returned, otherwise false.&lt;/returns&gt;
    public bool TryGetFieldBool(string fieldName, ref bool result)
    {
        if (GetFieldType(fieldName) == typeof(bool))
        {
            result = (bool)GetFieldValue(fieldName);
            return true;
        }
        return false;
    }

    /// &lt;summary&gt;
    /// Gets the value of the named field as a Color, if it is of the appropriate type and returns true, otherwise returns false.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;param name=&quot;result&quot;&gt;The Color object instance used to return the field value, if found.&lt;/param&gt;
    /// &lt;returns&gt;True if the field is found and the result is returned, otherwise false.&lt;/returns&gt;
    public bool TryGetFieldColor(string fieldName, ref UnityEngine.Color result)
    {
        if (GetFieldType(fieldName) == typeof(UnityEngine.Color))
        {
            result = (UnityEngine.Color)GetFieldValue(fieldName);
            return true;
        }
        return false;
    }

    /// &lt;summary&gt;
    /// Gets the value of the named field as a float, if it is of the appropriate type and returns true, otherwise returns false.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;param name=&quot;result&quot;&gt;The float object instance used to return the field value, if found.&lt;/param&gt;
    /// &lt;returns&gt;True if the field is found and the result is returned, otherwise false.&lt;/returns&gt;
    public bool TryGetFieldFloat(string fieldName, ref float result)
    {
        if (GetFieldType(fieldName) == typeof(float))
        {
            result = (float)GetFieldValue(fieldName);
            return true;
        }
        return false;
    }

    /// &lt;summary&gt;
    /// Gets the value of the named field as a integer, if it is of the appropriate type and returns true, otherwise returns false.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;param name=&quot;result&quot;&gt;The integer object instance used to return the field value, if found.&lt;/param&gt;
    /// &lt;returns&gt;True if the field is found and the result is returned, otherwise false.&lt;/returns&gt;
    public bool TryGetFieldInteger(string fieldName, ref int result)
    {
        if (GetFieldType(fieldName) == typeof(int))
        {
            result = (int)GetFieldValue(fieldName);
            return true;
        }
        return false;
    }

    /// &lt;summary&gt;
    /// Gets the value of the named field as a string, if it is of the appropriate type and returns true, otherwise returns false.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;param name=&quot;result&quot;&gt;The string object instance used to return the field value, if found.&lt;/param&gt;
    /// &lt;returns&gt;True if the field is found and the result is returned, otherwise false.&lt;/returns&gt;
    public bool TryGetFieldString(string fieldName, ref string result)
    {
        if (GetFieldType(fieldName) == typeof(string))
        {
            result = (string)GetFieldValue(fieldName);
            return true;
        }
        return false;
    }

    /// &lt;summary&gt;
    /// Gets the value of the named field as a Vector3, if it is of the appropriate type and returns true, otherwise returns false.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;fieldName&quot;&gt;The name of the field whose value should be returned.&lt;/param&gt;
    /// &lt;param name=&quot;result&quot;&gt;The Vector3 object instance used to return the field value, if found.&lt;/param&gt;
    /// &lt;returns&gt;True if the field is found and the result is returned, otherwise false.&lt;/returns&gt;
    public bool TryGetFieldVector3(string fieldName, ref UnityEngine.Vector3 result)
    {
        if (GetFieldType(fieldName) == typeof(UnityEngine.Vector3))
        {
            result = (UnityEngine.Vector3)GetFieldValue(fieldName);
            return true;
        }
        return false;
    }

    /// &lt;summary&gt;
    /// Clears stored reflection information and releases reference to root object.
    /// &lt;/summary&gt;
    void System.IDisposable.Dispose()
    {
        _Fields.Clear();
        _Methods.Clear();
        _Properties.Clear();
        _RootObject = null;
    }
}
&lt;/syntaxhighlight&gt;

== References ==
None. This is an original script.</rev>
        </revisions>
      </page>
    </pages>
  </query>
</api>