示例#1
0
    private DKOverlayData[] GetOverlayDataArray()
    {
        int arrayCount = m_OverlayDataCount.intValue;

        DKOverlayData[] OverlayDataArray = new DKOverlayData[arrayCount];

        for (int i = 0; i < arrayCount; i++)
        {
            OverlayDataArray[i] = m_Object.FindProperty(string.Format(kArrayData, i)).objectReferenceValue as DKOverlayData;
        }
        return(OverlayDataArray);
    }
示例#2
0
    public DKOverlayData Duplicate()
    {
        DKOverlayData tempOverlay = CreateInstance <DKOverlayData>();

        tempOverlay.overlayName = overlayName;
        tempOverlay.listID      = listID;
        tempOverlay.color       = color;
        tempOverlay.rect        = rect;
        tempOverlay.textureList = new Texture2D[textureList.Length];
        for (int i = 0; i < textureList.Length; i++)
        {
            tempOverlay.textureList[i] = textureList[i];
        }

        return(tempOverlay);
    }
示例#3
0
    public void AddOverlay(string name, DKOverlayData overlay)
    {
        var list = new DKOverlayData[overlayElementList.Length + 1];

        for (int i = 0; i < overlayElementList.Length; i++)
        {
            if (overlayElementList[i].overlayName == name)
            {
                overlayElementList[i] = overlay;
                return;
            }
            list[i] = overlayElementList[i];
        }
        list[list.Length - 1] = overlay;
        overlayElementList    = list;
        overlayDictionary.Add(name, overlay);
    }
示例#4
0
    private void DropAreaGUI(Rect dropArea)
    {
        var evt = Event.current;

        if (evt.type == EventType.DragUpdated)
        {
            if (dropArea.Contains(evt.mousePosition))
            {
                DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
            }
        }

        if (evt.type == EventType.DragPerform)
        {
            if (dropArea.Contains(evt.mousePosition))
            {
                DragAndDrop.AcceptDrag();
                UnityEngine.Object[] draggedObjects = DragAndDrop.objectReferences;
                for (int i = 0; i < draggedObjects.Length; i++)
                {
                    if (draggedObjects[i])
                    {
                        DKOverlayData tempOverlayData = draggedObjects[i] as DKOverlayData;
                        if (tempOverlayData)
                        {
                            AddOverlayData(tempOverlayData);
                            continue;
                        }
                        var path = AssetDatabase.GetAssetPath(draggedObjects[i]);
                        if (System.IO.Directory.Exists(path))
                        {
                            var assetFiles = System.IO.Directory.GetFiles(path, "*.asset");
                            foreach (var assetFile in assetFiles)
                            {
                                tempOverlayData = AssetDatabase.LoadAssetAtPath(assetFile, typeof(DKOverlayData)) as DKOverlayData;
                                if (tempOverlayData)
                                {
                                    AddOverlayData(tempOverlayData);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
示例#5
0
    public void AssigningOverlay(DK_UMACrowd Crowd, int index, DKOverlayData Overlay, string type, bool OverlayOnly, Color color)
    {
        Color ColorToApply = color;

        overlay = Overlay;

        // Assign the Overlay
        try {
            if (type.Contains("Wear"))
            {
                TmpSlotDataList[index].overlayList.Clear();
            }
        }catch (System.NullReferenceException e) { Debug.Log(e); }
        if (!overlay)
        {
            Debug.LogError("Overlay is missing, skipping it.");
        }
        if (!TmpSlotDataList[index]) /*Debug.LogError ( this.transform.parent.name+" Slot is missing, skipping it." );*/ } {
示例#6
0
 public static void PrepareEquipSlotElement(DKSlotData _slot, DKOverlayData overlay, DK_RPG_UMA _DK_RPG_UMA)
 {
     if (_slot)
     {
         // choose overlay
         if (overlay == null && _slot.LinkedOverlayList.Count > 0)
         {
             int ran = Random.Range(0, _slot.LinkedOverlayList.Count);
             _overlay = _slot.LinkedOverlayList[ran];
         }
         else
         {
             _overlay = overlay;
         }
     }
     else if (overlay)
     {
         _slot    = null;
         _overlay = overlay;
         // choose color
         if (_overlay && _overlay.ColorPresets.Count > 0)
         {
             int ran = Random.Range(0, _overlay.ColorPresets.Count - 1);
             _color = _overlay.ColorPresets[ran].PresetColor;
         }
         // if no color overlay, randomise color
         else
         {
             float ran1 = Random.Range(0f, 0.99f);
             float ran2 = Random.Range(0f, 0.99f);
             float ran3 = Random.Range(0f, 0.99f);
             _color = new Color(ran1, ran2, ran3);
         }
     }
     if (_DK_RPG_UMA != null /*&& _color != null*/)
     {
         EquipSlotElement(_slot, _overlay, _DK_RPG_UMA, _color);
     }
 }
示例#7
0
    void SendSlotsToUMA()
    {
        List <SlotData> tmpSlotList = new List <SlotData>();

        for (int i = 0; i < _DK_UMACrowd.tempSlotList.Count; i++)
        {
            DKSlotData dkSlot = _DK_UMACrowd.tempSlotList[i];
            if (dkSlot._UMA != null)
            {
                // find overlays
                List <OverlayData> tmpOverlayList = new List <OverlayData>();
                for (int i1 = 0; i1 < _DK_UMACrowd.tempSlotList[i].overlayList.Count; i1++)
                {
                    DKOverlayData dkOverlay = _DK_UMACrowd.tempSlotList[i].overlayList[i1];
                    if (dkOverlay._UMA != null)
                    {
                        tmpOverlayList.Add(overlayLibrary.InstantiateOverlay(dkOverlay._UMA.overlayName, dkOverlay.color));
                    }
                    else
                    {
                        Debug.LogError("Warning : The DKSlot '" + dkSlot.slotName + "' has the DKOverlay '"
                                       + dkOverlay.overlayName + "' and the UMA Link is missing from it. " +
                                       "Fix it by selecting the concerned DKOverlay and adding the UMA Link.");
                    }
                }

                // add the UMA slot when its overlay tmplist
                tmpSlotList.Add(slotLibrary.InstantiateSlot(dkSlot._UMA.slotName, tmpOverlayList));
            }
            else
            {
                Debug.LogError("Warning : The DKSlot '" + dkSlot.slotName + "' has a missing UMA Link for it. " +
                               "Fix it by selecting the concerned DKSlot and add the UMA Link.");
            }
        }
        // transfert to the UMAData
        DefaultUMA.GetComponent <UMA.UMAData>().umaRecipe.slotDataList = tmpSlotList.ToArray();
    }
示例#8
0
    public static void ChooseBodyOverlay(DKSlotData _slot, DKOverlayData overlay, DK_RPG_UMA _DK_RPG_UMA)
    {
        DKRaceData _Race = _DK_RPG_UMA.RaceData;

        // _Head
        if (_DK_RPG_UMA.Gender == "Male")
        {
            if (overlay == null && _Race._Male._AvatarData._Body._Torso.OverlayList.Count > 0)
            {
                int ran = UnityEngine.Random.Range(0, _Race._Male._AvatarData._Body._Torso.OverlayList.Count);
                overlay = _Race._Male._AvatarData._Body._Torso.OverlayList[ran];
            }
        }
        if (_DK_RPG_UMA.Gender == "Female")
        {
            if (overlay == null && _Race._Female._AvatarData._Body._Torso.OverlayList.Count > 0)
            {
                int ran = UnityEngine.Random.Range(0, _Race._Female._AvatarData._Body._Torso.OverlayList.Count);
                overlay = _Race._Female._AvatarData._Body._Torso.OverlayList[ran];
            }
        }
        _DK_RPG_UMA._Avatar._Body._Torso.Overlay = overlay;
        Rebuild(_DK_RPG_UMA);
    }
示例#9
0
    public void RebuildBody()
    {
        TmpTorsoOverLayList.Add(Crowd.overlayLibrary.InstantiateOverlay(_DK_RPG_UMA._Avatar._Body._Torso.Overlay.overlayName, _DK_RPG_UMA._Avatar.SkinColor));
        if (_DK_RPG_UMA._Avatar._Body._Torso.Tattoo)
        {
            TmpTorsoOverLayList.Add(Crowd.overlayLibrary.InstantiateOverlay(_DK_RPG_UMA._Avatar._Body._Torso.Tattoo.overlayName, _DK_RPG_UMA._Avatar._Body._Torso.TattooColor));
        }
        if (_DK_RPG_UMA._Avatar._Body._Torso.Makeup)
        {
            TmpTorsoOverLayList.Add(Crowd.overlayLibrary.InstantiateOverlay(_DK_RPG_UMA._Avatar._Body._Torso.Makeup.overlayName, _DK_RPG_UMA._Avatar._Body._Torso.MakeupColor));
        }
        if (_DK_RPG_UMA._Avatar._Body._Underwear.Overlay)
        {
            TmpTorsoOverLayList.Add(Crowd.overlayLibrary.InstantiateOverlay(_DK_RPG_UMA._Avatar._Body._Underwear.Overlay.overlayName, _DK_RPG_UMA._Avatar._Body._Underwear.Color));
        }
        if (_DK_RPG_UMA._Equipment._Hands.Slot == null && _DK_RPG_UMA._Equipment._Hands.Overlay != null)
        {
            TmpTorsoOverLayList.Add(Crowd.overlayLibrary.InstantiateOverlay(_DK_RPG_UMA._Equipment._Hands.Overlay.overlayName, _DK_RPG_UMA._Equipment._Hands.Color));
        }
        if (_DK_RPG_UMA._Equipment._Feet.Slot == null && _DK_RPG_UMA._Equipment._Feet.Overlay != null)
        {
            TmpTorsoOverLayList.Add(Crowd.overlayLibrary.InstantiateOverlay(_DK_RPG_UMA._Equipment._Feet.Overlay.overlayName, _DK_RPG_UMA._Equipment._Feet.Color));
        }
        if (_DK_RPG_UMA._Equipment._Torso.Slot == null && _DK_RPG_UMA._Equipment._Torso.Overlay != null)
        {
            TmpTorsoOverLayList.Add(Crowd.overlayLibrary.InstantiateOverlay(_DK_RPG_UMA._Equipment._Torso.Overlay.overlayName, _DK_RPG_UMA._Equipment._Torso.Color));
        }
        if (_DK_RPG_UMA._Equipment._Legs.Slot == null && _DK_RPG_UMA._Equipment._Legs.Overlay != null)
        {
            TmpTorsoOverLayList.Add(Crowd.overlayLibrary.InstantiateOverlay(_DK_RPG_UMA._Equipment._Legs.Overlay.overlayName, _DK_RPG_UMA._Equipment._Legs.Color));
        }

        _DK_RPG_UMA.TmpTorsoOverLayList = TmpTorsoOverLayList;

        // _Hands
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Body._Hands.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Body._Hands.Overlay;
        _Color   = _DK_RPG_UMA._Avatar.SkinColor;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_Hands", _Color);                    // assign the slot and its overlays
        }
        // _Feet
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Body._Feet.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Body._Feet.Overlay;
        _Color   = _DK_RPG_UMA._Avatar.SkinColor;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_Feet", _Color);                     // assign the slot and its overlays
        }
        // _Torso
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Body._Torso.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Body._Torso.Overlay;
        _Color   = _DK_RPG_UMA._Avatar.SkinColor;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_Torso", _Color);                    // assign the slot and its overlays
        }
        // _Legs
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Body._Legs.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Body._Legs.Overlay;
        _Color   = _DK_RPG_UMA._Avatar.SkinColor;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_Legs", _Color);                     // assign the slot and its overlays
        }
        RebuildEquipment();
    }
示例#10
0
    public static void PrepareLists(DK_RPG_UMA_Generator _DK_RPG_UMA_Generator,
                                    DK_RPG_UMA _DK_RPG_UMA,
                                    GameObject _Selection,
                                    string SelectedType,
                                    DKSlotData SelectedSlot,
                                    DKOverlayData SelectedOverlay)
    {
        _DK_RPG_UMA_Generator = GameObject.Find("DK_UMA").GetComponent <DK_RPG_UMA_Generator>();
        if (_DK_RPG_UMA == null)
        {
            if (_DK_RPG_UMA == null)
            {
                _DK_RPG_UMA = _Selection.GetComponent <DK_RPG_UMA>();
            }
            if (_DK_RPG_UMA == null)
            {
                _DK_RPG_UMA = _Selection.GetComponentInChildren <DK_RPG_UMA>();
            }
            if (_DK_RPG_UMA == null)
            {
                _DK_RPG_UMA = _Selection.GetComponentInParent <DK_RPG_UMA>();
            }
        }

        if (_DK_RPG_UMA && _DK_RPG_UMA.RaceData == null)
        {
            DKRaceLibrary races = GameObject.Find("DKUMACrowd").GetComponent <DK_UMACrowd>().raceLibrary;
            foreach (DKRaceData race in races.raceElementList)
            {
                if (race.Race == _DK_RPG_UMA.Race)
                {
                    _DK_RPG_UMA.RaceData = race;
                }
            }
        }

        // Debug.Log (_DK_RPG_UMA.RaceData.raceName);
        if (_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Head.SlotList.Count == 0)
        {
            _DK_RPG_UMA_Generator.PopulateAllLists();
            Debug.Log("test list count :" + _DK_RPG_UMA.RaceData._Male._AvatarData._Face._Head.SlotList.Count);
        }

        #region Face Lists
        if (SelectedType == "Head")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Head.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Head.SlotList);
            }
            OverlayList.Clear();
        }
        else if (SelectedType == "Eyes")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Eyes.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Eyes.SlotList);
            }
            OverlayList.Clear();
        }
        else if (SelectedType == "Eyelash")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._EyeLash.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._EyeLash.SlotList);
            }
            OverlayList.Clear();
        }
        else if (SelectedType == "Eyelids")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._EyeLids.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._EyeLids.SlotList);
            }
            OverlayList.Clear();
        }
        else if (SelectedType == "Ears")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Ears.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Ears.SlotList);
            }
            OverlayList.Clear();
        }
        else if (SelectedType == "Nose")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Nose.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Nose.SlotList);
            }
            OverlayList.Clear();
        }
        else if (SelectedType == "Mouth")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Mouth.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Mouth.SlotList);
            }
            OverlayList.Clear();
        }
        else if (SelectedType == "Eyebrow")
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._FaceHair.EyeBrowsList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._FaceHair.EyeBrowsList);
            }
            SlotList.Clear();
        }
        else if (SelectedType == "Beard" && SelectedSlot)
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._FaceHair._BeardSlotOnly.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._FaceHair._BeardSlotOnly.SlotList);
            }
            OverlayList.Clear();
        }
        else if (SelectedType == "Beard" && SelectedSlot == null && SelectedOverlay)
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._FaceHair._BeardOverlayOnly.BeardList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._FaceHair._BeardOverlayOnly.BeardList);
            }
            SlotList.Clear();
        }
        else if (SelectedType == "Beard" && SelectedSlot == null && SelectedOverlay == null)
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._FaceHair._BeardOverlayOnly.BeardList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._FaceHair._BeardOverlayOnly.BeardList);
            }
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._FaceHair._BeardSlotOnly.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._FaceHair._BeardSlotOnly.SlotList);
            }
        }
        else if (SelectedType == "HeadTatoo")
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Head.TattooList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Head.TattooList);
            }
            SlotList.Clear();
        }
        else if (SelectedType == "HeadMakeup")
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Head.MakeupList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Head.MakeupList);
            }
            SlotList.Clear();
        }
        else if (SelectedType == "Hair" /*&& SelectedSlot*/)
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Hair._SlotOnly.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._AvatarData._Hair._OverlayOnly.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Hair._SlotOnly.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._AvatarData._Hair._OverlayOnly.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Hair._OverlayOnly.OverlayList);
                if (_DK_RPG_UMA.RaceData._Male._AvatarData._Hair._SlotOnly.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Hair._OverlayOnly.OverlayList);
                if (_DK_RPG_UMA.RaceData._Female._AvatarData._Hair._SlotOnly.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }

        /*	else if ( SelectedType == "Hair" && SelectedSlot == null && SelectedOverlay ){
         *              SlotList.Clear();
         *              if ( _DK_RPG_UMA.Gender == "Male" ) {
         *                      SlotList.AddRange (_DK_RPG_UMA.RaceData._Male._AvatarData._Hair._SlotOnly.SlotList);
         *                      if (_DK_RPG_UMA.RaceData._Male._AvatarData._Hair._OverlayOnly.OverlayList.Count == 0 ) OverlayList.Clear();
         *              }
         *              else if ( _DK_RPG_UMA.Gender == "Female" ) {
         *                      SlotList.AddRange (_DK_RPG_UMA.RaceData._Female._AvatarData._Hair._SlotOnly.SlotList);
         *                      if (_DK_RPG_UMA.RaceData._Female._AvatarData._Hair._OverlayOnly.OverlayList.Count == 0 ) OverlayList.Clear();
         *              }
         *              OverlayList.Clear();
         *              if ( _DK_RPG_UMA.Gender == "Male" ) {
         *                      OverlayList.AddRange (_DK_RPG_UMA.RaceData._Male._AvatarData._Hair._OverlayOnly.OverlayList);
         *                      if (_DK_RPG_UMA.RaceData._Male._AvatarData._Hair._SlotOnly.SlotList.Count == 0 ) SlotList.Clear();
         *              }
         *              else if ( _DK_RPG_UMA.Gender == "Female" ) {
         *                      OverlayList.AddRange (_DK_RPG_UMA.RaceData._Female._AvatarData._Hair._OverlayOnly.OverlayList);
         *                      if (_DK_RPG_UMA.RaceData._Female._AvatarData._Hair._SlotOnly.SlotList.Count == 0 ) SlotList.Clear();
         *              }
         *      }*/
        /*	else if ( SelectedType == "Hair" && SelectedSlot == null && SelectedOverlay == null ){
         *      OverlayList.Clear();
         *      if ( _DK_RPG_UMA.Gender == "Male" ) OverlayList.AddRange (_DK_RPG_UMA.RaceData._Male._AvatarData._Hair._OverlayOnly.OverlayList);
         *      else if ( _DK_RPG_UMA.Gender == "Female" ) OverlayList.AddRange (_DK_RPG_UMA.RaceData._Female._AvatarData._Hair._OverlayOnly.OverlayList);
         *      SlotList.Clear();
         *      if ( _DK_RPG_UMA.Gender == "Male" ) SlotList.AddRange (_DK_RPG_UMA.RaceData._Male._AvatarData._Hair._SlotOnly.SlotList);
         *      else if ( _DK_RPG_UMA.Gender == "Female" ) SlotList.AddRange (_DK_RPG_UMA.RaceData._Female._AvatarData._Hair._SlotOnly.SlotList);
         *      Debug.Log (OverlayList.Count);
         * }*/

        else if (SelectedType == "HairModule")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Hair._SlotOnly._HairModule.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Hair._SlotOnly._HairModule.SlotList);
            }
            OverlayList.Clear();
        }
        else if (SelectedType == "Lips")
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Head.LipsList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Head.LipsList);
            }
            SlotList.Clear();
        }
        else if (SelectedType == "Innermouth")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Mouth._InnerMouth.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Mouth._InnerMouth.SlotList);
            }
            OverlayList.Clear();
        }
        #endregion Face Lists

        #region Body Lists
        else if (SelectedType == "Torso")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Torso.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Torso.SlotList);
            }
            OverlayList.Clear();
        }
        else if (SelectedType == "TorsoTatoo")
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Torso.TattooList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Torso.TattooList);
            }
            SlotList.Clear();
        }
        else if (SelectedType == "TorsoMakeup")
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Torso.MakeupList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Torso.MakeupList);
            }
            SlotList.Clear();
        }
        else if (SelectedType == "Hands")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Hands.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Hands.SlotList);
            }
            OverlayList.Clear();
        }
        else if (SelectedType == "HandsTatoo")
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Hands.TattooList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Hands.TattooList);
            }
            SlotList.Clear();
        }
        else if (SelectedType == "HandsMakeup")
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Hands.MakeupList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Hands.MakeupList);
            }
            SlotList.Clear();
        }
        else if (SelectedType == "Legs")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Legs.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Legs.SlotList);
            }
            OverlayList.Clear();
        }
        else if (SelectedType == "LegsTatoo")
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Legs.TattooList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Legs.TattooList);
            }
            SlotList.Clear();
        }
        else if (SelectedType == "LegsMakeup")
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Legs.MakeupList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Legs.MakeupList);
            }
            SlotList.Clear();
        }
        else if (SelectedType == "Feet")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Feet.SlotList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Feet.SlotList);
            }
            OverlayList.Clear();
        }
        else if (SelectedType == "FeetTatoo")
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Feet.TattooList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Feet.TattooList);
            }
            SlotList.Clear();
        }
        else if (SelectedType == "FeetMakeup")
        {
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Feet.MakeupList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Feet.MakeupList);
            }
            SlotList.Clear();
        }
        #endregion Body Lists

        #region Wear Lists
        else if (SelectedType == "HeadWear" /*&& SelectedSlot == null && SelectedOverlay*/)
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Head.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Head.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Head.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Head.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Head.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Head.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Head.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Head.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }
        else if (SelectedType == "ShoulderWear" /*&& SelectedSlot == null && SelectedOverlay*/)
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Shoulder.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Shoulder.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Shoulder.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Shoulder.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Shoulder.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Shoulder.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Shoulder.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Shoulder.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }
        else if (SelectedType == "ArmbandWear" /*&& SelectedSlot == null && SelectedOverlay*/)
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Armband.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Armband.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Armband.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Armband.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Armband.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Armband.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Armband.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Armband.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }
        else if (SelectedType == "WristWear" /*&& SelectedSlot == null && SelectedOverlay*/)
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Wrist.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Wrist.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Wrist.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Wrist.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Wrist.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Wrist.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Wrist.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Wrist.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }
        else if (SelectedType == "CloakWear" /*&& SelectedSlot == null && SelectedOverlay*/)
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Cloak.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Cloak.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Cloak.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Cloak.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
        }

        else if (SelectedType == "TorsoWear" /*&& SelectedSlot == null && SelectedOverlay*/)
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Torso.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Torso.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Torso.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Torso.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Torso.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Torso.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Torso.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Torso.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }
        else if (SelectedType == "HandsWear")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Hands.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Hands.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Hands.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Hands.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Hands.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Hands.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Hands.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Hands.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }
        else if (SelectedType == "LegsWear")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Legs.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Legs.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Legs.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Legs.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Legs.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Legs.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Legs.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Legs.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }
        else if (SelectedType == "FeetWear")
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Feet.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Feet.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Feet.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Feet.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Feet.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Feet.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Feet.OverlayOnlyList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Feet.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }
        else if (SelectedType == "Underwear")
        {
            SlotList.Clear();
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Underwear.OverlayList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Underwear.OverlayList);
            }
        }
        else if (SelectedType == "HandledLeft" /*&& SelectedSlot == null && SelectedOverlay*/)
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._LeftHand.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._LeftHand.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._LeftHand.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._LeftHand.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._LeftHand.OverlayList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._LeftHand.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._LeftHand.OverlayList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._LeftHand.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }
        else if (SelectedType == "HandledRight" /*&& SelectedSlot == null && SelectedOverlay*/)
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._RightHand.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._RightHand.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._RightHand.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._RightHand.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._RightHand.OverlayList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._RightHand.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._RightHand.OverlayList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._RightHand.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }
        else if (SelectedType == "BeltWear" /*&& SelectedSlot == null && SelectedOverlay*/)
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Belt.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Belt.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Belt.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Belt.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Belt.OverlayList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Belt.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Belt.OverlayList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Belt.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }
        else if (SelectedType == "Cloak" /*&& SelectedSlot == null && SelectedOverlay*/)
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Cloak.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Cloak.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Cloak.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Cloak.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Cloak.OverlayList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Cloak.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Cloak.OverlayList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Cloak.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }
        else if (SelectedType == "Backpack" /*&& SelectedSlot == null && SelectedOverlay*/)
        {
            SlotList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Backpack.SlotList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Backpack.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                SlotList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Backpack.SlotList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Backpack.OverlayList.Count == 0)
                {
                    OverlayList.Clear();
                }
            }
            OverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._EquipmentData._Backpack.OverlayList);
                if (_DK_RPG_UMA.RaceData._Male._EquipmentData._Backpack.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                OverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._EquipmentData._Backpack.OverlayList);
                if (_DK_RPG_UMA.RaceData._Female._EquipmentData._Backpack.SlotList.Count == 0)
                {
                    SlotList.Clear();
                }
            }
        }
        #endregion Wear Lists
        PrepareOverlaysLists(_DK_RPG_UMA_Generator,
                             _DK_RPG_UMA,
                             _Selection,
                             SelectedType,
                             SelectedSlot,
                             SelectedOverlay);
    }
