Example #1
0
    /**
     * Test if prefab can be created with incoming assets.
     * @result Name of prefab file if prefab can be created. null if not.
     */
    public bool CanCreatePrefab(string groupKey, List <UnityEngine.Object> objects, ref PrefabCreateDescription description)
    {
        var go = objects.Find(o => o.GetType() == typeof(UnityEngine.GameObject) &&
                              ((GameObject)o).transform.parent == null);

        if (go != null)
        {
            description.prefabName = GetPrefabName(go.name, groupKey);
        }

        return(go != null);
    }
    /**
     * Test if prefab can be created with incoming assets.
     * @result Name of prefab file if prefab can be created. null if not.
     */
    public bool CanCreatePrefab(string groupKey, List <UnityEngine.Object> objects, ref PrefabCreateDescription description)
    {
        var go = objects.FindAll(o => o.GetType() == typeof(UnityEngine.GameObject) &&
                                 ((GameObject)o).transform.parent == null);

        var isValid = go.Any();

        if (isValid)
        {
            description.prefabName = GetPrefabName(m_replacingObject.Object.name, groupKey);
        }

        return(isValid);
    }
        public bool CanCreatePrefab(string groupKey, List <UnityEngine.Object> objects, ref PrefabCreateDescription description)
        {
            var tex = objects.Find(o => o.GetType() == typeof(UnityEngine.Sprite));

            if (tex != null)
            {
                description.prefabName = $"{groupKey}";
            }

            return(tex != null);
        }