大きさを変化させよう:transform.localScale

オブジェクトの大きさを変化させる
using UnityEngine;
using System.Collections;
public class ScaleChange : MonoBehaviour {
// 大きさをInspector上で自由に設定できるようにする
public Vector3 scale;
void OnTriggerEnter(Collider other){
other.gameObject.transform.localScale = new Vector3(scale.x, scale.y, scale.z);
}
}



【旧版】BallGame(全25回)
他のコースを見る
オブジェクトの大きさを変化させる
using UnityEngine;
using System.Collections;
public class ScaleChange : MonoBehaviour {
// 大きさをInspector上で自由に設定できるようにする
public Vector3 scale;
void OnTriggerEnter(Collider other){
other.gameObject.transform.localScale = new Vector3(scale.x, scale.y, scale.z);
}
}



大きさを変化させよう:transform.localScale