示例#11
0
    void OnGUI()
    {
        #region fonts variables
        var bold     = new GUIStyle("label");
        var boldFold = new GUIStyle("foldout");
        bold.fontStyle     = FontStyle.Bold;
        bold.fontSize      = 14;
        boldFold.fontStyle = FontStyle.Bold;
        //	var someMatched = false;

        var Slim = new GUIStyle("label");
        Slim.fontStyle = FontStyle.Normal;
        Slim.fontSize  = 10;

        var style = new GUIStyle("label");
        style.wordWrap = true;

        #endregion fonts variables
        #region choose Places List
        if (Action == "ChoosePlace")
        {
            using (new Horizontal()) {
                GUILayout.Label("choose a Place for the Element", "toolbarbutton", GUILayout.ExpandWidth(true));
                GUI.color = new Color(0.9f, 0.5f, 0.5f);
                if (GUILayout.Button("X", "toolbarbutton", GUILayout.ExpandWidth(false)))
                {
                    Action = "";
                    this.Close();
                }
            }
        }
        GUI.color = Color.white;
        GUILayout.Space(5);
        using (new Horizontal()) {
            GUI.color = Color.white;
            GUILayout.Label("Anatomy Slot Name", "toolbarbutton", GUILayout.Width(140));
            GUILayout.Label("Race", "toolbarbutton", GUILayout.Width(60));
            GUILayout.Label("Gender", "toolbarbutton", GUILayout.Width(55));
            GUILayout.Label("Overlay Type", "toolbarbutton", GUILayout.Width(90));
            GUILayout.Label("", "toolbarbutton", GUILayout.ExpandWidth(true));
        }
        using (new Horizontal()) {
            using (new ScrollView(ref scroll))      {
                SlotsAnatomyLibraryObj = GameObject.Find("DK_SlotsAnatomyLibrary");
                DK_SlotsAnatomyLibrary _SlotsAnatomyLibrary = SlotsAnatomyLibraryObj.GetComponent <DK_SlotsAnatomyLibrary>();

                for (int i = 0; i < _SlotsAnatomyLibrary.dk_SlotsAnatomyElementList.Length; i++)
                {
                    DK_Race DK_Race = _SlotsAnatomyLibrary.dk_SlotsAnatomyElementList[i].GetComponent("DK_Race") as DK_Race;
                    using (new Horizontal(GUILayout.Width(80))) {
                        // Element
                        if (EditorVariables.SelectedElemPlace == _SlotsAnatomyLibrary.dk_SlotsAnatomyElementList[i])
                        {
                            GUI.color = Color.yellow;
                        }
                        else
                        {
                            GUI.color = Color.white;
                        }
                        if (GUILayout.Button(_SlotsAnatomyLibrary.dk_SlotsAnatomyElementList[i].dk_SlotsAnatomyElement.dk_SlotsAnatomyName, "toolbarbutton", GUILayout.Width(140)))
                        {
                            EditorVariables.SelectedElemPlace = _SlotsAnatomyLibrary.dk_SlotsAnatomyElementList[i];
                            DKSlotData SelectedSlotElement = Selection.activeObject as DKSlotData;
                            if (SelectedSlotElement != null)
                            {
                                if (Action == "ChoosePlace")
                                {
                                    SelectedSlotElement.Place = EditorVariables.SelectedElemPlace;
                                }
                            }
                            DKOverlayData SelectedOverlayElement = Selection.activeObject as DKOverlayData;
                            if (SelectedOverlayElement != null)
                            {
                                if (Action == "ChoosePlace")
                                {
                                    SelectedOverlayElement.Place = EditorVariables.SelectedElemPlace;
                                }
                            }

                            EditorUtility.SetDirty(DK_Race.gameObject);
                            AssetDatabase.SaveAssets();
                            this.Close();
                        }
                        // Race
                        if (_SlotsAnatomyLibrary.dk_SlotsAnatomyElementList[i].gameObject.GetComponent <DK_Race>() as DK_Race == null)
                        {
                            _SlotsAnatomyLibrary.dk_SlotsAnatomyElementList[i].gameObject.AddComponent <DK_Race>();
                        }
                        if (DK_Race.Race.Count == 0)
                        {
                            GUI.color = new Color(0.9f, 0.5f, 0.5f);
                        }
                        if (DK_Race.Race.Count == 0 && GUILayout.Button("No Race", Slim, GUILayout.Width(50)))
                        {
                        }
                        GUI.color = new Color(0.8f, 1f, 0.8f, 1);
                        if (DK_Race.Race.Count == 1 && GUILayout.Button(DK_Race.Race[0], Slim, GUILayout.Width(50)))
                        {
                        }
                        if (DK_Race.Race.Count > 1 && GUILayout.Button("Multi", Slim, GUILayout.Width(50)))
                        {
                        }
                        // Gender
                        if (DK_Race.Gender == "")
                        {
                            GUI.color = new Color(0.9f, 0.5f, 0.5f);
                        }
                        if (DK_Race.Gender == "")
                        {
                            GUILayout.Label("N", "Button");
                        }
                        GUI.color = new Color(0.8f, 1f, 0.8f, 1);
                        if (DK_Race.Gender != "" && DK_Race.Gender == "Female")
                        {
                            GUILayout.Label("Female", Slim, GUILayout.Width(50));
                        }
                        if (DK_Race.Gender != "" && DK_Race.Gender == "Male")
                        {
                            GUILayout.Label("Male", Slim, GUILayout.Width(50));
                        }
                        if (DK_Race.Gender != "" && DK_Race.Gender == "Both")
                        {
                            GUILayout.Label("Both", Slim, GUILayout.Width(50));
                        }

                        // OverlayType
                        if (_SlotsAnatomyLibrary.dk_SlotsAnatomyElementList[i].gameObject.GetComponent <DK_Race>() as DK_Race == null)
                        {
                            _SlotsAnatomyLibrary.dk_SlotsAnatomyElementList[i].gameObject.AddComponent <DK_Race>();
                        }
                        DK_Race = _SlotsAnatomyLibrary.dk_SlotsAnatomyElementList[i].GetComponent("DK_Race") as DK_Race;
                        if (DK_Race.OverlayType == "")
                        {
                            GUI.color = new Color(0.9f, 0.5f, 0.5f);
                        }
                        if (DK_Race.OverlayType == "" && GUILayout.Button("No Race", Slim, GUILayout.Width(50)))
                        {
                        }
                        GUI.color = new Color(0.8f, 1f, 0.8f, 1);
                        if (DK_Race.OverlayType != "" && GUILayout.Button(DK_Race.OverlayType, Slim, GUILayout.Width(50)))
                        {
                        }
                    }
                }
            }
        }
        #endregion choose Places List
    }
