public static void Instantiate(string prefabPath, Vector3 position, Quaternion rotation) { var target = Resources.Load <GameObject>(prefabPath); // Synchronized GameObject if (target.GetComponent <SynchronizedObject>()) { Instantiate(target, position, rotation); // Not Synchronized GameObject } else { var addedNetworkGameObject = new AddedNetworkGameObject() { prefabPath = prefabPath, position = position, rotation = rotation }; Instance.addedNetworkGameObjects_.Add(addedNetworkGameObject); } }
public static void Instantiate(string prefabPath, Vector3 position, Quaternion rotation) { var target = Resources.Load<GameObject>(prefabPath); // Synchronized GameObject if (target.GetComponent<SynchronizedObject>()) { Instantiate(target, position, rotation); // Not Synchronized GameObject } else { var addedNetworkGameObject = new AddedNetworkGameObject() { prefabPath = prefabPath, position = position, rotation = rotation }; Instance.addedNetworkGameObjects_.Add(addedNetworkGameObject); } }