Пример #1
0
 IEnumerator Start()
 {
     while (TNManager.isJoiningChannel)
     {
         yield return(null);
     }
     TNManager.Create(prefab, transform.position, transform.rotation, persistent);
     Destroy(gameObject);
 }
Пример #2
0
    /// <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);
    }
Пример #3
0
    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
    }
Пример #4
0
    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)));
        }
    }
Пример #5
0
 void SpawnNow()
 {
     TNManager.Create(prefabToSpawn, transform.position, Quaternion.identity, persistent);
 }
Пример #6
0
 void Start()
 {
     TNManager.Create(prefab, transform.position, transform.rotation, persistent);
     Destroy(gameObject);
 }