19 [Tooltip(
"Optional transform target, for when you want to spawn the object on a specific parent. If this value is not set, then the spawned objects will be spawned on this game object.")]
20 private Transform spawnParentTransform;
24 if (spawnManager == null)
26 Debug.LogError(
"You need to reference the spawn manager on SyncObjectSpawner.");
30 if (spawnParentTransform == null)
32 spawnParentTransform = transform;
38 Vector3 position =
Random.onUnitSphere * 2;
39 Quaternion rotation =
Random.rotation;
43 spawnManager.
Spawn(spawnedObject, position, rotation, spawnParentTransform.gameObject,
"SpawnedObject",
false);
48 Vector3 position =
Random.onUnitSphere * 2;
49 Quaternion rotation =
Random.rotation;
52 spawnedObject.TestFloat.Value =
Random.Range(0f, 100f);
54 spawnManager.
Spawn(spawnedObject, position, rotation, spawnParentTransform.gameObject,
"SpawnTestSphere",
false);
63 if (hitObject != null)
66 if (syncModelAccessor != null)
69 spawnManager.
Delete(syncSpawnObject);