Created
November 11, 2013 20:07
-
-
Save jakevsrobots/7419464 to your computer and use it in GitHub Desktop.
Sample script to resize a cube based on Sharecart 1000 value.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class SizeBox : MonoBehaviour { | |
float targetX; | |
// Use this for initialization | |
void Start () { | |
targetX = ShareCartOneThousand.MapX; | |
} | |
// Update is called once per frame | |
void Update () { | |
float newX = Mathf.MoveTowards(transform.localScale.x, | |
targetX, | |
Time.deltaTime); | |
transform.localScale = new Vector3(newX, 1, 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment