Hi Can You Help ME To Create Unity Level Spawner. 20 Object To Spawn At Position 1s(0,0,20) 2nd(0,0,40)…
Get Object && Get SpawnCount.
Randomly spawn Object on 20 Position
if Level Restart Then load That same Level Again
Also Get Selected Object Set To Spawn On Different Level, Like 1 To 50,50 To 100;
Making Game For Android Iam New To Game Development 7 Days Iam Confused How To make this
Following Code Don’t Matter Just Example. Can Suggest Your Way How You will do this.
//
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public class ObjectToSpawn
{
public GameObject Object;
public int spawnCount;
}
public class LevelSpawner : MonoBehaviour
{
public Transform[] SpawnLocation; //Obstacles Spawn Location
public ObjectToSpawn[] itemToSpawn; // Select Obstacles For spawn
public int maxSpawnObject; // Total Object
private Vector3[] LastSpawnLocation; // if Level Restart Spawn Last Object And Its
}
// Another
[System.Serializable]
public class LevelSelection
{
public string Element; // Selected List Of Object And Count For Spawn
public int LevelFrom;
public int LevelTo;
}
public class ObjectSelect : MonoBehaviour
{
public LevelSpawner[] SetOfLevel; //Get Selected Object To spawn
public LevelSelection[] levelselection; //
}