示例#12
0
    public static void EquipSlotElement(DKSlotData _slot, DKOverlayData _overlay, DK_RPG_UMA _DK_RPG_UMA, Color color)
    {
        // for a slot element
        if (_slot != null)
        {
            #region Equipment
            // find the correct place
            if (_slot.OverlayType == "FeetWear")
            {
                //	Debug.Log ("FeetWear LinkedOverlayList 1");

                _DK_RPG_UMA._Equipment._Feet.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Equipment._Feet.Overlay = _overlay;
                    if (_overlay && _overlay.ColorPresets.Count > 0)
                    {
                        int ran2 = Random.Range(0, _overlay.ColorPresets.Count - 1);
                        color = _overlay.ColorPresets[ran2].PresetColor;
                    }
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        Debug.Log("FeetWear LinkedOverlayList 2");
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Equipment._Feet.Overlay = _slot.LinkedOverlayList[ran];
                        if (_slot.LinkedOverlayList[ran] && _slot.LinkedOverlayList[ran].ColorPresets.Count > 0)
                        {
                            int ran2 = Random.Range(0, _slot.LinkedOverlayList[ran].ColorPresets.Count - 1);
                            color = _slot.LinkedOverlayList[ran].ColorPresets[ran2].PresetColor;
                        }
                    }
                }
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Feet.Color = color;
                }
            }
            else if (_slot.OverlayType == "HandsWear")
            {
                _DK_RPG_UMA._Equipment._Hands.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Equipment._Hands.Overlay = _overlay;
                    if (_overlay && _overlay.ColorPresets.Count > 0)
                    {
                        int ran2 = Random.Range(0, _overlay.ColorPresets.Count - 1);
                        color = _overlay.ColorPresets[ran2].PresetColor;
                    }
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Equipment._Hands.Overlay = _slot.LinkedOverlayList[ran];
                        if (_slot.LinkedOverlayList[ran] && _slot.LinkedOverlayList[ran].ColorPresets.Count > 0)
                        {
                            int ran2 = Random.Range(0, _slot.LinkedOverlayList[ran].ColorPresets.Count - 1);
                            color = _slot.LinkedOverlayList[ran].ColorPresets[ran2].PresetColor;
                        }
                    }
                }
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Hands.Color = color;
                }
            }
            else if (_slot.OverlayType == "HeadWear")
            {
                _DK_RPG_UMA._Equipment._Head.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Equipment._Head.Overlay = _overlay;
                    if (_overlay && _overlay.ColorPresets.Count > 0)
                    {
                        int ran2 = Random.Range(0, _overlay.ColorPresets.Count - 1);
                        color = _overlay.ColorPresets[ran2].PresetColor;
                    }
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Equipment._Head.Overlay = _slot.LinkedOverlayList[ran];
                        if (_slot.LinkedOverlayList[ran] && _slot.LinkedOverlayList[ran].ColorPresets.Count > 0)
                        {
                            int ran2 = Random.Range(0, _slot.LinkedOverlayList[ran].ColorPresets.Count - 1);
                            color = _slot.LinkedOverlayList[ran].ColorPresets[ran2].PresetColor;
                        }
                    }
                }
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Head.Color = color;
                }
            }
            else if (_slot.OverlayType == "LegsWear")
            {
                _DK_RPG_UMA._Equipment._Legs.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Equipment._Legs.Overlay = _overlay;
                    if (_overlay && _overlay.ColorPresets.Count > 0)
                    {
                        int ran2 = Random.Range(0, _overlay.ColorPresets.Count - 1);
                        color = _overlay.ColorPresets[ran2].PresetColor;
                    }
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Equipment._Legs.Overlay = _slot.LinkedOverlayList[ran];
                        if (_slot.LinkedOverlayList[ran] && _slot.LinkedOverlayList[ran].ColorPresets.Count > 0)
                        {
                            int ran2 = Random.Range(0, _slot.LinkedOverlayList[ran].ColorPresets.Count - 1);
                            color = _slot.LinkedOverlayList[ran].ColorPresets[ran2].PresetColor;
                        }
                    }
                }
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Legs.Color = color;
                }
            }
            else if (_slot.OverlayType == "ShoulderWear")
            {
                _DK_RPG_UMA._Equipment._Shoulder.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Equipment._Shoulder.Overlay = _overlay;
                    if (_overlay && _overlay.ColorPresets.Count > 0)
                    {
                        int ran2 = Random.Range(0, _overlay.ColorPresets.Count - 1);
                        color = _overlay.ColorPresets[ran2].PresetColor;
                    }
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Equipment._Shoulder.Overlay = _slot.LinkedOverlayList[ran];
                        if (_slot.LinkedOverlayList[ran] && _slot.LinkedOverlayList[ran].ColorPresets.Count > 0)
                        {
                            int ran2 = Random.Range(0, _slot.LinkedOverlayList[ran].ColorPresets.Count - 1);
                            color = _slot.LinkedOverlayList[ran].ColorPresets[ran2].PresetColor;
                        }
                    }
                }
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Shoulder.Color = color;
                }
            }
            else if (_slot.OverlayType == "TorsoWear")
            {
                _DK_RPG_UMA._Equipment._Torso.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Equipment._Torso.Overlay = _overlay;
                    if (_overlay && _overlay.ColorPresets.Count > 0)
                    {
                        int ran2 = Random.Range(0, _overlay.ColorPresets.Count - 1);
                        color = _overlay.ColorPresets[ran2].PresetColor;
                    }
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Equipment._Torso.Overlay = _slot.LinkedOverlayList[ran];
                        if (_slot.LinkedOverlayList[ran] && _slot.LinkedOverlayList[ran].ColorPresets.Count > 0)
                        {
                            int ran2 = Random.Range(0, _slot.LinkedOverlayList[ran].ColorPresets.Count - 1);
                            color = _slot.LinkedOverlayList[ran].ColorPresets[ran2].PresetColor;
                        }
                    }
                }
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Torso.Color = color;
                }
            }
            else if (_slot.Place.name == "HandledLeft")
            {
                _DK_RPG_UMA._Equipment._LeftHand.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Equipment._LeftHand.Overlay = _overlay;
                    if (_overlay && _overlay.ColorPresets.Count > 0)
                    {
                        int ran2 = Random.Range(0, _overlay.ColorPresets.Count - 1);
                        color = _overlay.ColorPresets[ran2].PresetColor;
                    }
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Equipment._LeftHand.Overlay = _slot.LinkedOverlayList[ran];
                        if (_slot.LinkedOverlayList[ran] && _slot.LinkedOverlayList[ran].ColorPresets.Count > 0)
                        {
                            int ran2 = Random.Range(0, _slot.LinkedOverlayList[ran].ColorPresets.Count - 1);
                            color = _slot.LinkedOverlayList[ran].ColorPresets[ran2].PresetColor;
                        }
                    }
                }
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._LeftHand.Color = color;
                }
            }
            else if (_slot.Place.name == "HandledRight")
            {
                _DK_RPG_UMA._Equipment._RightHand.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Equipment._RightHand.Overlay = _overlay;
                    if (_overlay && _overlay.ColorPresets.Count > 0)
                    {
                        int ran2 = Random.Range(0, _overlay.ColorPresets.Count - 1);
                        color = _overlay.ColorPresets[ran2].PresetColor;
                    }
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Equipment._RightHand.Overlay = _slot.LinkedOverlayList[ran];
                        if (_slot.LinkedOverlayList[ran] && _slot.LinkedOverlayList[ran].ColorPresets.Count > 0)
                        {
                            int ran2 = Random.Range(0, _slot.LinkedOverlayList[ran].ColorPresets.Count - 1);
                            color = _slot.LinkedOverlayList[ran].ColorPresets[ran2].PresetColor;
                        }
                    }
                }
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._RightHand.Color = color;
                }
            }
            else if (_slot.Place.name == "BeltWear")
            {
                _DK_RPG_UMA._Equipment._Belt.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Equipment._Belt.Overlay = _overlay;
                    if (_overlay && _overlay.ColorPresets.Count > 0)
                    {
                        int ran2 = Random.Range(0, _overlay.ColorPresets.Count - 1);
                        color = _overlay.ColorPresets[ran2].PresetColor;
                    }
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Equipment._Belt.Overlay = _slot.LinkedOverlayList[ran];
                        if (_slot.LinkedOverlayList[ran] && _slot.LinkedOverlayList[ran].ColorPresets.Count > 0)
                        {
                            int ran2 = Random.Range(0, _slot.LinkedOverlayList[ran].ColorPresets.Count - 1);
                            color = _slot.LinkedOverlayList[ran].ColorPresets[ran2].PresetColor;
                        }
                    }
                }
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Belt.Color = color;
                }
            }
            else if (_slot.Place.name == "ArmbandWear")
            {
                _DK_RPG_UMA._Equipment._ArmBand.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Equipment._ArmBand.Overlay = _overlay;
                    if (_overlay && _overlay.ColorPresets.Count > 0)
                    {
                        int ran2 = Random.Range(0, _overlay.ColorPresets.Count - 1);
                        color = _overlay.ColorPresets[ran2].PresetColor;
                    }
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Equipment._ArmBand.Overlay = _slot.LinkedOverlayList[ran];
                        if (_slot.LinkedOverlayList[ran] && _slot.LinkedOverlayList[ran].ColorPresets.Count > 0)
                        {
                            int ran2 = Random.Range(0, _slot.LinkedOverlayList[ran].ColorPresets.Count - 1);
                            color = _slot.LinkedOverlayList[ran].ColorPresets[ran2].PresetColor;
                        }
                    }
                }
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._ArmBand.Color = color;
                }
            }
            else if (_slot.Place.name == "WristWear")
            {
                _DK_RPG_UMA._Equipment._Wrist.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Equipment._Wrist.Overlay = _overlay;
                    if (_overlay && _overlay.ColorPresets.Count > 0)
                    {
                        int ran2 = Random.Range(0, _overlay.ColorPresets.Count - 1);
                        color = _overlay.ColorPresets[ran2].PresetColor;
                    }
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Equipment._Wrist.Overlay = _slot.LinkedOverlayList[ran];
                        if (_slot.LinkedOverlayList[ran] && _slot.LinkedOverlayList[ran].ColorPresets.Count > 0)
                        {
                            int ran2 = Random.Range(0, _slot.LinkedOverlayList[ran].ColorPresets.Count - 1);
                            color = _slot.LinkedOverlayList[ran].ColorPresets[ran2].PresetColor;
                        }
                    }
                }
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Wrist.Color = color;
                }
            }
            else if (_slot.Place.name == "CloakWear")
            {
                _DK_RPG_UMA._Equipment._Cloak.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Equipment._Cloak.Overlay = _overlay;
                    if (_overlay && _overlay.ColorPresets.Count > 0)
                    {
                        int ran2 = Random.Range(0, _overlay.ColorPresets.Count - 1);
                        color = _overlay.ColorPresets[ran2].PresetColor;
                    }
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Equipment._Cloak.Overlay = _slot.LinkedOverlayList[ran];
                        if (_slot.LinkedOverlayList[ran] && _slot.LinkedOverlayList[ran].ColorPresets.Count > 0)
                        {
                            int ran2 = Random.Range(0, _slot.LinkedOverlayList[ran].ColorPresets.Count - 1);
                            color = _slot.LinkedOverlayList[ran].ColorPresets[ran2].PresetColor;
                        }
                    }
                }
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Cloak.Color = color;
                }
            }
            else if (_slot.Place.name == "Collar")
            {
                _DK_RPG_UMA._Equipment._Collar.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Equipment._Collar.Overlay = _overlay;
                    if (_overlay && _overlay.ColorPresets.Count > 0)
                    {
                        int ran2 = Random.Range(0, _overlay.ColorPresets.Count - 1);
                        color = _overlay.ColorPresets[ran2].PresetColor;
                    }
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Equipment._Collar.Overlay = _slot.LinkedOverlayList[ran];
                        if (_slot.LinkedOverlayList[ran] && _slot.LinkedOverlayList[ran].ColorPresets.Count > 0)
                        {
                            int ran2 = Random.Range(0, _slot.LinkedOverlayList[ran].ColorPresets.Count - 1);
                            color = _slot.LinkedOverlayList[ran].ColorPresets[ran2].PresetColor;
                        }
                    }
                }
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Collar.Color = color;
                }
            }
            #endregion Equipment
        }
        // for an Overlay element
        else if (_overlay)
        {
            //	Debug.Log ( "test");
            #region Equipment
            if (_overlay.OverlayType == "FeetWear")
            {
                _DK_RPG_UMA._Equipment._Feet.Slot    = null;
                _DK_RPG_UMA._Equipment._Feet.Overlay = _overlay;
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Feet.Color = color;
                }
            }
            else if (_overlay.OverlayType == "HandsWear")
            {
                _DK_RPG_UMA._Equipment._Hands.Slot    = null;
                _DK_RPG_UMA._Equipment._Hands.Overlay = _overlay;
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Hands.Color = color;
                }
            }
            else if (_overlay.OverlayType == "HeadWear")
            {
                _DK_RPG_UMA._Equipment._Head.Slot    = null;
                _DK_RPG_UMA._Equipment._Head.Overlay = _overlay;
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Head.Color = color;
                }
            }
            else if (_overlay.OverlayType == "LegsWear")
            {
                _DK_RPG_UMA._Equipment._Legs.Slot    = null;
                _DK_RPG_UMA._Equipment._Legs.Overlay = _overlay;
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Legs.Color = color;
                }
            }
            else if (_overlay.OverlayType == "TorsoWear")
            {
                _DK_RPG_UMA._Equipment._Torso.Slot    = null;
                _DK_RPG_UMA._Equipment._Torso.Overlay = _overlay;
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Torso.Color = color;
                }
            }
            else if (_overlay.OverlayType == "ArmbandWear")
            {
                _DK_RPG_UMA._Equipment._ArmBand.Slot    = null;
                _DK_RPG_UMA._Equipment._ArmBand.Overlay = _overlay;
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._ArmBand.Color = color;
                }
            }
            else if (_overlay.OverlayType == "WristWear")
            {
                _DK_RPG_UMA._Equipment._Wrist.Slot    = null;
                _DK_RPG_UMA._Equipment._Wrist.Overlay = _overlay;
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Wrist.Color = color;
                }
            }
            else if (_overlay.OverlayType == "CloakWear")
            {
                _DK_RPG_UMA._Equipment._Cloak.Slot    = null;
                _DK_RPG_UMA._Equipment._Cloak.Overlay = _overlay;
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Equipment._Cloak.Color = color;
                }
            }
            else if (_overlay.OverlayType == "Underwear")
            {
                _DK_RPG_UMA._Avatar._Body._Underwear.Slot    = null;
                _DK_RPG_UMA._Avatar._Body._Underwear.Overlay = _overlay;
                if (color != Color.black)
                {
                    _DK_RPG_UMA._Avatar._Body._Underwear.Color = color;
                }
            }
            #endregion Equipment
        }


        DK_RPG_ReBuild _DK_RPG_ReBuild = _DK_RPG_UMA.gameObject.GetComponent <DK_RPG_ReBuild>();
        if (_DK_RPG_ReBuild == null)
        {
            _DK_RPG_ReBuild = _DK_RPG_UMA.gameObject.AddComponent <DK_RPG_ReBuild>();
        }
        DKUMAData _DKUMAData = _DK_RPG_UMA.gameObject.GetComponent <DKUMAData>();
        _DK_RPG_ReBuild.Launch(_DKUMAData);
    }
