Example #1
0
        public static T Spawn <T>(this object o, GameObject prefab, string parentID, Vector3 startPosition = default(Vector3), Quaternion startRotation = default(Quaternion))
        {
            var parent = ProcessorScene.Get(parentID);
            var go     = Object.Instantiate(prefab, parent).transform;

            go.position      = startPosition;
            go.localRotation = startRotation;
            go.localScale    = Vector3.one;
            return(go.GetComponentInChildren <T>());
        }
Example #2
0
        public static T Spawn <T>(this object o, int poolID, GameObject prefab, string parentID, Vector3 startPosition = default, Quaternion startRotation = default)
        {
            var parent = ProcessorScene.Get(parentID);
            var go     = HandlePool.pools[poolID].Spawn(prefab, parent).transform;

            go.position      = startPosition;
            go.localRotation = startRotation;
            go.localScale    = Vector3.one;
            return(go.GetComponentInChildren <T>());
        }
Example #3
0
        public static Transform Spawn(this object o, string prefabID, string parentID, Vector3 startPosition = default(Vector3), Quaternion startRotation = default(Quaternion))
        {
            var parent = ProcessorScene.Get(parentID);
            var prefab = Box.Get <GameObject>(prefabID);
            var go     = Object.Instantiate(prefab, parent).transform;

            go.position      = startPosition;
            go.localRotation = startRotation;
            go.localScale    = Vector3.one;
            return(go);
        }
Example #4
0
        public static Transform Spawn(this object o, int poolID, string prefabID, string parentID, Vector3 startPosition = default, Quaternion startRotation = default)
        {
            var parent = ProcessorScene.Get(parentID);
            var prefab = Box.Get <GameObject>(prefabID);
            var go     = HandlePool.pools[poolID].Spawn(prefab, parent).transform;

            go.position      = startPosition;
            go.localRotation = startRotation;
            go.localScale    = Vector3.one;
            return(go);
        }