예제 #1
0
 void OnGUI()
 {
     if (isServer)
     {
         if (GUILayout.Button("Spawn 1"))
         {
             NetworkObjectPoolManager.PullObject("Object1").transform.position = new Vector3(m_Position++, 0, 0);
         }
         if (GUILayout.Button("Spawn 2"))
         {
             NetworkObjectPoolManager.PullObject("Object2").transform.position = new Vector3(m_Position++, 0, 0);
         }
     }
 }
예제 #2
0
    void OnGUI()
    {
        NetworkIdentity nId = GetComponent <NetworkIdentity>();

        if (nId && nId.isServer)
        {
            if (GUILayout.Button("Spawn 1"))
            {
                ObjectPoolManager.PullObject("Object1").transform.position = new Vector3(m_Position++, 0, 0);
            }
            if (GUILayout.Button("Spawn 2"))
            {
                NetworkObjectPoolManager.PullObject("Object2").transform.position = new Vector3(m_Position++, 0, 0);
            }
        }
    }