コード例 #1
0
ファイル: UMACrowd.cs プロジェクト: grendelbiter/UMA
 public void RandomizeAllDna()
 {
     for (int i = 0; i < transform.childCount; i++)
     {
         var umaData = transform.GetChild(i).GetComponent <UMAData>();
         UMACrowd.RandomizeShape(umaData);
         umaData.Dirty(true, false, false);
     }
 }
コード例 #2
0
ファイル: UMAAssetCollection.cs プロジェクト: CStudios15/UMA
		public virtual void AddToLibraries(OverlayLibraryBase overlayLibrary, SlotLibraryBase slotLibrary, RaceLibraryBase raceLibrary, UMACrowd crowd)
		{
			if (overlayLibrary != null && overlayData.Length > 0)
			{
#if UNITY_EDITOR
				UnityEditor.Undo.RecordObject(overlayLibrary, "Added Asset Collection");
#endif
				for (int i = 0; i < overlayData.Length; i++)
				{
					overlayLibrary.AddOverlay(overlayData[i]);
				}
			}
			if (slotLibrary != null && slotData.Length > 0)
			{
#if UNITY_EDITOR
				UnityEditor.Undo.RecordObject(slotLibrary, "Added Asset Collection");
#endif
				for (int i = 0; i < slotData.Length; i++)
				{
					slotLibrary.AddSlot(slotData[i]);
				}

			}
			if (raceLibrary != null && raceData.Length > 0) 
			{
#if UNITY_EDITOR
				UnityEditor.Undo.RecordObject(raceLibrary, "Added Asset Collection");
#endif
				for (int i = 0; i < raceData.Length; i++)
				{
					raceLibrary.AddRace(raceData[i]);
				}
			}

			if (crowd != null && randomSets.Length > 0)
			{
#if UNITY_EDITOR
				UnityEditor.Undo.RecordObject(crowd, "Added Asset Collection");
#endif
				var newPool = new UMACrowdRandomSet[crowd.randomPool.Length + randomSets.Length];
				Array.Copy(crowd.randomPool, newPool, crowd.randomPool.Length);
				for (int i = 0; i < randomSets.Length; i++)
				{
					newPool[crowd.randomPool.Length + i] = randomSets[i];
				}
			}
		}
コード例 #3
0
ファイル: UMAAssetCollection.cs プロジェクト: hafewa/UMA-1
        public virtual void AddToLibraries(OverlayLibraryBase overlayLibrary, SlotLibraryBase slotLibrary, RaceLibraryBase raceLibrary, UMACrowd crowd)
        {
            if (overlayLibrary != null && overlayData.Length > 0)
            {
#if UNITY_EDITOR
                UnityEditor.Undo.RecordObject(overlayLibrary, "Added Asset Collection");
#endif
                for (int i = 0; i < overlayData.Length; i++)
                {
                    overlayLibrary.AddOverlay(overlayData[i]);
                }
            }
            if (slotLibrary != null && slotData.Length > 0)
            {
#if UNITY_EDITOR
                UnityEditor.Undo.RecordObject(slotLibrary, "Added Asset Collection");
#endif
                for (int i = 0; i < slotData.Length; i++)
                {
                    slotLibrary.AddSlot(slotData[i]);
                }
            }
            if (raceLibrary != null && raceData.Length > 0)
            {
#if UNITY_EDITOR
                UnityEditor.Undo.RecordObject(raceLibrary, "Added Asset Collection");
#endif
                for (int i = 0; i < raceData.Length; i++)
                {
                    raceLibrary.AddRace(raceData[i]);
                }
            }

            if (crowd != null && randomSets.Length > 0)
            {
#if UNITY_EDITOR
                UnityEditor.Undo.RecordObject(crowd, "Added Asset Collection");
#endif
                var newPool = new UMACrowdRandomSet[crowd.randomPool.Length + randomSets.Length];
                Array.Copy(crowd.randomPool, newPool, crowd.randomPool.Length);
                for (int i = 0; i < randomSets.Length; i++)
                {
                    newPool[crowd.randomPool.Length + i] = randomSets[i];
                }
            }
        }