示例#13
0
    public static void EquipSlotElement(DKSlotData _slot, DKOverlayData _overlay, DK_RPG_UMA _DK_RPG_UMA, Color color)
    {
        // for a slot element
        if (_slot != null)
        {
            if (_slot.Place.name == "Head" && _slot.OverlayType == "Face")
            {
                _DK_RPG_UMA._Avatar._Face._Head.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Face._Head.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Face._Head.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Face._Head.Color = _DK_RPG_UMA._Avatar.SkinColor;
            }
            #region Face
            else if (_slot.Place.name == "Beard" && _slot.OverlayType == "Beard")
            {
                _DK_RPG_UMA._Avatar._Face._FaceHair._BeardSlotOnly.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Face._FaceHair._BeardSlotOnly.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Face._FaceHair._BeardSlotOnly.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Face._FaceHair._BeardSlotOnly.Color = _DK_RPG_UMA._Avatar.HairColor;
            }
            else if (_slot.Place.name == "Eyes" && _slot.slotName.Contains("Adjust") == false)
            {
                _DK_RPG_UMA._Avatar._Face._Eyes.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Face._Eyes.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Face._Eyes.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Face._Eyes.Color = _DK_RPG_UMA._Avatar.EyeColor;
            }
            else if (_slot.Place.name == "Eyelash")
            {
                Debug.Log("Test Eyelash");
                _DK_RPG_UMA._Avatar._Face._EyeLash.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Face._EyeLash.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Face._EyeLash.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Face._EyeLash.Color = _DK_RPG_UMA._Avatar.EyeColor;
            }
            else if (_slot.Place.name == "eyelid" && _slot.OverlayType == "Face")
            {
                _DK_RPG_UMA._Avatar._Face._EyeLids.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Face._EyeLids.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Face._EyeLids.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Face._EyeLids.Color = _DK_RPG_UMA._Avatar.SkinColor;
            }
            else if (_slot.Place.name == "Ears" && _slot.OverlayType == "Face")
            {
                _DK_RPG_UMA._Avatar._Face._Ears.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Face._Ears.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Face._Ears.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Face._Ears.Color = color;
            }
            else if (_slot.Place.name == "Nose" && _slot.OverlayType == "Face")
            {
                _DK_RPG_UMA._Avatar._Face._Nose.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Face._Nose.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Face._Nose.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Face._Nose.Color = _DK_RPG_UMA._Avatar.SkinColor;
            }
            else if (_slot.Place.name == "Mouth" && _slot.OverlayType == "Face")
            {
                _DK_RPG_UMA._Avatar._Face._Mouth.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Face._Mouth.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Face._Mouth.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Face._Mouth.Color = _DK_RPG_UMA._Avatar.SkinColor;
            }
            else if (_slot.Place.name == "InnerMouth" && _slot.OverlayType == "")
            {
                _DK_RPG_UMA._Avatar._Face._Mouth._InnerMouth.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Face._Mouth._InnerMouth.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Face._Mouth._InnerMouth.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                //	_DK_RPG_UMA._Avatar._Face._Mouth._InnerMouth.color = color;
            }
            else if (_slot.Place.name == "Hair" && _slot.OverlayType == "Hair")
            {
                _DK_RPG_UMA._Avatar._Hair._SlotOnly.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Hair._SlotOnly.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Hair._SlotOnly.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Hair._OverlayOnly.Overlay = null;
                _DK_RPG_UMA._Avatar._Hair._SlotOnly.Color      = _DK_RPG_UMA._Avatar.HairColor;
            }
            else if (_slot.Place.name == "Hair_Module" && _slot.OverlayType == "Hair")
            {
                _DK_RPG_UMA._Avatar._Hair._SlotOnly._HairModule.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Hair._SlotOnly._HairModule.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Hair._SlotOnly._HairModule.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Hair._SlotOnly._HairModule.Color = _DK_RPG_UMA._Avatar.HairColor;
            }
            #endregion Face

            #region Body
            else if (_slot.Place.name == "Torso" && _slot.OverlayType == "Flesh")
            {
                _DK_RPG_UMA._Avatar._Body._Torso.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Body._Torso.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Body._Torso.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Body._Torso.Color = _DK_RPG_UMA._Avatar.SkinColor;
            }
            else if (_slot.Place.name == "Hands" && _slot.OverlayType == "Flesh")
            {
                _DK_RPG_UMA._Avatar._Body._Hands.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Body._Hands.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Body._Hands.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Body._Hands.Color = _DK_RPG_UMA._Avatar.SkinColor;
            }
            else if (_slot.Place.name == "Legs" && _slot.OverlayType == "Flesh")
            {
                _DK_RPG_UMA._Avatar._Body._Legs.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Body._Legs.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Body._Legs.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Body._Legs.Color = _DK_RPG_UMA._Avatar.SkinColor;
            }
            else if (_slot.Place.name == "Feet" && _slot.OverlayType == "Flesh")
            {
                _DK_RPG_UMA._Avatar._Body._Feet.Slot = _slot;
                // if the overlay is already assigned
                if (_overlay)
                {
                    _DK_RPG_UMA._Avatar._Body._Feet.Overlay = _overlay;
                }
                // if the overlay is not assigned, random one from the linked overlays of the slot
                else
                {
                    if (_slot.LinkedOverlayList.Count > 0)
                    {
                        int ran = Random.Range(0, _slot.LinkedOverlayList.Count - 1);
                        _DK_RPG_UMA._Avatar._Body._Feet.Overlay = _slot.LinkedOverlayList[ran];
                    }
                }
                _DK_RPG_UMA._Avatar._Body._Feet.Color = _DK_RPG_UMA._Avatar.SkinColor;
            }
            #endregion Body
        }
        // for an Overlay element
        else if (_overlay)
        {
            #region Face
            if (_overlay.OverlayType == "Face" && _overlay.Place.name == "Head")
            {
                _DK_RPG_UMA._Avatar._Face._Head.Overlay = _overlay;
                if (_DK_RPG_UMA._Avatar._Face._Head.Color == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Face._Head.Color = _DK_RPG_UMA._Avatar.SkinColor;
                }
            }
            if (_overlay.OverlayType == "Tatoo" && _overlay.Place.name == "Head")
            {
                _DK_RPG_UMA._Avatar._Face._Head.Tattoo = _overlay;
                if (_DK_RPG_UMA._Avatar._Face._Head.TattooColor == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Face._Head.TattooColor = color;
                }
            }
            if (_overlay.OverlayType == "Makeup" && _overlay.Place.name == "Head")
            {
                _DK_RPG_UMA._Avatar._Face._Head.Makeup = _overlay;
                if (_DK_RPG_UMA._Avatar._Face._Head.MakeupColor == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Face._Head.MakeupColor = color;
                }
            }
            if (_overlay.OverlayType == "Eyebrow")
            {
                _DK_RPG_UMA._Avatar._Face._FaceHair.EyeBrows = _overlay;
                if (_DK_RPG_UMA._Avatar._Face._FaceHair.EyeBrowsColor == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Face._FaceHair.EyeBrowsColor = color;
                }
            }
            else if (_overlay.OverlayType == "Beard")
            {
                _DK_RPG_UMA._Avatar._Face._FaceHair._BeardSlotOnly.Slot      = null;
                _DK_RPG_UMA._Avatar._Face._FaceHair._BeardSlotOnly.Overlay   = null;
                _DK_RPG_UMA._Avatar._Face._FaceHair._BeardOverlayOnly.Beard1 = _overlay;
                if (_DK_RPG_UMA._Avatar._Face._FaceHair._BeardOverlayOnly.Beard1Color == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Face._FaceHair._BeardOverlayOnly.Beard1Color = color;
                }
            }
            else if (_overlay.Place.name == "Eyes" && _overlay.overlayName.Contains("Adjust"))
            {
                _DK_RPG_UMA._Avatar._Face._Eyes.Adjust = _overlay;
                if (_DK_RPG_UMA._Avatar._Face._Eyes.AdjustColor == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Face._Eyes.AdjustColor = color;
                }
            }
            else if (_overlay.Place.name == "Hair" && _overlay.OverlayType == "Hair")
            {
                _DK_RPG_UMA._Avatar._Hair._SlotOnly.Slot       = null;
                _DK_RPG_UMA._Avatar._Hair._SlotOnly.Overlay    = null;
                _DK_RPG_UMA._Avatar._Hair._OverlayOnly.Overlay = _overlay;
                if (_DK_RPG_UMA._Avatar._Hair._OverlayOnly.Color == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Hair._OverlayOnly.Color = color;
                }
            }
            #endregion Face

            #region Body
            else if (_overlay.OverlayType == "Tatoo" && _overlay.Place.name == "Torso")
            {
                _DK_RPG_UMA._Avatar._Body._Torso.Tattoo = _overlay;
                if (_DK_RPG_UMA._Avatar._Body._Torso.TattooColor == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Body._Torso.TattooColor = color;
                }
            }
            else if (_overlay.OverlayType == "Tatoo" && _overlay.Place.name == "Hands")
            {
                _DK_RPG_UMA._Avatar._Body._Hands.Tattoo = _overlay;
                if (_DK_RPG_UMA._Avatar._Body._Hands.TattooColor == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Body._Hands.TattooColor = color;
                }
            }
            else if (_overlay.OverlayType == "Tatoo" && _overlay.Place.name == "Legs")
            {
                _DK_RPG_UMA._Avatar._Body._Legs.Tattoo = _overlay;
                if (_DK_RPG_UMA._Avatar._Body._Hands.TattooColor == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Body._Legs.TattooColor = color;
                }
            }
            else if (_overlay.OverlayType == "Tatoo" && _overlay.Place.name == "Feet")
            {
                _DK_RPG_UMA._Avatar._Body._Feet.Tattoo = _overlay;
                if (_DK_RPG_UMA._Avatar._Body._Feet.TattooColor == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Body._Feet.TattooColor = color;
                }
            }
            else if (_overlay.OverlayType == "Makeup" && _overlay.Place.name == "Torso")
            {
                _DK_RPG_UMA._Avatar._Body._Torso.Makeup = _overlay;
                if (_DK_RPG_UMA._Avatar._Body._Torso.MakeupColor == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Body._Torso.MakeupColor = color;
                }
            }
            else if (_overlay.OverlayType == "Makeup" && _overlay.Place.name == "Hands")
            {
                _DK_RPG_UMA._Avatar._Body._Hands.Makeup = _overlay;
                if (_DK_RPG_UMA._Avatar._Body._Hands.MakeupColor == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Body._Hands.MakeupColor = color;
                }
            }
            else if (_overlay.OverlayType == "Makeup" && _overlay.Place.name == "Legs")
            {
                _DK_RPG_UMA._Avatar._Body._Legs.Makeup = _overlay;
                if (_DK_RPG_UMA._Avatar._Body._Legs.MakeupColor == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Body._Legs.MakeupColor = color;
                }
            }
            else if (_overlay.OverlayType == "Makeup" && _overlay.Place.name == "Feet")
            {
                _DK_RPG_UMA._Avatar._Body._Feet.Makeup = _overlay;
                if (_DK_RPG_UMA._Avatar._Body._Feet.MakeupColor == Color.black)
                {
                    _DK_RPG_UMA._Avatar._Body._Feet.MakeupColor = color;
                }
            }
            #endregion Body
        }
        Rebuild(_DK_RPG_UMA);
    }
