Example #1
0
        /**
         *	\brief Finds all decals in the scene that match an image in this decalgroup,
         *	then refreshes the UV coordinate and Material.
         */
        public static void RefreshSceneDecals(DecalGroup dg)
        {
            if (!dg.isPacked)
            {
                Debug.LogWarning("Attempting to RefreshSceneDecals without a packed material");
                return;
            }

            qd_Decal[] sceneDecals = (qd_Decal[])GameObject.FindObjectsOfType(typeof(qd_Decal));

            for (int i = 0; i < dg.decals.Count; i++)
            {
                foreach (qd_Decal decal in sceneDecals)
                {
                    if (dg.decals[i].texture == decal.texture)
                    {
                        decal.GetComponent <MeshRenderer>().sharedMaterial = dg.material;
                        decal.SetUVRect(dg.decals[i].atlasRect);
                    }
                }
            }
        }
Example #2
0
	private static bool EmptyList(DecalGroup grp)
	{
		return grp.decals.Count < 1;
	}