private GameObject ServerSpawnObject(GameObject entityPrefab, Vector3 worldPosition, PortalSpawnInfo settings) { // Spawn object at landing zone, (sprite will move back up to worldPosition for animation). GameObject entity = Spawn.ServerPrefab(entityPrefab, worldPosition).GameObject; OnObjectSpawned?.Invoke(entity); UpdateManager.Instance.StartCoroutine(ServerRunObjectSequence(entity, settings)); return(entity); }
private void Spawn() { Vector3 ranomPos = new Vector3(Random.Range(-sizeSpawnZone.x, sizeSpawnZone.x), 0, Random.Range(-sizeSpawnZone.z, sizeSpawnZone.z)); GameObject go = Instantiate(prefab, ranomPos, Quaternion.identity); if (lifeTime != -1) { Destroy(go, lifeTime); } OnObjectSpawned?.Invoke(go); }
private void InputInteraction_OnSelectObjectInteraction(Vector3 position) { var spawnedObject = SpawnAt(position); OnObjectSpawned?.Invoke(spawnedObject); }
public void Spawn() { prefab.transform.position = new Vector2(UnityEngine.Random.Range(-border, border), UnityEngine.Random.Range(-border, border)); OnObjectSpawned.Invoke(prefab.transform); }