示例#14
0
    void OnGUI()
    {
        this.minSize = new Vector2(460, 500);
        #region fonts variables
        var bold     = new GUIStyle("label");
        var boldFold = new GUIStyle("foldout");
        bold.fontStyle     = FontStyle.Bold;
        bold.fontSize      = 14;
        boldFold.fontStyle = FontStyle.Bold;

        var Slim = new GUIStyle("label");
        Slim.fontStyle = FontStyle.Normal;
        Slim.fontSize  = 10;

        var style = new GUIStyle("label");
        style.wordWrap = true;

        #endregion fonts variables

        #region choose Overlay Tab
        Repaint();
        if (Selection.activeObject && Selection.activeObject.GetType().ToString() != "DKSlotData")
        {
            using (new Horizontal()) {
                GUI.color = Color.yellow;
                GUILayout.Label("First you need to select a slot, close this Tab to return to the slots list.", GUILayout.ExpandWidth(false));
                GUI.color = new Color(0.8f, 1f, 0.8f, 1);
            }
            if (GUILayout.Button("Close", "toolbarbutton", GUILayout.ExpandWidth(true)))
            {
                Action = "";
                this.Close();
            }
        }
        // title
        if (Selection.activeObject && Selection.activeObject.GetType().ToString() == "DKSlotData")
        {
            using (new Horizontal()) {
                GUI.color = Color.white;
                GUILayout.Label("Slot information", "toolbarbutton", GUILayout.ExpandWidth(true));
                GUI.color = new Color(0.9f, 0.5f, 0.5f);
                // actions
                if (GUILayout.Button("X", "toolbarbutton", GUILayout.ExpandWidth(false)))
                {
                    Action = "";
                    this.Close();
                }
            }
        }

        if (Selection.activeObject && Selection.activeObject.GetType().ToString() == "DKSlotData")
        {
            DKSlotData _SlotElement = Selection.activeObject as DKSlotData;
            overlayList = _SlotElement.LinkedOverlayList;
            using (new Horizontal()) {
                GUI.color = Color.yellow;
                GUILayout.Label("Slot's Info :", GUILayout.ExpandWidth(false));
                GUI.color = Color.white;
                GUILayout.Label("Gender :", Slim, GUILayout.ExpandWidth(false));
                GUI.color = new Color(0.8f, 1f, 0.8f, 1);
                GUILayout.Label(_SlotElement.Gender, GUILayout.ExpandWidth(false));
                GUI.color = Color.white;
                GUILayout.Label("Overlay Type :", Slim, GUILayout.ExpandWidth(false));
                GUI.color = new Color(0.8f, 1f, 0.8f, 1);
                GUILayout.Label(_SlotElement.OverlayType, GUILayout.ExpandWidth(false));
                if (LinkedOverlayList)
                {
                    GUI.color = new Color(0.8f, 1f, 0.8f, 1);
                }
                else
                {
                    GUI.color = Color.white;
                }
                if (GUILayout.Button("Linked Overlay List", GUILayout.ExpandWidth(true)))
                {
                    if (LinkedOverlayList)
                    {
                        LinkedOverlayList = false;
                    }
                    else
                    {
                        LinkedOverlayList = true;
                    }
                }
            }

            #region Linked Overlay List
            if (Selection.activeObject && LinkedOverlayList && Selection.activeObject.GetType().ToString() == "DKSlotData")
            {
                GUILayout.Space(5);
                using (new Horizontal()) {
                    GUI.color = Color.white;
                    GUILayout.Label("Linked Overlay List", "toolbarbutton", GUILayout.ExpandWidth(true));
                    GUI.color = new Color(0.9f, 0.5f, 0.5f);
                    // actions
                    if (GUILayout.Button("X", "toolbarbutton", GUILayout.ExpandWidth(false)))
                    {
                        LinkedOverlayList = false;
                    }
                }
                if (overlayList.Count == 0)
                {
                    using (new HorizontalCentered()) {
                        GUI.color = Color.yellow;
                        GUILayout.Label("No Linked Overlay in the List.", GUILayout.ExpandWidth(true));
                    }
                }
                else
                {
                    GUI.color = Color.white;
                    using (new Horizontal()) {
                        GUILayout.Label("Linked Overlays", "toolbarbutton", GUILayout.Width(160));
                        GUILayout.Label("Race", "toolbarbutton", GUILayout.Width(70));
                        GUILayout.Label("Gender", "toolbarbutton", GUILayout.Width(70));
                        GUILayout.Label("Place", "toolbarbutton", GUILayout.Width(70));
                        GUILayout.Label("Overlay Type", "toolbarbutton", GUILayout.Width(70));
                        GUILayout.Label("WearWeight", "toolbarbutton", GUILayout.Width(70));
                        GUILayout.Label("", "toolbarbutton", GUILayout.ExpandWidth(true));
                    }
                    GUILayout.BeginScrollView(LinkedOverlayListScroll, GUILayout.ExpandHeight(true));
                    #region Linked Overlays List List

                    for (int i = 0; i < overlayList.Count; i++)
                    {
                        if (overlayList[i] != null)
                        {
                            using (new Horizontal()) {
                                DKOverlayData _DK_Race = overlayList[i];
                                if (_DK_Race.Active == true)
                                {
                                    GUI.color = new Color(0.8f, 1f, 0.8f, 1);
                                }
                                else
                                {
                                    GUI.color = Color.gray;
                                }
                                if (GUILayout.Button("U", "toolbarbutton", GUILayout.Width(20)))
                                {
                                    if (_DK_Race.Active == true)
                                    {
                                        _DK_Race.Active = false;
                                    }
                                    else
                                    {
                                        _DK_Race.Active = true;
                                    }
                                    EditorUtility.SetDirty(_DK_Race);
                                    AssetDatabase.SaveAssets();
                                }
                                GUI.color = Color.white;
                                if (GUILayout.Button(overlayList[i].overlayName, "toolbarbutton", GUILayout.Width(120)))
                                {
                                }
                                GUI.color = new Color(0.9f, 0.5f, 0.5f);
                                if (GUILayout.Button("X ", "toolbarbutton", GUILayout.Width(20)))
                                {
                                    DKOverlayData TmpOv = overlayList[i];
                                    (Selection.activeObject as DKSlotData).overlayList.Remove(TmpOv);
                                    TmpOv.LinkedToSlot.Remove((Selection.activeObject as DKSlotData));
                                    EditorUtility.SetDirty(TmpOv);
                                    EditorUtility.SetDirty(Selection.activeObject);
                                    AssetDatabase.SaveAssets();
                                    overlayList.Remove(TmpOv);
                                }
                                GUI.color = Color.white;
                                string _Race = "No Race";
                                if (overlayList[i].Race.Count == 0)
                                {
                                    //	GUI.color = new Color (0.9f, 0.5f, 0.5f);
                                    _Race = "No Race";
                                }
                                if (overlayList[i].Race.Count > 1)
                                {
                                    GUI.color = Color.cyan;
                                    _Race     = "Multi";
                                }
                                if (overlayList[i].Race.Count == 1)
                                {
                                    GUI.color = Color.white;
                                    _Race     = overlayList[i].Race[0];
                                }
                                if (GUILayout.Button(_Race, "toolbarbutton", GUILayout.Width(70)))
                                {
                                    DK_UMA_Editor.OpenRaceSelectEditor();
                                }
                                GUI.color = Color.white;
                                if (i < overlayList.Count && GUILayout.Button(overlayList[i].Gender, "toolbarbutton", GUILayout.Width(70)))
                                {
                                }
                                if (i < overlayList.Count && overlayList[i].Place && GUILayout.Button(overlayList[i].Place.name, "toolbarbutton", GUILayout.Width(70)))
                                {
                                }
                                if (i < overlayList.Count && GUILayout.Button(overlayList[i].OverlayType, "toolbarbutton", GUILayout.Width(70)))
                                {
                                }
                                if (i < overlayList.Count && GUILayout.Button(overlayList[i].WearWeight, "toolbarbutton", GUILayout.Width(70)))
                                {
                                }
                            }
                        }
                    }
                    #endregion
                    GUILayout.EndScrollView();
                }
            }
            #endregion

            GUILayout.Space(5);
            #region Overlay List
            if (Selection.activeObject.GetType().ToString() == "DKSlotData")
            {
                using (new Horizontal()) {
                    GUI.color = Color.white;
                    GUILayout.Label("Select an Overlay for the Slot", "toolbarbutton", GUILayout.ExpandWidth(true));
                }

                using (new Horizontal()) {
                    GUI.color = Color.white;
                    GUILayout.Label("Selected Overlay :", GUILayout.ExpandWidth(false));
                    if (EditorVariables.SelectedLinkedOvlay != null)
                    {
                        GUI.color = new Color(0.8f, 1f, 0.8f, 1);
                        GUILayout.Label(EditorVariables.SelectedLinkedOvlay.overlayName, GUILayout.ExpandWidth(true));
                        if (GUILayout.Button("Link it", GUILayout.Width(90)))
                        {
                            DKSlotData SelectedSlotElement = Selection.activeObject as DKSlotData;
                            if (SelectedSlotElement != null)
                            {
                                SelectedSlotElement.LinkedOverlayList.Add(EditorVariables.SelectedLinkedOvlay);
                            }
                            DKOverlayData SelectedOverlayElement = EditorVariables.SelectedLinkedOvlay;
                            if (SelectedOverlayElement != null)
                            {
                                SelectedOverlayElement.LinkedToSlot.Add(SelectedSlotElement);
                            }
                            EditorUtility.SetDirty(Selection.activeObject);
                            EditorUtility.SetDirty(EditorVariables.SelectedLinkedOvlay);
                            AssetDatabase.SaveAssets();
                        }
                    }
                    else
                    {
                        GUI.color = Color.yellow;
                        GUILayout.Label("Select an Overlay in the following List.", GUILayout.ExpandWidth(true));
                    }
                }

                using (new Horizontal()) {
                    GUI.color = Color.yellow;
                    GUILayout.Label("Overlay Library :", GUILayout.Width(110));
                    GUI.color = Color.white;
                    GUILayout.TextField(EditorVariables.OverlayLibraryObj.name, GUILayout.ExpandWidth(true));
                    if (GUILayout.Button("Change", GUILayout.Width(60)))
                    {
                        DK_UMA_Editor.OpenLibrariesWindow();
                        ChangeLibrary.CurrentLibN    = EditorVariables.OverlayLibraryObj.name;
                        ChangeLibrary.CurrentLibrary = EditorVariables.OverlayLibraryObj;
                        ChangeLibrary.Action         = "";
                    }
                }
                #region Search
                using (new Horizontal()) {
                    GUI.color = Color.white;
                    GUILayout.Label("Search for :", GUILayout.Width(75));
                    SearchString = GUILayout.TextField(SearchString, 100, GUILayout.ExpandWidth(true));
                }
                #endregion Search

                GUI.color = Color.cyan;
                using (new Horizontal()) {
                    GUILayout.Label("U", "toolbarbutton", GUILayout.Width(20));
                    GUILayout.Label("Overlay", "toolbarbutton", GUILayout.Width(140));
                    //	GUILayout.Label("Race", "toolbarbutton", GUILayout.Width (70));
                    GUILayout.Label("Gender", "toolbarbutton", GUILayout.Width(70));
                    GUILayout.Label("Place", "toolbarbutton", GUILayout.Width(70));
                    GUILayout.Label("Overlay Type", "toolbarbutton", GUILayout.Width(90));
                    GUILayout.Label("WearWeight", "toolbarbutton", GUILayout.Width(70));
                    GUILayout.Label("", "toolbarbutton", GUILayout.ExpandWidth(true));
                }
                using (new ScrollView(ref scroll))
                {
                    #region Overlays
                    using (new Horizontal()) {
                        GUI.color = Color.yellow;
                        GUILayout.Label("Overlays Library :" + EditorVariables._OverlayLibrary.name, GUILayout.ExpandWidth(false));
                    }
                    for (int i = 0; i < EditorVariables._OverlayLibrary.overlayElementList.Length; i++)
                    {
                        if (EditorVariables._OverlayLibrary.overlayElementList[i] != null &&
                            (SearchString == "" ||
                             EditorVariables._OverlayLibrary.overlayElementList[i].overlayName.ToLower().Contains(SearchString.ToLower())))
                        {
                            using (new Horizontal()) {
                                DKOverlayData _DK_Race = EditorVariables._OverlayLibrary.overlayElementList[i];
                                if (_DK_Race.Active == true)
                                {
                                    GUI.color = new Color(0.8f, 1f, 0.8f, 1);
                                }
                                else
                                {
                                    GUI.color = Color.gray;
                                }
                                if (GUILayout.Button("U", "toolbarbutton", GUILayout.Width(20)))
                                {
                                    if (_DK_Race.Active == true)
                                    {
                                        _DK_Race.Active = false;
                                    }
                                    else
                                    {
                                        _DK_Race.Active = true;
                                    }
                                    AssetDatabase.SaveAssets();
                                }

                                //	if ( overlayList.Contains(EditorVariables._OverlayLibrary.overlayElementList[i]) )  GUI.color =  Green;
                                if (overlayList.Contains(EditorVariables._OverlayLibrary.overlayElementList[i]))
                                {
                                    GUI.color = Color.yellow;
                                }
                                else
                                {
                                    GUI.color = Color.white;
                                }
                                if (EditorVariables._OverlayLibrary.overlayElementList[i] == EditorVariables.SelectedLinkedOvlay)
                                {
                                    GUI.color = Green;
                                }

                                if (GUILayout.Button(EditorVariables._OverlayLibrary.overlayElementList[i].overlayName, "toolbarbutton", GUILayout.Width(140)))
                                {
                                    if (overlayList.Contains(EditorVariables._OverlayLibrary.overlayElementList[i]) == false)
                                    {
                                        EditorVariables.SelectedLinkedOvlay = EditorVariables._OverlayLibrary.overlayElementList[i];
                                    }
                                }
                                // Race
                                DKOverlayData DK_Race;
                                DK_Race = EditorVariables._OverlayLibrary.overlayElementList[i];
                                if (overlayList.Contains(EditorVariables._OverlayLibrary.overlayElementList[i]))
                                {
                                    GUI.color = Color.gray;
                                }
                                else
                                {
                                    GUI.color = Color.white;
                                }
                                //	if ( DK_Race.Race.Count == 0 && GUILayout.Button ( "No Race" , "toolbarbutton", GUILayout.Width (70))) {
                                //			EditorVariables.SelectedElemOvlay = EditorVariables._OverlayLibrary.overlayElementList[i];
                                //		}

                                //		if ( overlayList.Contains(EditorVariables._OverlayLibrary.overlayElementList[i]) )  GUI.color =  Color.gray;
                                //		else GUI.color = Color.white;
                                //	if ( DK_Race.Race.Count == 1 && GUILayout.Button ( DK_Race.Race[0] , "toolbarbutton", GUILayout.Width (70))) {
                                //			EditorVariables.SelectedElemOvlay = EditorVariables._OverlayLibrary.overlayElementList[i];
                                //		}
                                //		else
                                //	if ( DK_Race.Race.Count == 1 && GUILayout.Button ( "Multi" , "toolbarbutton", GUILayout.Width (70))) {
                                //			EditorVariables.SelectedElemOvlay = EditorVariables._OverlayLibrary.overlayElementList[i];
                                //		}
                                // Gender
                                if (overlayList.Contains(EditorVariables._OverlayLibrary.overlayElementList[i]) == false)
                                {
                                    GUI.color = Color.gray;
                                }
                                else
                                {
                                    GUI.color = Color.white;
                                }
                                if (DK_Race.Gender == "" && GUILayout.Button("No Gender", "toolbarbutton", GUILayout.Width(70)))
                                {
                                    EditorVariables.SelectedElemOvlay = EditorVariables._OverlayLibrary.overlayElementList[i];
                                }

                                if (overlayList.Contains(EditorVariables._OverlayLibrary.overlayElementList[i]))
                                {
                                    GUI.color = Color.gray;
                                }
                                else
                                {
                                    GUI.color = Color.white;
                                }
                                if (DK_Race.Gender != "" && GUILayout.Button(DK_Race.Gender, "toolbarbutton", GUILayout.Width(70)))
                                {
                                    EditorVariables.SelectedElemOvlay = EditorVariables._OverlayLibrary.overlayElementList[i];
                                }
                                // Place
                                if (overlayList.Contains(EditorVariables._OverlayLibrary.overlayElementList[i]) == false)
                                {
                                    GUI.color = Color.gray;
                                }
                                else
                                {
                                    GUI.color = Color.white;
                                }
                                if (DK_Race.Place == null && GUILayout.Button("No Place", "toolbarbutton", GUILayout.Width(70)))
                                {
                                }

                                if (overlayList.Contains(EditorVariables._OverlayLibrary.overlayElementList[i]))
                                {
                                    GUI.color = Color.gray;
                                }
                                else
                                {
                                    GUI.color = Color.white;
                                }
                                if (DK_Race.Place != null && GUILayout.Button(DK_Race.Place.name, "toolbarbutton", GUILayout.Width(70)))
                                {
                                    EditorVariables.SelectedElemOvlay = EditorVariables._OverlayLibrary.overlayElementList[i];
                                }
                                // Overlay Type
                                if (overlayList.Contains(EditorVariables._OverlayLibrary.overlayElementList[i]) == false)
                                {
                                    GUI.color = Color.gray;
                                }
                                else
                                {
                                    GUI.color = Color.white;
                                }
                                if (DK_Race.OverlayType == "" && GUILayout.Button("No Type", "toolbarbutton", GUILayout.Width(90)))
                                {
                                    EditorVariables.SelectedElemOvlay = EditorVariables._OverlayLibrary.overlayElementList[i];
                                }

                                if (overlayList.Contains(EditorVariables._OverlayLibrary.overlayElementList[i]))
                                {
                                    GUI.color = Color.gray;
                                }
                                else
                                {
                                    GUI.color = Color.white;
                                }
                                if (DK_Race.OverlayType != "" && GUILayout.Button(DK_Race.OverlayType, "toolbarbutton", GUILayout.Width(90)))
                                {
                                    EditorVariables.SelectedElemOvlay = EditorVariables._OverlayLibrary.overlayElementList[i];
                                }
                                // WearWeight
                                GUI.color = Color.gray;
                                if (DK_Race.WearWeight == "")
                                {
                                    //	GUI.color = Color.gray ;
                                    //	GUILayout.Space(55);
                                    //	GUILayout.Label ( "No Weight");
                                }
                                else
                                {
                                    /*	if ( DK_Race.WearWeight != "" ) GUI.color = new Color (0.9f, 0.5f, 0.5f);
                                     *      if ( DK_Race.WearWeight != "" && GUILayout.Button ( "X " , "toolbarbutton", GUILayout.Width (20))) {
                                     *              DK_Race.WearWeight = "";
                                     *              EditorUtility.SetDirty(DK_Race);
                                     *              AssetDatabase.SaveAssets();
                                     *      }*/
                                    GUI.color = Color.white;
                                    GUILayout.Label(DK_Race.WearWeight, "toolbarbutton", GUILayout.Width(70));
                                }
                            }
                        }
                        #endregion
                        #endregion
                    }
                }
            }
            #endregion
        }
    }
示例#15
0
    public static void DetectionAll()
    {
        // slots
        if (EditorVariables.DetSlots)
        {
            DKSlotsList = _DKUMA_Variables.DKSlotsList;
            for (int i0 = 0; i0 < DKSlotsList.Count; i0++)
            {
                if ((EditorVariables.SearchResultsOnly &&
                     DKSlotsList[i0].name.ToLower().Contains(DK_UMA_Editor.SearchString.ToLower())) ||
                    !EditorVariables.SearchResultsOnly)
                {
                    Element = DKSlotsList[i0] as DKSlotData;

                    if (Element.GetType().ToString() == "DKSlotData")
                    {
                        EditorVariables.TmpName = Element.name;
                        DKSlotData _Data = Element as DKSlotData;

                        //	Debug.Log ( "detect gender" );

                        #region Gender
                        if (EditorVariables.DetGender)
                        {
                            if (Element.name.Contains("Female"))
                            {
                                _Data.Gender            = "Female";
                                EditorVariables.TmpName = EditorVariables.TmpName.Replace("Female", "");
                            }
                            else if (Element.name.Contains("female"))
                            {
                                _Data.Gender            = "Female";
                                EditorVariables.TmpName = EditorVariables.TmpName.Replace("female", "");
                            }
                            else if (Element.name.Contains("Male"))
                            {
                                _Data.Gender            = "Male";
                                EditorVariables.TmpName = EditorVariables.TmpName.Replace("Male", "");
                            }
                            else if (Element.name.Contains("male"))
                            {
                                _Data.Gender            = "Male";
                                EditorVariables.TmpName = EditorVariables.TmpName.Replace("male", "");
                            }
                        }
                        #endregion Gender

                        #region races
                        // Add races
                        if (EditorVariables.DetRace)
                        {
                            for (int i = 0; i < EditorVariables.RaceToApplyList.Count; i++)
                            {
                                if (_Data.Race.Contains(EditorVariables.RaceToApplyList[i]) == false)
                                {
                                    _Data.Race.Add(EditorVariables.RaceToApplyList[i]);
                                }
                            }
                        }
                        #endregion races

                        #region Link Detection
                        if (EditorVariables.DetLink)
                        {
                            for (int i2 = 0; i2 < DKOverlaysList.Count; i2++)
                            {
                                //		Debug.Log ( i0+" / "+(DKSlotsList.Count)+" "+DKSlotsList[i0]+" & "+i2 +" / "+DKOverlaysList.Count+" "+DKOverlaysList[i2]);
                                if (DKOverlaysList[i2].name == DKSlotsList[i0].name)
                                {
                                    if (DKOverlaysList[i2].LinkedToSlot.Contains(DKSlotsList[i0]) == false)
                                    {
                                        DKOverlaysList[i2].LinkedToSlot.Add(DKSlotsList[i0]);
                                    }
                                    if (DKSlotsList[i0].overlayList.Contains(DKOverlaysList[i2]) == false)
                                    {
                                        DKSlotsList[i0].overlayList.Add(DKOverlaysList[i2]);
                                    }
                                    EditorUtility.SetDirty(DKSlotsList[i0]);
                                    EditorUtility.SetDirty(DKOverlaysList[i2]);
                                }
                            }
                        }
                        #endregion Link Detection

                        #region Expressions
                        ExpressionLibrary Library = GameObject.Find("Expressions").GetComponent <ExpressionLibrary>();
                        for (int i = 0; i < Library.ExpressionList.Length; i++)
                        {
                            if (EditorVariables.TmpName.Contains(Library.ExpressionList[i].name))
                            {
                                if (EditorVariables.DetOvType)
                                {
                                    _Data.Elem = Library.ExpressionList[i].Elem;
                                }
                                if (EditorVariables.DetOvType)
                                {
                                    _Data.OverlayType = Library.ExpressionList[i].OverlayType;
                                }
                                if (EditorVariables.DetPlace)
                                {
                                    _Data.Place = Library.ExpressionList[i].Place.GetComponent <DK_SlotsAnatomyElement>();
                                }
                                if (EditorVariables.DetWWeight)
                                {
                                    _Data.WearWeight = Library.ExpressionList[i].WearWeight;
                                }
                                if (EditorVariables.DetOvType)
                                {
                                    _Data.Replace                  = Library.ExpressionList[i].Replace;
                                    _Data._HideData.HideMouth      = Library.ExpressionList[i].HideMouth;
                                    _Data._HideData.HideEars       = Library.ExpressionList[i].HideEars;
                                    _Data._HideData.HideBeard      = Library.ExpressionList[i].HideBeard;
                                    _Data._HideData.HideHair       = Library.ExpressionList[i].HideHair;
                                    _Data._HideData.HideHairModule = Library.ExpressionList[i].HideHairModule;
                                }
                            }
                            #endregion Expressions
                        }
                        // finishing
                        EditorUtility.SetDirty(Element);
                    }
                }
            }
            AssetDatabase.SaveAssets();
        }

        if (EditorVariables.DetOverlay)
        {
            DKOverlaysList = _DKUMA_Variables.DKOverlaysList;
            for (int i0 = 0; i0 < DKOverlaysList.Count; i0++)
            {
                if ((EditorVariables.SearchResultsOnly &&
                     DKOverlaysList[i0].name.ToLower().Contains(DK_UMA_Editor.SearchString.ToLower())) ||
                    !EditorVariables.SearchResultsOnly)
                {
                    Element = DKOverlaysList[i0] as DKOverlayData;

                    if (Element.GetType().ToString() == "DKOverlayData")
                    {
                        EditorVariables.TmpName = Element.name;
                        DKOverlayData _Data = Element as DKOverlayData;

                        //	Debug.Log ( "detect gender" );

                        #region Gender
                        if (EditorVariables.DetGender)
                        {
                            if (Element.name.Contains("Female"))
                            {
                                _Data.Gender            = "Female";
                                EditorVariables.TmpName = EditorVariables.TmpName.Replace("Female", "");
                            }
                            else if (Element.name.Contains("female"))
                            {
                                _Data.Gender            = "Female";
                                EditorVariables.TmpName = EditorVariables.TmpName.Replace("female", "");
                            }
                            else if (Element.name.Contains("Male"))
                            {
                                _Data.Gender            = "Male";
                                EditorVariables.TmpName = EditorVariables.TmpName.Replace("Male", "");
                            }
                            else if (Element.name.Contains("male"))
                            {
                                _Data.Gender            = "Male";
                                EditorVariables.TmpName = EditorVariables.TmpName.Replace("male", "");
                            }
                            else
                            {
                                _Data.Gender = "Both";
                            }
                        }
                        #endregion Gender

                        #region races
                        // Add races
                        if (EditorVariables.DetRace)
                        {
                            for (int i = 0; i < EditorVariables.RaceToApplyList.Count; i++)
                            {
                                if (_Data.Race.Contains(EditorVariables.RaceToApplyList[i]) == false)
                                {
                                    _Data.Race.Add(EditorVariables.RaceToApplyList[i]);
                                }
                            }
                        }
                        #endregion races

                        #region Expressions
                        ExpressionLibrary Library = GameObject.Find("Expressions").GetComponent <ExpressionLibrary>();
                        for (int i = 0; i < Library.ExpressionList.Length; i++)
                        {
                            if (EditorVariables.TmpName.Contains(Library.ExpressionList[i].name))
                            {
                                if (EditorVariables.DetOvType)
                                {
                                    _Data.Elem = Library.ExpressionList[i].Elem;
                                }
                                if (EditorVariables.DetOvType)
                                {
                                    _Data.OverlayType = Library.ExpressionList[i].OverlayType;
                                }
                                if (EditorVariables.DetPlace)
                                {
                                    _Data.Place = Library.ExpressionList[i].Place.GetComponent <DK_SlotsAnatomyElement>();
                                }
                                if (EditorVariables.DetWWeight)
                                {
                                    _Data.WearWeight = Library.ExpressionList[i].WearWeight;
                                }
                            }
                        }
                        #endregion Expressions

                        // finishing
                        EditorUtility.SetDirty(Element);
                    }
                }
            }
            AssetDatabase.SaveAssets();
        }
    }
