IEnumerator Start() { while (TNManager.isJoiningChannel) { yield return(null); } TNManager.Create(prefab, transform.position, transform.rotation, persistent); Destroy(gameObject); }
/// <summary> /// Create a new object above the clicked position /// </summary> void OnClick() { Vector3 pos = TouchHandler.worldPos; pos.y += 3f; Quaternion rot = Quaternion.Euler(Random.value * 180f, Random.value * 180f, Random.value * 180f); TNManager.Create(objectToCreate, pos, rot); }
void SpawnPlayerNow() { float randomX = Random.Range(-spawnDistanceX, spawnDistanceX); float randomY = Random.Range(-spawnDistanceY, spawnDistanceY); Vector3 spawnPos = new Vector3(transform.position.x + randomX, transform.position.y + randomY, 0f); TNManager.Create(playerPrefab, spawnPos, Quaternion.identity, false); GameManager.Instance.Invoke("AddPlayersToDict", 1f); // CHANGED FROM 3f }
IEnumerator PeriodicCreate() { while (TNManager.isConnected) { if (!TNManager.isJoiningChannel) { TNManager.Create("Stress Test Object", true); } yield return(new WaitForSeconds(Random.Range(0.04f, 0.06f))); if (!TNManager.isJoiningChannel) { TNManager.Create("Stress Test Object", false); } yield return(new WaitForSeconds(Random.Range(0.04f, 0.06f))); } }
void SpawnNow() { TNManager.Create(prefabToSpawn, transform.position, Quaternion.identity, persistent); }
void Start() { TNManager.Create(prefab, transform.position, transform.rotation, persistent); Destroy(gameObject); }