예제 #1
0
        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);
            }
        }
예제 #2
0
 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);
     }
 }