FTME01_ScaleMesh.cs 461 B

1234567891011121314151617181920212223
  1. using UnityEngine;
  2. using System.Collections;
  3. public class FTME01_ScaleMesh : MonoBehaviour {
  4. Transform myMesh;
  5. Vector3 origMeshScale;
  6. public float scaleMeshSize = 1f;
  7. public void ScaleMeshOnEnable () {
  8. myMesh = GetComponent<Transform>();
  9. origMeshScale = myMesh.localScale;
  10. }
  11. public void ScaleMeshOnDisable () {
  12. myMesh.localScale = origMeshScale;
  13. }
  14. public void ScaleMesh () {
  15. myMesh.localScale = origMeshScale * scaleMeshSize;
  16. }
  17. }