public static void ScaleFrom(GameObject target, Hashtable args)
{
Vector3 tempScale;
Vector3 fromScale;
//clean args:
args = iTween.CleanArgs(args);
//set base fromScale:
tempScale=fromScale=target.transform.localScale;
//set augmented fromScale:
if(args.Contains("scale")){
if (args["scale"].GetType() == typeof(Transform)){
Transform trans = (Transform)args["scale"];
fromScale=trans.localScale;
}else if(args["scale"].GetType() == typeof(Vector3)){
fromScale=(Vector3)args["scale"];
}
}else{
if (args.Contains("x")) {
fromScale.x=(float)args["x"];
}
if (args.Contains("y")) {
fromScale.y=(float)args["y"];
}
if (args.Contains("z")) {
fromScale.z=(float)args["z"];
}
}
//apply fromScale:
target.transform.localScale = fromScale;
//set new scale arg:
args["scale"]=tempScale;
//establish iTween:
args["type"]="scale";
args["method"]="to";
Launch(target,args);
}