Esempio n. 1
0
 IEnumerator Start()
 {
     while (TNManager.isJoiningChannel)
     {
         yield return(null);
     }
     TNManager.Create(prefab, transform.position, transform.rotation, persistent);
     Destroy(gameObject);
 }
Esempio n. 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);
    }
Esempio n. 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
    }
Esempio n. 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)));
        }
    }
Esempio n. 5
0
 void SpawnNow()
 {
     TNManager.Create(prefabToSpawn, transform.position, Quaternion.identity, persistent);
 }
 void Start()
 {
     TNManager.Create(prefab, transform.position, transform.rotation, persistent);
     Destroy(gameObject);
 }