コード例 #4
0
    private void Start()
    {
        panel     = GameObject.Find("Canvas/Panel").transform;
        bodyGO    = panel.FindChild("Body");
        topHeadGO = panel.FindChild("UpperHead");
        lowHeadGO = panel.FindChild("LowerHead");

        /*skinColors = new Color[]{
         *      Color.white,
         *      new Color32(233, 233, 233, 255),
         *      new Color32(211, 211, 211, 255),
         *      new Color32(189, 189, 189, 255),
         *      new Color32(167, 167, 167, 255),
         *      new Color32(145, 145, 145, 255),
         *      new Color32(123, 123, 123, 255),
         *      new Color32(101, 101, 101, 255),
         *      new Color32(079, 079, 079, 255),
         *      new Color32(057, 057, 057, 255),
         * };
         *
         * eyeColors = new Color[]{
         *      new Color32(165, 188, 255, 255),
         *      new Color32(111, 147, 255, 255),
         *      new Color32(122, 088, 045, 255),
         *      new Color32(054, 135, 011, 255),
         *      new Color32(127, 152, 79, 255),
         * };
         *
         * hairColors = new Color[]{
         *      Color.white,
         *      new Color32(255, 246, 172, 255),
         *      new Color32(255, 211, 103, 255),
         *      new Color32(255, 204, 094, 255),
         *      new Color32(191, 061, 039, 255),
         *      new Color32(109, 031, 018, 255),
         *      new Color32(159, 109, 000, 255),
         *      new Color32(086, 048, 000, 255),
         *      new Color32(039, 022, 000, 255),
         *      Color.black,
         * };
         *
         * femaleHairStyles = new string[]{
         *      "FemaleShortHair01",
         *      "FemaleLongHair01",
         * };
         *
         * maleHairStyles = new string[]{
         *      "MaleHair01",
         *      "MaleHair02",
         * };
         *
         * facialHairStyles = new string[,]{
         *      {"",""},
         *      {"MaleBeard01",""},
         *      {"MaleBeard02",""},
         *      {"MaleBeard03",""},
         *      {"MaleBeard01","MaleBeard02"},
         *      {"MaleBeard02","MaleBeard03"},
         *      {"MaleBeard03","MaleBeard01"},
         * };*/

        myCamera    = GameObject.Find("NormalCamera").transform;
        crowdHandle = GameObject.Find("UMACrowd").GetComponent <UMACrowd>();

        sliderControlList  = new Slider[19];
        sliderControlList2 = new Slider[18];
        sliderControlList3 = new Slider[14];

        InitSliders();

        int        randomResult = Random.Range(0, 2);
        GameObject myUma        = crowdHandle.GenerateOneUMA(randomResult);

        myUma.transform.localRotation = Quaternion.Euler(new Vector3(0, 180, 0));
        GetUMAData(myUma);
    }
コード例 #5
0
    private void Start()
    {
        panel = GameObject.Find("Canvas/Panel").transform;
        bodyGO = panel.FindChild("Body");
        topHeadGO = panel.FindChild("UpperHead");
        lowHeadGO = panel.FindChild("LowerHead");

        /*skinColors = new Color[]{
            Color.white,
            new Color32(233, 233, 233, 255),
            new Color32(211, 211, 211, 255),
            new Color32(189, 189, 189, 255),
            new Color32(167, 167, 167, 255),
            new Color32(145, 145, 145, 255),
            new Color32(123, 123, 123, 255),
            new Color32(101, 101, 101, 255),
            new Color32(079, 079, 079, 255),
            new Color32(057, 057, 057, 255),
        };

        eyeColors = new Color[]{
            new Color32(165, 188, 255, 255),
            new Color32(111, 147, 255, 255),
            new Color32(122, 088, 045, 255),
            new Color32(054, 135, 011, 255),
            new Color32(127, 152, 79, 255),
        };

        hairColors = new Color[]{
            Color.white,
            new Color32(255, 246, 172, 255),
            new Color32(255, 211, 103, 255),
            new Color32(255, 204, 094, 255),
            new Color32(191, 061, 039, 255),
            new Color32(109, 031, 018, 255),
            new Color32(159, 109, 000, 255),
            new Color32(086, 048, 000, 255),
            new Color32(039, 022, 000, 255),
            Color.black,
        };

        femaleHairStyles = new string[]{
            "FemaleShortHair01",
            "FemaleLongHair01",
        };

        maleHairStyles = new string[]{
            "MaleHair01",
            "MaleHair02",
        };

        facialHairStyles = new string[,]{
            {"",""},
            {"MaleBeard01",""},
            {"MaleBeard02",""},
            {"MaleBeard03",""},
            {"MaleBeard01","MaleBeard02"},
            {"MaleBeard02","MaleBeard03"},
            {"MaleBeard03","MaleBeard01"},
        };*/

        myCamera = GameObject.Find("NormalCamera").transform;
        crowdHandle = GameObject.Find("UMACrowd").GetComponent<UMACrowd>();

        sliderControlList = new Slider[19];
        sliderControlList2 = new Slider[18];
        sliderControlList3 = new Slider[14];

        InitSliders();

        int randomResult = Random.Range(0, 2);
        GameObject myUma = crowdHandle.GenerateOneUMA(randomResult);
        myUma.transform.localRotation = Quaternion.Euler(new Vector3(0, 180, 0));
        GetUMAData(myUma);
    }
コード例 #6
0
ファイル: TransposeDK2UMA.cs プロジェクト: aliasn456/Folio
 protected virtual void SetUMAData()
 {
     _UMACrowd = GameObject.Find("UMACrowd").GetComponent <UMACrowd>();
     umaData.atlasResolutionScale = _UMACrowd.atlasResolutionScale;
     umaData.OnCharacterUpdated  += myColliderUpdateMethod;
 }