TargetMove.cs
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26  | 
						using System.Collections; using System.Collections.Generic; using UnityEngine; public class TargetMove : MonoBehaviour {     //ターゲットの移動スピード     [SerializeField] float speed = 10f;     void Start()     {     }     void Update()     {         //X方向へ移動         transform.position += new Vector3(Time.deltaTime * speed, 0, 0);         //X座標60を越えれば、ターゲットを削除する         if(transform.position.x >= 60f)         {             Destroy(gameObject);         }     } }  |