2020-06-01から1ヶ月間の記事一覧

360度 敵を生成

using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Collections.Generic; public class enemyInst : MonoBehaviour { float time; //生み出す敵のオブジェクト public GameObject EnemyObj; //プレイヤーのオブ…

マウスの方を向く

using System.Collections; using System.Collections.Generic; using UnityEngine; public class Lookat : MonoBehaviour { Plane plane = new Plane(); float distance = 0; void Update() { // カメラとマウスの位置を元にRayを準備 var ray = Camera.mai…

当たったものを消す

using System.Collections; using System.Collections.Generic; using UnityEngine; public class tama : MonoBehaviour { private void OnCollisionEnter(Collision collision) { if(collision.gameObject.tag == "Enemy") { Destroy(collision.gameObject)…

弾を撃つ

using System.Collections; using System.Collections.Generic; using UnityEngine; public class fire : MonoBehaviour { public GameObject Tama; // Start is called before the first frame update void Start() { } // Update is called once per frame…

オブジェクトの移動と回転

using System.Collections; using System.Collections.Generic; using UnityEngine; public class move : MonoBehaviour { public float speed = 10.0f; public Rigidbody rb; // Start is called before the first frame update void Start() { rb = GetCom…