public override TResult Build(AssetManagerLoader loader)
        {
            GameObject go       = UnityEngine.Object.Instantiate(_go);
            TResult    trashBin = go.GetComponent <TResult>();

            if (trashBin == null)
            {
                trashBin = go.AddComponent <TResult>();
                if (!ContainsTag("GUID"))
                {
                    throw new Exception("Guid is never set");
                }
            }

            Apply(new BaseObjectContainer <TResult>(loader, trashBin, go));

            // ApplyGroup(BasePathAttachmentLiteral.SetupGroup, dc);
            // ApplyGroup(BasePathAttachmentLiteral.ConfigurationGroup, dc);
            foreach (Renderer componentsInChild in go.GetComponentsInChildren <Renderer>())
            {
                Parkitility.ReplaceWithParkitectMaterial(componentsInChild);
            }

            return(trashBin);
        }
        public TResult Build(AssetManagerLoader loader)
        {
            GameObject go      = Object.Instantiate(_go);
            TResult    balloon = go.GetComponent <TResult>();

            if (balloon == null)
            {
                Balloon cpy = (Balloon)AssetManager.Instance.getPrefab(Prefabs.BalloonRegular);
                balloon                = go.AddComponent <TResult>();
                balloon.pokeSound      = cpy.pokeSound;
                balloon.popSound       = cpy.popSound;
                balloon.popParticlesGO = cpy.popParticlesGO;
            }

            if (balloon.transform.childCount == 0)
            {
                GameObject stringAttachment = new GameObject("String");
                stringAttachment.transform.parent = balloon.transform;
                LineRenderer renderer = stringAttachment.AddComponent <LineRenderer>();
                renderer.positionCount = 2;
                renderer.material      = new Material(Shader.Find("Sprites/Default"));
            }
            Apply(new BaseObjectContainer <TResult>(loader, balloon, go));
            foreach (Renderer componentsInChild in go.GetComponentsInChildren <Renderer>())
            {
                Parkitility.ReplaceWithParkitectMaterial(componentsInChild);
            }

            loader.RegisterObject(balloon);
            return(balloon);
        }
        public TResult Build(AssetManagerLoader loader)
        {
            GameObject go = UnityEngine.Object.Instantiate(_go);

            TResult shop = go.GetComponent <TResult>();

            if (shop == null)
            {
                shop = go.AddComponent <TResult>();
                if (!ContainsTag("GUID"))
                {
                    throw new Exception("GUID is never set");
                }
            }

            Apply(new BaseObjectContainer <TResult>(loader, shop, go));
            foreach (Renderer componentsInChild in go.GetComponentsInChildren <Renderer>())
            {
                Parkitility.ReplaceWithParkitectMaterial(componentsInChild);
            }

            // register shop
            loader.RegisterObject(shop);
            return(shop);
        }
Example #4
0
        public Trash Build(AssetManagerLoader loader)
        {
            GameObject go    = UnityEngine.Object.Instantiate(_go);
            TResult    trash = go.GetComponent <TResult>();

            if (trash == null)
            {
                trash = go.AddComponent <TResult>();
            }
            Apply(new BaseObjectContainer <TResult>(loader, trash, go));
            foreach (Renderer componentsInChild in go.GetComponentsInChildren <Renderer>())
            {
                Parkitility.ReplaceWithParkitectMaterial(componentsInChild);
            }

            loader.RegisterObject(trash);
            return(trash);
        }
Example #5
0
        public TResult Build(AssetManagerLoader loader)
        {
            GameObject go = Object.Instantiate(_go);

            TResult product = go.GetComponent <TResult>();

            if (product == null)
            {
                product = go.AddComponent <TResult>();
            }

            Apply(new BaseObjectContainer <TResult>(loader, product, go));
            foreach (Renderer componentsInChild in go.GetComponentsInChildren <Renderer>())
            {
                Parkitility.ReplaceWithParkitectMaterial(componentsInChild);
            }

            // register shop
            loader.RegisterObject(product);
            return(product);
        }
        public override TResult Build(AssetManagerLoader loader)
        {
            GameObject go             = UnityEngine.Object.Instantiate(_go);
            TResult    pathAttachment = go.GetComponent <TResult>();

            if (pathAttachment == null)
            {
                pathAttachment = go.AddComponent <TResult>();
                if (!ContainsTag("GUID"))
                {
                    throw new Exception("Guid is never set");
                }
            }

            Apply(new BaseObjectContainer <TResult>(loader, pathAttachment, go));
            foreach (Renderer componentsInChild in go.GetComponentsInChildren <Renderer>())
            {
                Parkitility.ReplaceWithParkitectMaterial(componentsInChild);
            }

            return(pathAttachment);
        }