示例#16
0
 public static void PrepareChangeSlotElement(DKSlotData _slot, DKOverlayData overlay, DK_RPG_UMA _DK_RPG_UMA)
 {
     if (_slot)
     {
         // choose overlay
         if (overlay == null && _slot.LinkedOverlayList.Count > 0)
         {
             int ran = Random.Range(0, _slot.LinkedOverlayList.Count);
             _overlay = _slot.LinkedOverlayList[ran];
         }
         // if no linked overlays in the list
         if (overlay != null)
         {
             _overlay = overlay;
         }
         // for face
         else if (_slot.Place.name == "Head" && _slot.OverlayType == "Face")
         {
             ChooseFaceOverlay(_slot, _overlay, _DK_RPG_UMA);
         }
         // for face elements
         else if (_slot.Place.name == "Ears" ||
                  _slot.Place.name == "Nose" ||
                  _slot.Place.name == "Mouth" ||
                  _slot.Place.name == "eyelid")
         {
             if (_DK_RPG_UMA._Avatar._Face._Head.Overlay != null)
             {
                 ChooseFaceOverlay(_slot, _overlay, _DK_RPG_UMA);
             }
             _overlay = _DK_RPG_UMA._Avatar._Face._Head.Overlay;
         }
         // for body
         else if (_slot.Place.name == "Torso" && _slot.OverlayType == "Flesh")
         {
             ChooseBodyOverlay(_slot, _overlay, _DK_RPG_UMA);
         }
         // for face elements
         else if (_slot.Place.name != "Torso" && _slot.OverlayType == "Flesh")
         {
             if (_DK_RPG_UMA._Avatar._Body._Torso.Overlay != null)
             {
                 ChooseBodyOverlay(_slot, _overlay, _DK_RPG_UMA);
             }
             _overlay = _DK_RPG_UMA._Avatar._Body._Torso.Overlay;
         }
     }
     else if (overlay)
     {
         _overlay = overlay;
         // choose color
         if (_overlay && _overlay.ColorPresets.Count > 0)
         {
             int ran = Random.Range(0, _overlay.ColorPresets.Count);
             _color = _overlay.ColorPresets[ran].PresetColor;
         }
         // if no color overlay, randomise color
         else
         {
             float ran1 = Random.Range(0f, 0.99f);
             float ran2 = Random.Range(0f, 0.99f);
             float ran3 = Random.Range(0f, 0.99f);
             _color = new Color(ran1, ran2, ran3);
         }
     }
     if (_overlay != null && _DK_RPG_UMA != null /*&& _color != Color.black*/)
     {
         EquipSlotElement(_slot, _overlay, _DK_RPG_UMA, _color);
     }
 }
示例#17
0
    public override void OnInspectorGUI()
    {
        m_Object.Update();
        serializedObject.Update();

        GUILayout.Label("overlayList", EditorStyles.boldLabel);


        DKOverlayData[] overlayElementList = GetOverlayDataArray();
        GUILayout.Space(30);
        GUILayout.Label("Overlays reduced " + scaleAdjust.intValue + " time(s)");
        GUILayout.BeginHorizontal();

        if (scaleAdjust.intValue > 0)
        {
            if (GUILayout.Button("Resolution +"))
            {
                ScaleUpTextures();

                isDirty   = true;
                canUpdate = false;
                scaleAdjust.intValue--;
            }
        }

        if (GUILayout.Button("Resolution -"))
        {
            ScaleDownTextures();

            isDirty   = true;
            canUpdate = false;
            scaleAdjust.intValue++;
        }


        GUILayout.EndHorizontal();

        GUILayout.Space(20);


        GUILayout.BeginHorizontal();
        compress.boolValue = GUILayout.Toggle(compress.boolValue ? true : false, " Compress Textures");

        readWrite.boolValue = GUILayout.Toggle(readWrite.boolValue ? true : false, " Read/Write");

        if (GUILayout.Button(" Apply"))
        {
            ConfigureTextures();

            isDirty   = true;
            canUpdate = false;
        }

        GUILayout.EndHorizontal();

        GUILayout.Space(20);


        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Order by Name"))
        {
            canUpdate = false;

            List <DKOverlayData> OverlayDataTemp = overlayElementList.ToList();

            //Make sure there's no invalid data
            for (int i = 0; i < OverlayDataTemp.Count; i++)
            {
                if (OverlayDataTemp[i] == null)
                {
                    OverlayDataTemp.RemoveAt(i);
                    i--;
                }
            }

            OverlayDataTemp.Sort((x, y) => x.name.CompareTo(y.name));

            for (int i = 0; i < OverlayDataTemp.Count; i++)
            {
                SetOverlayData(i, OverlayDataTemp[i]);
            }
        }

        if (GUILayout.Button("Update List"))
        {
            isDirty   = true;
            canUpdate = false;
        }
        GUILayout.EndHorizontal();

        GUILayout.Space(20);
        Rect dropArea = GUILayoutUtility.GetRect(0.0f, 50.0f, GUILayout.ExpandWidth(true));

        GUI.Box(dropArea, "Drag Overlays here");
        GUILayout.Space(20);


        for (int i = 0; i < m_OverlayDataCount.intValue; i++)
        {
            GUILayout.BeginHorizontal();

            DKOverlayData result = EditorGUILayout.ObjectField(overlayElementList[i], typeof(DKOverlayData), true) as DKOverlayData;

            if (GUI.changed && canUpdate)
            {
                SetOverlayData(i, result);
            }

            if (GUILayout.Button("-", GUILayout.Width(20.0f)))
            {
                canUpdate = false;
                RemoveOverlayDataAtIndex(i);
            }

            GUILayout.EndHorizontal();

            if (i == m_OverlayDataCount.intValue - 1)
            {
                canUpdate = true;

                if (isDirty)
                {
                    overlayLibrary.UpdateDictionary();
                    isDirty = false;
                }
            }
        }

        DropAreaGUI(dropArea);

        if (GUILayout.Button("Add OverlayData"))
        {
            AddOverlayData(null);
        }

        if (GUILayout.Button("Clear List"))
        {
            m_OverlayDataCount.intValue = 0;
        }


        m_Object.ApplyModifiedProperties();
        serializedObject.ApplyModifiedProperties();
    }
示例#18
0
 private void SetOverlayData(int index, DKOverlayData overlayElement)
 {
     m_Object.FindProperty(string.Format(kArrayData, index)).objectReferenceValue = overlayElement;
     isDirty = true;
 }
示例#19
0
 public void RebuildEquipment()
 {
     // _HeadWear
     _Slot    = null;
     _Overlay = null;
     _Slot    = _DK_RPG_UMA._Equipment._Head.Slot;
     _Overlay = _DK_RPG_UMA._Equipment._Head.Overlay;
     _Color   = _DK_RPG_UMA._Equipment._Head.Color;
     if (_Slot && _Overlay)
     {
         AssigningSlot(Crowd, _Slot, _Overlay, "_HeadWear", _Color);                 // assign the slot and its overlays
     }
     // _TorsoWear
     _Slot    = null;
     _Overlay = null;
     _Slot    = _DK_RPG_UMA._Equipment._Torso.Slot;
     _Overlay = _DK_RPG_UMA._Equipment._Torso.Overlay;
     _Color   = _DK_RPG_UMA._Equipment._Torso.Color;
     if (_Slot && _Overlay)
     {
         AssigningSlot(Crowd, _Slot, _Overlay, "_TorsoWear", _Color);                // assign the slot and its overlays
     }
     // _HandsWear
     _Slot    = null;
     _Overlay = null;
     _Slot    = _DK_RPG_UMA._Equipment._Hands.Slot;
     _Overlay = _DK_RPG_UMA._Equipment._Hands.Overlay;
     _Color   = _DK_RPG_UMA._Equipment._Hands.Color;
     if (_Slot && _Overlay)
     {
         AssigningSlot(Crowd, _Slot, _Overlay, "_HandsWear", _Color);                // assign the slot and its overlays
     }
     // _LegsWear
     _Slot    = null;
     _Overlay = null;
     _Slot    = _DK_RPG_UMA._Equipment._Legs.Slot;
     _Overlay = _DK_RPG_UMA._Equipment._Legs.Overlay;
     _Color   = _DK_RPG_UMA._Equipment._Legs.Color;
     if (_Slot && _Overlay)
     {
         AssigningSlot(Crowd, _Slot, _Overlay, "_LegsWear", _Color);                 // assign the slot and its overlays
     }
     // _FeetWear
     _Slot    = null;
     _Overlay = null;
     _Slot    = _DK_RPG_UMA._Equipment._Feet.Slot;
     _Overlay = _DK_RPG_UMA._Equipment._Feet.Overlay;
     _Color   = _DK_RPG_UMA._Equipment._Feet.Color;
     if (_Slot && _Overlay)
     {
         AssigningSlot(Crowd, _Slot, _Overlay, "_FeetWear", _Color);                 // assign the slot and its overlays
     }
     // _ShoulderWear
     _Slot    = null;
     _Overlay = null;
     _Slot    = _DK_RPG_UMA._Equipment._Shoulder.Slot;
     _Overlay = _DK_RPG_UMA._Equipment._Shoulder.Overlay;
     _Color   = _DK_RPG_UMA._Equipment._Shoulder.Color;
     if (_Slot && _Overlay)
     {
         AssigningSlot(Crowd, _Slot, _Overlay, "_ShoulderWear", _Color);                     // assign the slot and its overlays
     }
     // _BeltWear
     _Slot    = null;
     _Overlay = null;
     _Slot    = _DK_RPG_UMA._Equipment._Belt.Slot;
     _Overlay = _DK_RPG_UMA._Equipment._Belt.Overlay;
     _Color   = _DK_RPG_UMA._Equipment._Belt.Color;
     if (_Slot && _Overlay)
     {
         AssigningSlot(Crowd, _Slot, _Overlay, "_BeltWear", _Color);                 // assign the slot and its overlays
     }
     // _LeftHand
     _Slot    = null;
     _Overlay = null;
     _Slot    = _DK_RPG_UMA._Equipment._LeftHand.Slot;
     _Overlay = _DK_RPG_UMA._Equipment._LeftHand.Overlay;
     _Color   = _DK_RPG_UMA._Equipment._LeftHand.Color;
     if (_Slot && _Overlay)
     {
         AssigningSlot(Crowd, _Slot, _Overlay, "_LeftHand", _Color);                 // assign the slot and its overlays
     }
     // _RightHand
     _Slot    = null;
     _Overlay = null;
     _Slot    = _DK_RPG_UMA._Equipment._RightHand.Slot;
     _Overlay = _DK_RPG_UMA._Equipment._RightHand.Overlay;
     _Color   = _DK_RPG_UMA._Equipment._RightHand.Color;
     if (_Slot && _Overlay)
     {
         AssigningSlot(Crowd, _Slot, _Overlay, "_RightHand", _Color);                // assign the slot and its overlays
     }
     // _ArmBand
     _Slot    = null;
     _Overlay = null;
     _Slot    = _DK_RPG_UMA._Equipment._ArmBand.Slot;
     _Overlay = _DK_RPG_UMA._Equipment._ArmBand.Overlay;
     _Color   = _DK_RPG_UMA._Equipment._ArmBand.Color;
     if (_Slot && _Overlay)
     {
         AssigningSlot(Crowd, _Slot, _Overlay, "_ArmBand", _Color);                  // assign the slot and its overlays
     }
     // _Wrist
     _Slot    = null;
     _Overlay = null;
     _Slot    = _DK_RPG_UMA._Equipment._Wrist.Slot;
     _Overlay = _DK_RPG_UMA._Equipment._Wrist.Overlay;
     _Color   = _DK_RPG_UMA._Equipment._Wrist.Color;
     if (_Slot && _Overlay)
     {
         AssigningSlot(Crowd, _Slot, _Overlay, "_Wrist", _Color);                    // assign the slot and its overlays
     }
     // _Cloak
     _Slot    = null;
     _Overlay = null;
     _Slot    = _DK_RPG_UMA._Equipment._Cloak.Slot;
     _Overlay = _DK_RPG_UMA._Equipment._Cloak.Overlay;
     _Color   = _DK_RPG_UMA._Equipment._Cloak.Color;
     if (_Slot && _Overlay)
     {
         AssigningSlot(Crowd, _Slot, _Overlay, "_Cloak", _Color);                    // assign the slot and its overlays
     }
     Cleaning();
 }
