UnassignedReferenceException:敌人的可变射弹没有 被分配。您可能需要分配的射弹变量 检查器中的“敌人”脚本。 UnityEngine.Object.Internal_InstantiateSingle(UnityEngine.Object 数据,UnityEngine.Vector3 pos,UnityEngine.Quaternion腐烂)
GameObject laser = Instantiate(
projectile, transform.position, Quaternion.identity) as GameObject;
laser.GetComponent<Rigidbody2D>().velocity = new Vector2(0, - projectileSpeed);