Wednesday, 1 May 2013

PickUp fruit - initiate effect code


#pragma strict
public enum ColorFilterType { normal, red, blue, orange };
public var colorSwitcher : ColorFilterType;
function OnTriggerEnter (other : Collider)
{
 renderer.enabled = false;

 switch ( colorSwitcher )
 {
  case ColorFilterType.normal:
 
   ColorFilterControl.Instance.SwitchToNormalCamera();
   break;
  
  case ColorFilterType.red:
 
   ColorFilterControl.Instance.SwitchToRedCamera();
   break;
  case ColorFilterType.blue:
 
   ColorFilterControl.Instance.SwitchToBlueCamera();
   break;
  
  case ColorFilterType.orange:
 
   ColorFilterControl.Instance.SwitchToOrangeCamera();
   break;  
 }
 
 yield WaitForSeconds (8);
 renderer.enabled = true;
}
/*function update();
{
 if (renderer.enabled = false)
*/

No comments:

Post a Comment