示例#20
0
    public void AssigningSlot(DK_UMACrowd Crowd, DKSlotData slot, DKOverlayData Overlay, string type, Color color)
    {
        //	try{
        if (type == "_EyeLids" || type == "_Nose" || type == "_Mouth" || type == "_Ears")
        {
            if (slot.LinkedOverlayList.Count == 0 &&
                Crowd && Crowd.slotLibrary &&
                slot && slot.slotName != null &&
                TmpSlotDataList[HeadIndex])
            {
                TmpSlotDataList.Add(Crowd.slotLibrary.InstantiateSlot(slot.slotName, TmpSlotDataList[HeadIndex].overlayList));
            }
            else
            {
                int _index = TmpSlotDataList.Count;
                TmpSlotDataList.Add(Crowd.slotLibrary.InstantiateSlot(slot.slotName));
                Overlay = slot.LinkedOverlayList[0];
                AssigningOverlay(Crowd, _index, Overlay, type, false, color);
            }
        }
        else if (type == "_Torso" || type == "_Hands" || type == "_Legs" || type == "_Feet")
        {
            TmpSlotDataList.Add(Crowd.slotLibrary.InstantiateSlot(slot.slotName, TmpTorsoOverLayList));
        }
        else
        {
            int _index = TmpSlotDataList.Count;
            TmpSlotDataList.Add(Crowd.slotLibrary.InstantiateSlot(slot.slotName));
            AssigningOverlay(Crowd, _index, Overlay, type, false, color);
        }
        //	}catch ( System.ArgumentOutOfRangeException ){}
        // Copy the values
        CopyValues(Crowd, slot, TmpSlotDataList.Count - 1);

        // Remove the face elements for a head wear
        if (type == "_HeadWear")
        {
            for (int i1 = 0; i1 < TmpSlotDataList.Count; i1++)
            {
                #region if Hide Hair
                if (slot._HideData.HideHair == true)
                {
                    if (TmpSlotDataList[i1].Place && TmpSlotDataList[i1].Place.name == "Hair")
                    {
                        ToRemoveList.Add(TmpSlotDataList[i1]);
                    }
                }
                #endregion if Hide Hair

                #region if Hide Hair Module
                if (slot._HideData.HideHairModule == true)
                {
                    if (TmpSlotDataList[i1].Place && TmpSlotDataList[i1].Place.name == "Hair_Module")
                    {
                        ToRemoveList.Add(TmpSlotDataList[i1]);
                    }
                }
                #endregion if Hide Hair Module

                #region if Hide Mouth
                if (slot._HideData.HideMouth == true)
                {
                    if (TmpSlotDataList[i1].Place && TmpSlotDataList[i1].Place.name == "Mouth")
                    {
                        ToRemoveList.Add(TmpSlotDataList[i1]);
                    }
                }
                #endregion if Hide Mouth

                #region if Hide Beard
                if (slot._HideData.HideBeard == true)
                {
                    if (TmpSlotDataList[i1].OverlayType == "Beard")
                    {
                        ToRemoveList.Add(TmpSlotDataList[i1]);
                    }
                }
                #endregion if Hide Mouth

                #region if Hide Ears
                if (slot._HideData.HideEars == true)
                {
                    if (TmpSlotDataList[i1].Place && TmpSlotDataList[i1].Place.name == "Ears")
                    {
                        ToRemoveList.Add(TmpSlotDataList[i1]);
                    }
                }
                #endregion if Hide Ears
            }
        }
    }
示例#21
0
    public void RebuildFace()
    {
        // _Head
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Face._Head.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Face._Head.Overlay;
        _Color   = _DK_RPG_UMA._Avatar.SkinColor;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_Head", _Color);                     // assign the slot and its overlays
            _FaceOverlay = _Overlay;
            HeadIndex    = 0;
            _DK_RPG_UMA._Avatar.HeadIndex = HeadIndex;
        }

        // _Eyes
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Face._Eyes.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Face._Eyes.Overlay;
        _Color   = _DK_RPG_UMA._Avatar._Face._Eyes.Color;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_Eyes", _Color);                     // assign the slot and its overlays
        }
        // _EyesAdjust
        _Slot    = null;
        _Overlay = null;
        _Overlay = _DK_RPG_UMA._Avatar._Face._Eyes.Adjust;
        _Color   = _DK_RPG_UMA._Avatar.EyeColor;
        if (_Overlay)
        {
            AssigningOverlay(Crowd, TmpSlotDataList.Count - 1, _Overlay, "_EyesAdjust", true, _Color);                  // assign the slot and its overlays
        }
        // _Ears
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Face._Ears.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Face._Ears.Overlay;
        _Color   = _DK_RPG_UMA._Avatar.SkinColor;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_Ears", _Color);                     // assign the slot and its overlays
        }
        // _Head_Tatoo
        _Overlay = null;
        _Overlay = _DK_RPG_UMA._Avatar._Face._Head.Tattoo;
        _Color   = _DK_RPG_UMA._Avatar._Face._Head.TattooColor;
        if (_Overlay)
        {
            AssigningOverlay(Crowd, HeadIndex, _Overlay, "_Head_Tatoo", true, _Color);                  // assign the slot and its overlays
        }
        // _Head_MakeUp
        _Overlay = null;
        _Overlay = _DK_RPG_UMA._Avatar._Face._Head.Makeup;
        _Color   = _DK_RPG_UMA._Avatar._Face._Head.MakeupColor;
        if (_Overlay)
        {
            AssigningOverlay(Crowd, HeadIndex, _Overlay, "_Head_MakeUp", true, _Color);                 // assign the slot and its overlays
        }
        // _Lips
        _Overlay = null;
        _Overlay = _DK_RPG_UMA._Avatar._Face._Mouth.Lips;
        _Color   = _DK_RPG_UMA._Avatar._Face._Mouth.LipsColor;
        if (_Overlay)
        {
            AssigningOverlay(Crowd, HeadIndex, _Overlay, "_Lips", true, _Color);                // assign the slot and its overlays
        }
        #region _FaceHair
        // _Eyebrow
        _Overlay = null;
        _Overlay = _DK_RPG_UMA._Avatar._Face._FaceHair.EyeBrows;
        _Color   = _DK_RPG_UMA._Avatar._Face._FaceHair.EyeBrowsColor;
        if (_Overlay)
        {
            AssigningOverlay(Crowd, HeadIndex, _Overlay, "_Eyebrow", true, _Color);                     // assign the slot and its overlays
        }
        #region  _BeardOverlayOnly
        // _Beard1
        _Overlay = null;
        _Overlay = _DK_RPG_UMA._Avatar._Face._FaceHair._BeardOverlayOnly.Beard1;
        _Color   = _DK_RPG_UMA._Avatar._Face._FaceHair._BeardOverlayOnly.Beard1Color;
        if (_Overlay)
        {
            AssigningOverlay(Crowd, HeadIndex, _Overlay, "_Beard1", true, _Color);              // assign the slot and its overlays
        }
        // _Beard2
        _Overlay = null;
        _Overlay = _DK_RPG_UMA._Avatar._Face._FaceHair._BeardOverlayOnly.Beard2;
        _Color   = _DK_RPG_UMA._Avatar._Face._FaceHair._BeardOverlayOnly.Beard2Color;
        if (_Overlay)
        {
            AssigningOverlay(Crowd, HeadIndex, _Overlay, "_Beard2", true, _Color);              // assign the slot and its overlays
        }
        // _Beard3
        _Overlay = null;
        _Overlay = _DK_RPG_UMA._Avatar._Face._FaceHair._BeardOverlayOnly.Beard3;
        _Color   = _DK_RPG_UMA._Avatar._Face._FaceHair._BeardOverlayOnly.Beard3Color;
        if (_Overlay)
        {
            AssigningOverlay(Crowd, HeadIndex, _Overlay, "_Beard3", true, _Color);              // assign the slot and its overlays
        }
        #endregion _BeardOverlayOnly

        #region _BeardSlotOnly
        // _BeardSlotOnly
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Face._FaceHair._BeardSlotOnly.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Face._FaceHair._BeardSlotOnly.Overlay;
        _Color   = _DK_RPG_UMA._Avatar._Face._FaceHair._BeardSlotOnly.Color;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_BeardSlotOnly", _Color);                    // assign the slot and its overlays
        }
        #endregion _BeardSlotOnly
        #endregion _FaceHair

        #region Hair
        #region _SlotOnly
        // _HairSlotOnly
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Hair._SlotOnly.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Hair._SlotOnly.Overlay;
        _Color   = _DK_RPG_UMA._Avatar.HairColor;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_HairSlotOnly", _Color);                     // assign the slot and its overlays
        }
        #region _Hair_Module
        // _HairSlotOnlyModule
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Hair._SlotOnly._HairModule.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Hair._SlotOnly._HairModule.Overlay;
        _Color   = _DK_RPG_UMA._Avatar.HairColor;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_HairSlotOnlyModule", _Color);               // assign the slot and its overlays
        }
        #endregion _Hair_Module
        #endregion _SlotOnly

        #region _OverlayOnly
        // _HairOverlayOnly
        _Overlay = null;
        _Overlay = _DK_RPG_UMA._Avatar._Hair._OverlayOnly.Overlay;
        _Color   = _DK_RPG_UMA._Avatar.HairColor;
        if (_Overlay)
        {
            AssigningOverlay(Crowd, HeadIndex, _Overlay, "_HairOverlayOnly", true, _Color);
        }
        #endregion _OverlayOnly
        #endregion Hair

        #region _Face

        // _EyeLash
        _Slot    = null;
        _Overlay = null;

        _Slot    = _DK_RPG_UMA._Avatar._Face._EyeLash.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Face._EyeLash.Overlay;
        _Color   = _DK_RPG_UMA._Avatar._Face._EyeLash.Color;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_EyeLash", _Color);                  // assign the slot and its overlays
        }
        // _EyeLids
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Face._EyeLids.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Face._EyeLids.Overlay;
        _Color   = _DK_RPG_UMA._Avatar.SkinColor;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_EyeLids", _Color);                  // assign the slot and its overlays
        }
        // _Nose
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Face._Nose.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Face._Nose.Overlay;
        _Color   = _DK_RPG_UMA._Avatar.SkinColor;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_Nose", _Color);                     // assign the slot and its overlays
        }
        // _Mouth
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Face._Mouth.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Face._Mouth.Overlay;
        _Overlay = _FaceOverlay;
        _Color   = _DK_RPG_UMA._Avatar.SkinColor;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_Mouth", _Color);                    // assign the slot and its overlays
        }
        // _InnerMouth
        _Slot    = null;
        _Overlay = null;
        _Slot    = _DK_RPG_UMA._Avatar._Face._Mouth._InnerMouth.Slot;
        _Overlay = _DK_RPG_UMA._Avatar._Face._Mouth._InnerMouth.Overlay;
        _Color   = _DK_RPG_UMA._Avatar._Face._Mouth._InnerMouth.color;
        if (_Slot && _Overlay)
        {
            AssigningSlot(Crowd, _Slot, _Overlay, "_InnerMouth", _Color);               // assign the slot and its overlays
        }
        #endregion _Face

        RebuildBody();
    }
示例#22
0
 public static void OnSelectionChange()
 {
     if (Selection.activeObject && DK_UMA_Editor.ShowPrepare)
     {
         if (Selection.activeObject.GetType().ToString() == "DKRaceData" ||
             Selection.activeObject.GetType().ToString() == "DKSlotData" ||
             Selection.activeObject.GetType().ToString() == "DKOverlayData")
         {
             DK_UMA_Editor.SelectedPrefabName = Selection.activeObject.name;
             if (Selection.activeObject.GetType().ToString() == "DKRaceData")
             {
                 DKRaceData SelectedData = (Selection.activeObject as DKRaceData);
                 EditorVariables.SelectedElementName = SelectedData.raceName;
                 DK_UMA_Editor._Name = SelectedData.Race;
                 EditorVariables.SelectedElementGender = SelectedData.Gender;
                 EditorVariables.SelectedElementObj    = Selection.activeObject as GameObject;
             }
             if (Selection.activeObject.GetType().ToString() == "DKSlotData")
             {
                 DKSlotData SelectedData = (Selection.activeObject as DKSlotData);
                 EditorVariables.SelectedElementName        = SelectedData.slotName;
                 EditorVariables.SelectedElementGender      = SelectedData.Gender;
                 EditorVariables.overlayList                = SelectedData.overlayList;
                 EditorVariables.SelectedElementObj         = Selection.activeObject as GameObject;
                 EditorVariables.SelectedElementOverlayType = SelectedData.OverlayType;
                 EditorVariables.SelectedElementWearWeight  = SelectedData.WearWeight;
                 EditorVariables.Replace = SelectedData.Replace;
                 if (SelectedData.Place != null)
                 {
                     EditorVariables.SelectedElemPlace = SelectedData.Place;
                 }
             }
             if (Selection.activeObject.GetType().ToString() == "DKOverlayData")
             {
                 DKOverlayData SelectedData = (Selection.activeObject as DKOverlayData);
                 EditorVariables.SelectedElementName        = SelectedData.overlayName;
                 EditorVariables.SelectedElementGender      = SelectedData.Gender;
                 EditorVariables.SelectedElementObj         = Selection.activeObject as GameObject;
                 EditorVariables.SelectedElementOverlayType = SelectedData.OverlayType;
                 EditorVariables.SelectedElementWearWeight  = SelectedData.WearWeight;
                 if (SelectedData.Place != null)
                 {
                     EditorVariables.SelectedElemPlace = SelectedData.Place;
                 }
             }
         }
     }
     if (DK_UMA_Editor.showModify)
     {
         // colors
         GameObject UMACustomObj = GameObject.Find("DKUMACustomization");
         if (UMACustomObj != null)
         {
             EditorVariables.DK_DKUMACustomization = UMACustomObj.GetComponent <DKUMACustomization>();
             if (Selection.activeGameObject != null)
             {
                 foreach (Transform Child in Selection.activeGameObject.transform)
                 {
                     if (Child.gameObject.GetComponent <DKUMAData>() != null)
                     {
                         EditorVariables.DK_DKUMACustomization.EditedModel = Child;
                         DK_UMA_Editor.EditedModel = Child;
                     }
                 }
             }
         }
     }
     if (Selection.activeGameObject && Selection.activeGameObject.GetComponent <DK_Race>() != null)
     {
         DK_Race _DK_Race = Selection.activeGameObject.GetComponent <DK_Race>();
         DK_UMA_Editor._SpawnPerct = _DK_Race.SpawnPerct.ToString();
     }
     EditorVariables.SelectedElemSlot   = null;
     EditorVariables.SelectedElemOvlay  = null;
     EditorVariables.SelectedElementObj = null;
 }
