Esempio n. 1
0
    public BaseClothItemEditor(IFbxItem _go, ECharacterResType type)
    {
        resType    = type;
        gameObject = _go.Load <GameObject>();
        if (gameObject.name == CharacterConst.Female)
        {
            baseFold = string.Format("{0}/{1}/{2}/{3}", CharacterConst.prefabPath, resType.ToString(), CharacterConst.Female, CharacterConst.Base);
        }
        else if (gameObject.name == CharacterConst.Male)
        {
            baseFold = string.Format("{0}/{1}/{2}/{3}", CharacterConst.prefabPath, resType.ToString(), CharacterConst.Male, CharacterConst.Base);
        }

        uMaterial = new EditorUmaMaterial_Base();
    }
Esempio n. 2
0
    public EditorClothItem(IObjectBase _obj, IObjectBase diffuse, ECharacterResType type)
    {
        restype = type;
        obj     = _obj;

        texture_diffuse = diffuse;

        Fold = string.Format("{0}/{1}/{2}/{3}", CharacterConst.prefabPath, restype.ToString(), SexName, obj.Name);

        string assetpath = string.Format("{0}/{1}/{2}/{3}/{4}.prefab", CharacterConst.prefabPath, restype.ToString(), SexName, obj.Name, obj.Name);

        prefab = new PrefabItem(assetpath);

        wearpos = obj.Name.Substring(2, 2);
    }
Esempio n. 3
0
    protected override void localLoadRes(object[] objs)
    {
        cm           = objs[0] as ClothModel;
        tempCallback = objs[1] as CallBackWithParams <Object>;

        string sexFold = CharacterConst.Female;

        if (cm.sex == "01")
        {
            sexFold = CharacterConst.Male;
        }
        string prefab = string.Format("{0}/{1}/{2}/{3}", resType.ToString(), sexFold, cm.resname, cm.resname);

        Debug.Log(prefab);
        Object go = Resources.Load <Object>(prefab);

        tempCallback(go);
    }
Esempio n. 4
0
    protected override void localLoadRes(object[] objs)
    {
        tempData     = objs[0] as CharacterData;
        tempcallback = objs[1] as CallBackWithParams <Object>;

        string sexFold = CharacterConst.Female;
        string name    = CharacterConst.Female;

        if (tempData.sex == (int)EnumCharacterType.Charater_Male)
        {
            sexFold = CharacterConst.Male;
            name    = CharacterConst.Male;
        }
        string prefab = string.Format("{0}/{1}/{2}", resType.ToString(), sexFold, name);

        Debug.Log(prefab);
        Object go = Resources.Load <Object>(prefab);

        tempcallback(go);
    }
Esempio n. 5
0
    public OverlayDataAsset CreatOverlay()
    {
        string      fold        = string.Format("{0}/{1}/{2}", baseFold, PartName, UMAUtils.Slot);
        string      texturePath = string.Format("{0}/{1}/{2}/{3}_{4}.png", CharacterConst.rootPath, resType.ToString(), gameObject.name, gameObject.name, PartName);
        string      filename    = string.Format("{0}_{1}", gameObject.name, PartName);
        IObjectBase textureObj  = new ObjectBase(texturePath);
        Texture2D   t           = textureObj.Load <Texture2D>();

        (new CharacterTexture(texturePath)).Handle();

        OverlayEditor    oe  = new OverlayEditor(fold, t, filename, uMaterial);
        OverlayDataAsset oda = oe.CreatOverlay();

        return(oda);
    }
Esempio n. 6
0
    public ClothSlotOverlay(IObjectBase obj, Texture2D _diff, string Fold, EditorUmaMaterial mat, ECharacterResType type)
    {
        GameObject go = obj.Load <GameObject>();

        slotMesh = go.GetComponentInChildren <SkinnedMeshRenderer>();
        if (slotMesh == null)
        {
            throw new Exception(obj.Name + " could't find SkinnedMeshRenderer!!!");
        }

        diff = _diff;

        Material[] ms = slotMesh.sharedMaterials;
        for (int i = 0; i < ms.Length; i++)
        {
            sharedMaterials.Add(ms[i].name);
        }

        slotMesh = go.GetComponentInChildren <SkinnedMeshRenderer>();
        //slotMesh.sharedMaterial = null;
        //slotMesh.sharedMaterials = new Material[0];

        baseName    = go.name;
        slotFold    = Fold + "/" + UMAUtils.Slot;
        overlayFold = Fold + "/" + UMAUtils.Overlay;
        Mat         = mat;

        string comTexturePath = null;

        if (baseName.StartsWith("01"))
        {// male
            comTexturePath = string.Format("{0}/{1}/{2}/{3}_{4}.png", CharacterConst.rootPath, type.ToString(), CharacterConst.Male, CharacterConst.Male, CharacterConst.Common);
        }
        else
        {// female
            comTexturePath = string.Format("{0}/{1}/{2}/{3}_{4}.png", CharacterConst.rootPath, type.ToString(), CharacterConst.Female, CharacterConst.Female, CharacterConst.Common);
        }

        IObjectBase comt = new ObjectBase(comTexturePath);

        comTexture = comt.Load <Texture2D>();
        (new CharacterTexture(comTexturePath)).Handle();

        wearpos = int.Parse(baseName.Substring(2, 2));
    }