Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

using System.

Collections;
using System.Collections.Generic;
using UnityEngine;

public class Resizer : MonoBehaviour {

public float targetScale = 1f; //100f;


public float enlargeSpeed = 10f; //100f
public float targetsize;
public Transform obj;
bool enlarging;
void Start(){
Enlarge ();
}
void Enlarge(){
enlarging = true;
}
void Update(){
/*obj.transform.localScale = Vector3.Lerp (obj.transform.localScale,
new Vector3 (targetScale, targetScale, targetScale),
Time.deltaTime * shrinkSpeed);*/
if (enlarging) {
obj.transform.localScale += Vector3.one * 1f * enlargeSpeed;
if (obj.transform.localScale.x > targetsize) {
enlarging = false;
}
}
}
}

You might also like