|
|
|
@ -225,6 +225,7 @@ public class iTween : MonoBehaviour{
|
|
|
|
|
/// </param> |
|
|
|
|
public static void Init(GameObject target){ |
|
|
|
|
MoveBy(target,Vector3.zero,0); |
|
|
|
|
cameraFade = null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
@ -705,11 +706,7 @@ public class iTween : MonoBehaviour{
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//set tempColor and base fromColor: |
|
|
|
|
if(target.GetComponent<GUITexture>()){ |
|
|
|
|
tempColor=fromColor=target.GetComponent<GUITexture>().color; |
|
|
|
|
}else if(target.GetComponent<GUIText>()){ |
|
|
|
|
tempColor=fromColor=target.GetComponent<GUIText>().material.color; |
|
|
|
|
}else if(target.GetComponent<Renderer>()){ |
|
|
|
|
if(target.GetComponent<Renderer>()){ |
|
|
|
|
tempColor=fromColor=target.GetComponent<Renderer>().material.color; |
|
|
|
|
}else if(target.GetComponent<Light>()){ |
|
|
|
|
tempColor=fromColor=target.GetComponent<Light>().color; |
|
|
|
@ -743,11 +740,7 @@ public class iTween : MonoBehaviour{
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//apply fromColor: |
|
|
|
|
if(target.GetComponent<GUITexture>()){ |
|
|
|
|
target.GetComponent<GUITexture>().color=fromColor; |
|
|
|
|
}else if(target.GetComponent<GUIText>()){ |
|
|
|
|
target.GetComponent<GUIText>().material.color=fromColor; |
|
|
|
|
}else if(target.GetComponent<Renderer>()){ |
|
|
|
|
if(target.GetComponent<Renderer>()){ |
|
|
|
|
target.GetComponent<Renderer>().material.color=fromColor; |
|
|
|
|
}else if(target.GetComponent<Light>()){ |
|
|
|
|
target.GetComponent<Light>().color=fromColor; |
|
|
|
@ -3332,13 +3325,7 @@ public class iTween : MonoBehaviour{
|
|
|
|
|
//colors = new Color[3]; |
|
|
|
|
|
|
|
|
|
//from and init to values: |
|
|
|
|
if(GetComponent<GUITexture>()){ |
|
|
|
|
colors = new Color[1,3]; |
|
|
|
|
colors[0,0] = colors[0,1] = GetComponent<GUITexture>().color; |
|
|
|
|
}else if(GetComponent<GUIText>()){ |
|
|
|
|
colors = new Color[1,3]; |
|
|
|
|
colors[0,0] = colors[0,1] = GetComponent<GUIText>().material.color; |
|
|
|
|
}else if(GetComponent<Renderer>()){ |
|
|
|
|
if(GetComponent<Renderer>()){ |
|
|
|
|
colors = new Color[GetComponent<Renderer>().materials.Length,3]; |
|
|
|
|
for (int i = 0; i < GetComponent<Renderer>().materials.Length; i++) { |
|
|
|
|
colors[i,0]=GetComponent<Renderer>().materials[i].GetColor(namedcolorvalue.ToString()); |
|
|
|
@ -4108,13 +4095,7 @@ public class iTween : MonoBehaviour{
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
//apply: |
|
|
|
|
if(GetComponent<GUITexture>()){ |
|
|
|
|
//guiTexture.color=colors[2]; |
|
|
|
|
GetComponent<GUITexture>().color=colors[0,2]; |
|
|
|
|
}else if(GetComponent<GUIText>()){ |
|
|
|
|
//guiText.material.color=colors[2]; |
|
|
|
|
GetComponent<GUIText>().material.color=colors[0,2]; |
|
|
|
|
}else if(GetComponent<Renderer>()){ |
|
|
|
|
if(GetComponent<Renderer>()){ |
|
|
|
|
//renderer.material.color=colors[2]; |
|
|
|
|
for (int i = 0; i < colors.GetLength(0); i++) { |
|
|
|
|
GetComponent<Renderer>().materials[i].SetColor(namedcolorvalue.ToString(),colors[i,2]); |
|
|
|
@ -4126,13 +4107,7 @@ public class iTween : MonoBehaviour{
|
|
|
|
|
|
|
|
|
|
//dial in: |
|
|
|
|
if(percentage==1){ |
|
|
|
|
if(GetComponent<GUITexture>()){ |
|
|
|
|
//guiTexture.color=colors[1]; |
|
|
|
|
GetComponent<GUITexture>().color=colors[0,1]; |
|
|
|
|
}else if(GetComponent<GUIText>()){ |
|
|
|
|
//guiText.material.color=colors[1]; |
|
|
|
|
GetComponent<GUIText>().material.color=colors[0,1]; |
|
|
|
|
}else if(GetComponent<Renderer>()){ |
|
|
|
|
if(GetComponent<Renderer>()){ |
|
|
|
|
//renderer.material.color=colors[1]; |
|
|
|
|
for (int i = 0; i < colors.GetLength(0); i++) { |
|
|
|
|
GetComponent<Renderer>().materials[i].SetColor(namedcolorvalue.ToString(),colors[i,1]); |
|
|
|
@ -4854,11 +4829,7 @@ public class iTween : MonoBehaviour{
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//init values: |
|
|
|
|
if(target.GetComponent<GUITexture>()){ |
|
|
|
|
colors[0] = colors[1] = target.GetComponent<GUITexture>().color; |
|
|
|
|
}else if(target.GetComponent<GUIText>()){ |
|
|
|
|
colors[0] = colors[1] = target.GetComponent<GUIText>().material.color; |
|
|
|
|
}else if(target.GetComponent<Renderer>()){ |
|
|
|
|
if(target.GetComponent<Renderer>()){ |
|
|
|
|
colors[0] = colors[1] = target.GetComponent<Renderer>().material.color; |
|
|
|
|
}else if(target.GetComponent<Light>()){ |
|
|
|
|
colors[0] = colors[1] = target.GetComponent<Light>().color; |
|
|
|
@ -4889,11 +4860,7 @@ public class iTween : MonoBehaviour{
|
|
|
|
|
colors[3].a=Mathf.SmoothDamp(colors[0].a,colors[1].a,ref colors[2].a,time); |
|
|
|
|
|
|
|
|
|
//apply: |
|
|
|
|
if(target.GetComponent<GUITexture>()){ |
|
|
|
|
target.GetComponent<GUITexture>().color=colors[3]; |
|
|
|
|
}else if(target.GetComponent<GUIText>()){ |
|
|
|
|
target.GetComponent<GUIText>().material.color=colors[3]; |
|
|
|
|
}else if(target.GetComponent<Renderer>()){ |
|
|
|
|
if(target.GetComponent<Renderer>()){ |
|
|
|
|
target.GetComponent<Renderer>().material.color=colors[3]; |
|
|
|
|
}else if(target.GetComponent<Light>()){ |
|
|
|
|
target.GetComponent<Light>().color=colors[3]; |
|
|
|
@ -6008,90 +5975,8 @@ public class iTween : MonoBehaviour{
|
|
|
|
|
if(cameraFade){ |
|
|
|
|
Destroy(cameraFade); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Changes a camera fade's texture. |
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name='texture'> |
|
|
|
|
/// A <see cref="Texture2D"/> |
|
|
|
|
/// </param> |
|
|
|
|
public static void CameraFadeSwap(Texture2D texture){ |
|
|
|
|
if(cameraFade){ |
|
|
|
|
cameraFade.GetComponent<GUITexture>().texture=texture; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Creates a GameObject (if it doesn't exist) at the supplied depth that can be used to simulate a camera fade. |
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name='texture'> |
|
|
|
|
/// A <see cref="Texture2D"/> |
|
|
|
|
/// </param> |
|
|
|
|
/// <param name='depth'> |
|
|
|
|
/// A <see cref="System.Int32"/> |
|
|
|
|
/// </param> |
|
|
|
|
/// <returns> |
|
|
|
|
/// A <see cref="GameObject"/> for a reference to the CameraFade. |
|
|
|
|
/// </returns> |
|
|
|
|
public static GameObject CameraFadeAdd(Texture2D texture, int depth){ |
|
|
|
|
if(cameraFade){ |
|
|
|
|
return null; |
|
|
|
|
}else{ |
|
|
|
|
//establish colorFade object: |
|
|
|
|
cameraFade = new GameObject("iTween Camera Fade"); |
|
|
|
|
cameraFade.transform.position= new Vector3(.5f,.5f,depth); |
|
|
|
|
cameraFade.AddComponent<GUITexture>(); |
|
|
|
|
cameraFade.GetComponent<GUITexture>().texture=texture; |
|
|
|
|
cameraFade.GetComponent<GUITexture>().color = new Color(.5f,.5f,.5f,0); |
|
|
|
|
return cameraFade; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Creates a GameObject (if it doesn't exist) at the default depth that can be used to simulate a camera fade. |
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name='texture'> |
|
|
|
|
/// A <see cref="Texture2D"/> |
|
|
|
|
/// </param> |
|
|
|
|
/// <returns> |
|
|
|
|
/// A <see cref="GameObject"/> for a reference to the CameraFade. |
|
|
|
|
/// </returns> |
|
|
|
|
public static GameObject CameraFadeAdd(Texture2D texture){ |
|
|
|
|
if(cameraFade){ |
|
|
|
|
return null; |
|
|
|
|
}else{ |
|
|
|
|
//establish colorFade object: |
|
|
|
|
cameraFade = new GameObject("iTween Camera Fade"); |
|
|
|
|
cameraFade.transform.position= new Vector3(.5f,.5f,Defaults.cameraFadeDepth); |
|
|
|
|
cameraFade.AddComponent<GUITexture>(); |
|
|
|
|
cameraFade.GetComponent<GUITexture>().texture=texture; |
|
|
|
|
cameraFade.GetComponent<GUITexture>().color = new Color(.5f,.5f,.5f,0); |
|
|
|
|
return cameraFade; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Creates a GameObject (if it doesn't exist) at the default depth filled with black that can be used to simulate a camera fade. |
|
|
|
|
/// </summary> |
|
|
|
|
/// <returns> |
|
|
|
|
/// A <see cref="GameObject"/> for a reference to the CameraFade. |
|
|
|
|
/// </returns> |
|
|
|
|
public static GameObject CameraFadeAdd(){ |
|
|
|
|
if(cameraFade){ |
|
|
|
|
return null; |
|
|
|
|
}else{ |
|
|
|
|
//establish colorFade object: |
|
|
|
|
cameraFade = new GameObject("iTween Camera Fade"); |
|
|
|
|
cameraFade.transform.position= new Vector3(.5f,.5f,Defaults.cameraFadeDepth); |
|
|
|
|
cameraFade.AddComponent<GUITexture>(); |
|
|
|
|
cameraFade.GetComponent<GUITexture>().texture=CameraTexture(Color.black); |
|
|
|
|
cameraFade.GetComponent<GUITexture>().color = new Color(.5f,.5f,.5f,0); |
|
|
|
|
return cameraFade; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//################################# |
|
|
|
|
//# RESUME UTILITIES AND OVERLOADS # |
|
|
|
|
//################################# |
|
|
|
|