示例#23
0
	void OnGUI () {
		
		#region fonts variables
		var bold = new GUIStyle ("label");
		var boldFold = new GUIStyle ("foldout");
		bold.fontStyle = FontStyle.Bold;
		bold.fontSize = 14;
		boldFold.fontStyle = FontStyle.Bold;
		var Slim = new GUIStyle ("label");
		Slim.fontStyle = FontStyle.Normal;
		Slim.fontSize = 10;	
		var style = new GUIStyle ("label");
		style.wordWrap = true;
		#endregion fonts variables
		
		using (new Horizontal()) {
			GUILayout.Label ( "Races List", "toolbarbutton", GUILayout.ExpandWidth (true));
		}
		tmpObj = (Selection.activeObject as GameObject);
		if ( Selection.activeObject && Selection.activeObject.GetType().ToString() == "DKRaceData"){ 
			GUI.color = Color.yellow;
			GUILayout.Label ( "Selection is a Race. Select a Slot or an Overlay.", GUILayout.ExpandWidth (false));
		
		}
		GUI.color = Color.white;
		if ( EditorVariables.AutoDetLib == false 
		    && Selection.activeObject
		    && Selection.activeObject.GetType().ToString() != "DKRaceData"
		    && ( Selection.activeObject.GetType().ToString() == "DKSlotData" 
		    || Selection.activeObject.GetType().ToString() == "DKOverlayData"
		    || ( tmpObj && tmpObj.GetComponent<DK_SlotsAnatomyElement>() != null)))
		{
			SelectedElemObj =  ( Selection.activeObject as GameObject);
			using (new Horizontal()) {
				GUILayout.Label ( "Element :", GUILayout.ExpandWidth (false));
				if ( Selection.activeObject.GetType().ToString() == "DKSlotData" ) {
					SelectedElemName = Selection.activeObject.name;
					SelectedElemType = "DKSlotData";
				}
				else
				if ( Selection.activeObject.GetType().ToString() == "DKOverlayData" ) {
					SelectedElemName = Selection.activeObject.name;
					SelectedElemType = "DKOverlayData";
				}
				else{

					if ( tmpObj.GetComponent<DK_SlotsAnatomyElement>() != null ) {
						SelectedElemName = Selection.activeObject.name;
						SelectedElemType = "Anatomy Part";
					}
				}
				GUILayout.Label ( SelectedElemName, GUILayout.Width (120));
				GUILayout.Label ( "Type :", GUILayout.ExpandWidth (false));
				GUILayout.Label ( SelectedElemType, GUILayout.Width (120));
			}
		
			using (new Horizontal()) {
				GUILayout.Label ( "Element's Races List", "toolbarbutton", GUILayout.ExpandWidth (true));
			}
			// Slots Only
			if ( (Selection.activeObject.GetType().ToString() == "DKSlotData")){
				DKSlotData _SlotData = (Selection.activeObject as DKSlotData);
				// clear
				using (new Horizontal()) {
					if ( GUILayout.Button ( "clear Element's list",  GUILayout.ExpandWidth (true))) {
						_SlotData.Race.Clear();
					}
					if ( GUILayout.Button ( "clear Races list", GUILayout.ExpandWidth (true))) {
						RaceDataList.Clear();
					}
					if ( RaceDataList.Count != 0 
						&& _SlotData.Race.Count == 00 
						&& GUILayout.Button ( "Add All", GUILayout.ExpandWidth (true))) 
					{
						if ( RaceDataList.Count != 0 && _SlotData.Race.Count == 00 ) _SlotData.Race = RaceDataList;
					}
				}
				for(int i = 0; i < EditorVariables._RaceLibrary.raceElementList.Length; i ++){
					if ( RaceDataList.Contains(EditorVariables._RaceLibrary.raceElementList[i].Race) ) {
						
						
					}
					else RaceDataList.Add(EditorVariables._RaceLibrary.raceElementList[i].Race);
				}	
				using (new Horizontal()) {
					if (_SlotData.Race.Count > 0 )using (new ScrollView(ref scroll1)) 
					{
							
						for(int i = 0; i < _SlotData.Race.Count; i ++){
							using (new Horizontal()) {
								GUI.color = new Color (0.9f, 0.5f, 0.5f);
								if ( GUILayout.Button ( "X", "toolbarbutton", GUILayout.ExpandWidth (false))) {
									_SlotData.Race.Remove(_SlotData.Race[i]);
									EditorUtility.SetDirty(_SlotData);
									AssetDatabase.SaveAssets();
								}
								GUI.color = Color.white;
								if ( i < _SlotData.Race.Count ) if ( GUILayout.Button ( _SlotData.Race[i], Slim, GUILayout.ExpandWidth (true))) {
									
								}
							}
						}
					}

					if (RaceDataList.Count > 0 )using (new ScrollView(ref scroll)) 
					{
							
						for(int i = 0; i < RaceDataList.Count; i ++){
							using (new Horizontal()) {
								if ( _SlotData.Race.Contains(RaceDataList[i]) ) GUI.color = Color.gray;
								else GUI.color = new Color (0.8f, 1f, 0.8f, 1);
								if ( GUILayout.Button ( "<", "toolbarbutton", GUILayout.ExpandWidth (false))) {
									_SlotData.Race.Add(RaceDataList[i]);
									EditorUtility.SetDirty(_SlotData);
									AssetDatabase.SaveAssets();
								}
								if ( _SlotData.Race.Contains(RaceDataList[i]) ) GUI.color = Color.gray;
								else GUI.color = Color.white;
								if ( GUILayout.Button ( RaceDataList[i], Slim, GUILayout.ExpandWidth (true))) {
									
								}
							}
						}
					}
				}
			}
			// Overlays Only
			if ( (Selection.activeObject.GetType().ToString() == "DKOverlayData")){
				DKOverlayData _DKOverlayData = (Selection.activeObject as DKOverlayData);
				// clear
				using (new Horizontal()) {
					if ( GUILayout.Button ( "clear Element's list",  GUILayout.ExpandWidth (true))) {
						_DKOverlayData.Race.Clear();
					}
					if ( GUILayout.Button ( "clear Races list", GUILayout.ExpandWidth (true))) {
						RaceDataList.Clear();
					}
					if ( RaceDataList.Count != 0 
						&& _DKOverlayData.Race.Count == 00 
						&& GUILayout.Button ( "Add All", GUILayout.ExpandWidth (true))) 
					{
						if ( RaceDataList.Count != 0 && _DKOverlayData.Race.Count == 00 ) _DKOverlayData.Race = RaceDataList;
					}
				}
				for(int i = 0; i < EditorVariables._RaceLibrary.raceElementList.Length; i ++){
					if ( RaceDataList.Contains(EditorVariables._RaceLibrary.raceElementList[i].Race) ) {
						
						
					}
					else
					 RaceDataList.Add(EditorVariables._RaceLibrary.raceElementList[i].Race);
				}	
				using (new Horizontal()) {
					if (_DKOverlayData.Race.Count > 0 )using (new ScrollView(ref scroll1)) 
					{
							
						for(int i = 0; i < _DKOverlayData.Race.Count; i ++){
							using (new Horizontal()) {
								GUI.color = new Color (0.9f, 0.5f, 0.5f);
								if ( GUILayout.Button ( "X", "toolbarbutton", GUILayout.ExpandWidth (false))) {
									_DKOverlayData.Race.Remove(_DKOverlayData.Race[i]);
									EditorUtility.SetDirty(_DKOverlayData);
									AssetDatabase.SaveAssets();
								}
								GUI.color = Color.white;
								if ( i < _DKOverlayData.Race.Count ) if ( GUILayout.Button ( _DKOverlayData.Race[i], Slim, GUILayout.ExpandWidth (true))) {
									
								}
							}
						}
					}
					if (RaceDataList.Count > 0 )using (new ScrollView(ref scroll)) 
					{
							
						for(int i = 0; i < RaceDataList.Count; i ++){
							using (new Horizontal()) {
								if ( _DKOverlayData.Race.Contains(RaceDataList[i]) ) GUI.color = Color.gray;
								else GUI.color = new Color (0.8f, 1f, 0.8f, 1);
								if ( GUILayout.Button ( "<", "toolbarbutton", GUILayout.ExpandWidth (false))) {
									_DKOverlayData.Race.Add(RaceDataList[i]);
									EditorUtility.SetDirty(_DKOverlayData);
									AssetDatabase.SaveAssets();
								}
								if ( _DKOverlayData.Race.Contains(RaceDataList[i]) ) GUI.color = Color.gray;
								else GUI.color = Color.white;
								if ( GUILayout.Button ( RaceDataList[i], Slim, GUILayout.ExpandWidth (true))) {
									
								}
							}
						}
					}
				}
			}
		}
		// Anatomy Only
		if ( EditorVariables.AutoDetLib == false && Selection.activeObject as GameObject && ((Selection.activeObject as GameObject).GetComponent<DK_Race>() != null)){
			DK_Race _DK_Race = (Selection.activeObject as GameObject).GetComponent<DK_Race>();

			// clear
			using (new Horizontal()) {
				if ( GUILayout.Button ( "clear Element's list",  GUILayout.ExpandWidth (true))) {
					_DK_Race.Race.Clear();
				}
				if ( GUILayout.Button ( "clear Races list", GUILayout.ExpandWidth (true))) {
					RaceDataList.Clear();
				}
				if ( RaceDataList.Count != 0 
					&& _DK_Race.Race.Count == 00 
					&& GUILayout.Button ( "Add All", GUILayout.ExpandWidth (true))) 
				{
					if ( RaceDataList.Count != 0 && _DK_Race.Race.Count == 00 ) _DK_Race.Race = RaceDataList;
				}
			}
			for(int i = 0; i < EditorVariables._RaceLibrary.raceElementList.Length; i ++){
				if ( RaceDataList.Contains(EditorVariables._RaceLibrary.raceElementList[i].Race) ) {
					
					
				}
				else
				 RaceDataList.Add(EditorVariables._RaceLibrary.raceElementList[i].Race);
			}	
			using (new Horizontal()) {
				if (_DK_Race.Race.Count > 0 )using (new ScrollView(ref scroll1)) 
				{
						
					for(int i = 0; i < _DK_Race.Race.Count; i ++){
						using (new Horizontal()) {
							GUI.color = new Color (0.9f, 0.5f, 0.5f);
							if ( GUILayout.Button ( "X", "toolbarbutton", GUILayout.ExpandWidth (false))) {
								_DK_Race.Race.Remove(_DK_Race.Race[i]);
								EditorUtility.SetDirty(_DK_Race);
								AssetDatabase.SaveAssets();
							}
							GUI.color = Color.white;
							if ( i < _DK_Race.Race.Count ) if ( GUILayout.Button ( _DK_Race.Race[i], Slim, GUILayout.ExpandWidth (true))) {
								
							}
						}
					}
				}
				if (RaceDataList.Count > 0 )using (new ScrollView(ref scroll)) 
				{
						
					for(int i = 0; i < RaceDataList.Count; i ++){
						using (new Horizontal()) {
							if ( _DK_Race.Race.Contains(RaceDataList[i]) ) GUI.color = Color.gray;
							else GUI.color = new Color (0.8f, 1f, 0.8f, 1);
							if ( GUILayout.Button ( "<", "toolbarbutton", GUILayout.ExpandWidth (false))) {
								_DK_Race.Race.Add(RaceDataList[i]);
								EditorUtility.SetDirty(_DK_Race);
								AssetDatabase.SaveAssets();
							}
							if ( _DK_Race.Race.Contains(RaceDataList[i]) ) GUI.color = Color.gray;
							else GUI.color = Color.white;
							if ( GUILayout.Button ( RaceDataList[i], Slim, GUILayout.ExpandWidth (true))) {
								
							}
						}
					}
				}
			}
		}
		// AutoDetectLib Only
		if ( EditorVariables.AutoDetLib == true ) {
			GUILayout.Label("AutoDetect Process Race's Section", GUILayout.ExpandWidth (true));
			if ( GUILayout.Button ( "Done",  GUILayout.ExpandWidth (true))) {
				EditorVariables.NewRaceName = "";
				for(int i = 0; i < EditorVariables.RaceToApplyList.Count; i ++){
					EditorVariables.NewRaceName = EditorVariables.NewRaceName+" -"+EditorVariables.RaceToApplyList[i];
				}
				this.Close();
			}
			// clear
			try{
			using (new Horizontal()) {
				if ( GUILayout.Button ( "clear Destination's list",  GUILayout.ExpandWidth (true))) {
				EditorVariables.RaceToApplyList.Clear();
				}
				if ( GUILayout.Button ( "clear Races list", GUILayout.ExpandWidth (true))) {
					RaceDataList.Clear();
				}
				if ( RaceDataList.Count != 0 
			 	   && EditorVariables.RaceToApplyList.Count == 00 
				    && GUILayout.Button ( "Add All", GUILayout.ExpandWidth (true))) 
				{
				if ( RaceDataList.Count != 0 && EditorVariables.RaceToApplyList.Count == 00 ) EditorVariables.RaceToApplyList = RaceDataList;
				}
			}
			}catch(ArgumentException){}
			for(int i = 0; i < EditorVariables._RaceLibrary.raceElementList.Length; i ++){
				if ( RaceDataList.Contains(EditorVariables._RaceLibrary.raceElementList[i].Race) ) {
					
				}
				else RaceDataList.Add(EditorVariables._RaceLibrary.raceElementList[i].Race);
			}	
			using (new Horizontal()) {
			
				if (EditorVariables.RaceToApplyList.Count > 0 )using (new ScrollView(ref scroll1)) 
			
				{
					for(int i = 0; i < EditorVariables.RaceToApplyList.Count; i ++){
						using (new Horizontal()) {
							GUI.color = new Color (0.9f, 0.5f, 0.5f);
							if ( GUILayout.Button ( "X", "toolbarbutton", GUILayout.ExpandWidth (false))) {
							EditorVariables.RaceToApplyList.Remove(EditorVariables.RaceToApplyList[i]);

							}
							GUI.color = Color.white;
						if ( i < EditorVariables.RaceToApplyList.Count ) if ( GUILayout.Button ( EditorVariables.RaceToApplyList[i], Slim, GUILayout.ExpandWidth (true))) {
								
							}
						}
					}
				}
				if (RaceDataList.Count > 0 )using (new ScrollView(ref scroll)) 
				{
					for(int i = 0; i < RaceDataList.Count; i ++){
						using (new Horizontal()) {
							if ( EditorVariables.RaceToApplyList.Contains(RaceDataList[i]) ) GUI.color = Color.gray;
							else GUI.color = new Color (0.8f, 1f, 0.8f, 1);
							if ( GUILayout.Button ( "<", "toolbarbutton", GUILayout.ExpandWidth (false))) {
									EditorVariables.RaceToApplyList.Add(RaceDataList[i]);
							}
							if ( EditorVariables.RaceToApplyList.Contains(RaceDataList[i]) ) GUI.color = Color.gray;
							else GUI.color = Color.white;
							if ( GUILayout.Button ( RaceDataList[i], Slim, GUILayout.ExpandWidth (true))) {
							
							}
						}
					}
				}
			}
		}
	}
示例#24
0
 private void AddOverlayData(DKOverlayData overlayElement)
 {
     m_OverlayDataCount.intValue++;
     SetOverlayData(m_OverlayDataCount.intValue - 1, overlayElement);
 }
示例#25
0
    public static void PrepareOverlaysLists(DK_RPG_UMA_Generator _DK_RPG_UMA_Generator,
                                            DK_RPG_UMA _DK_RPG_UMA,
                                            GameObject _Selection,
                                            string SelectedType,
                                            DKSlotData SelectedSlot,
                                            DKOverlayData SelectedOverlay)
    {
        _DK_RPG_UMA_Generator = GameObject.Find("DK_UMA").GetComponent <DK_RPG_UMA_Generator>();
        if (_DK_RPG_UMA == null)
        {
            if (_DK_RPG_UMA == null)
            {
                _DK_RPG_UMA = _Selection.GetComponent <DK_RPG_UMA>();
            }
            if (_DK_RPG_UMA == null)
            {
                _DK_RPG_UMA = _Selection.GetComponentInChildren <DK_RPG_UMA>();
            }
            if (_DK_RPG_UMA == null)
            {
                _DK_RPG_UMA = _Selection.GetComponentInParent <DK_RPG_UMA>();
            }
        }

        if (_DK_RPG_UMA && _DK_RPG_UMA.RaceData == null)
        {
            DKRaceLibrary races = GameObject.Find("DKUMACrowd").GetComponent <DK_UMACrowd>().raceLibrary;
            foreach (DKRaceData race in races.raceElementList)
            {
                if (race.Race == _DK_RPG_UMA.Race)
                {
                    _DK_RPG_UMA.RaceData = race;
                }
            }
        }
        #region Face Lists
        LinkedOverlayList.Clear();
        if (SelectedType == "Head")
        {
            LinkedOverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Head.OverlayList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Head.OverlayList);
            }
        }
        else if (SelectedType == "Eyes")
        {
            LinkedOverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Eyes.OverlayList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Eyes.OverlayList);
            }
        }
        else if (SelectedType == "Eyelash")
        {
            LinkedOverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._EyeLash.OverlayList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._EyeLash.OverlayList);
            }
        }
        else if (SelectedType == "Eyelids")
        {
            LinkedOverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._EyeLids.OverlayList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._EyeLids.OverlayList);
            }
        }
        else if (SelectedType == "Ears")
        {
            LinkedOverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Ears.OverlayList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Ears.OverlayList);
            }
        }
        else if (SelectedType == "Nose")
        {
            LinkedOverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Nose.OverlayList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Nose.OverlayList);
            }
        }
        else if (SelectedType == "Mouth")
        {
            LinkedOverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Mouth.OverlayList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Mouth.OverlayList);
            }
        }
        else if (SelectedType == "Innermouth")
        {
            LinkedOverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Face._Mouth._InnerMouth.OverlayList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Face._Mouth._InnerMouth.OverlayList);
            }
        }
        #endregion Face Lists

        #region Body Lists
        else if (SelectedType == "Torso")
        {
            LinkedOverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Torso.OverlayList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Torso.OverlayList);
            }
        }
        else if (SelectedType == "Hands")
        {
            LinkedOverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Hands.OverlayList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Hands.OverlayList);
            }
        }
        else if (SelectedType == "Legs")
        {
            LinkedOverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Legs.OverlayList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Legs.OverlayList);
            }
        }
        else if (SelectedType == "Feet")
        {
            LinkedOverlayList.Clear();
            if (_DK_RPG_UMA.Gender == "Male")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Male._AvatarData._Body._Feet.OverlayList);
            }
            else if (_DK_RPG_UMA.Gender == "Female")
            {
                LinkedOverlayList.AddRange(_DK_RPG_UMA.RaceData._Female._AvatarData._Body._Feet.OverlayList);
            }
        }
        if (SelectedSlot)
        {
            LinkedOverlayList.AddRange(SelectedSlot.LinkedOverlayList);
        }
        #endregion Body Lists
    }