Exemplo n.º 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>());
        }
Exemplo n.º 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>());
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }