// Use this for initialization void Start() { player = GameObject.Find("PlayerObj"); playerScript = player.GetComponent <PlayerScript>(); if (playerScript.getGunType() != PlayerScript.GunType.HandGun) { transform.localPosition = new Vector3(1.0f, -10.0f, 0.5f); } cursolObject = GameObject.Find("CursolObject"); cursolScript = cursolObject.GetComponent <CursolObjectScript>(); bulletNum = maxBulletNum; reloadTimer = 0.0f; //初期化時、最大装填数に合わせて弾画像生成 for (var i = 0; i < 15; i++) { Vector3 euler = new Vector3(0.0f, 20.0f, 90.0f); bulletObj_3D[i] = (GameObject)Instantiate(bullet_3D, Vector3.zero, Quaternion.Euler(0, 90, 90)); bulletObj_3D[i].transform.parent = player.transform; bulletObj_3D[i].transform.localPosition = new Vector3(2.6f, -0.5f + 0.1f * i, 3.0f); } }
//public GameObject text; // Use this for initialization void Start() { player = GameObject.Find("PlayerObj"); playerScr = player.GetComponent <PlayerScript>(); if (playerScr.getGunType() != PlayerScript.GunType.MachinGun) { transform.localPosition = new Vector3(1.0f, -10.0f, 0.3f); } cursolObject = GameObject.Find("CursolObject"); cursolScript = cursolObject.GetComponent <CursolObjectScript>(); bulletNum = maxBulletNum; shotWaitTimer = 0.0f; reloadTimer = 0.0f; bulletObj = new GameObject[maxBulletNum]; bulletObj_3D = new GameObject[maxBulletNum]; //初期化時、最大装填数に合わせて弾画像生成 for (var i = 0; i < maxBulletNum; i++) { Vector3 euler = new Vector3(0.0f, 30.0f, 90.0f); bulletObj_3D[i] = (GameObject)Instantiate(bullet_3D, Vector3.zero, Quaternion.Euler(0, 50, 90)); bulletObj_3D[i].transform.parent = player.transform; bulletObj_3D[i].transform.localPosition = new Vector3((float)(2.6f - (i / 30 * 0.3f)), (float)(-0.5f + 0.06f * (i % 30) + (i / 30 * 0.03)), 3.0f); } }
// Use this for initialization void Start() { var Player = GameObject.Find("PlayerObj"); playerScr = Player.GetComponent <PlayerScript>(); if (playerScr.getGunType() != PlayerScript.GunType.RocketLauncher) { transform.localPosition = new Vector3(1.0f, -10.0f, 0.3f); } cursolObject = GameObject.Find("CursolObject"); cursolScript = cursolObject.GetComponent <CursolObjectScript>(); bulletNum = maxBulletNum; reloadTimer = 0.0f; //point = GameObject.Find("PointKun"); }