Esempio n. 1
0
    public void EquipItem(DynamicCharacterAvatar avatar, int id)
    {
        ItemHolder item = ItemData.GetItem(id);

        if (item == null || item.GetItemType() != ItemType.EQUIP)
        {
            return;
        }

        // UMAData must not be null, so wait until it is not.
        UMAData umaData = null;

        while (umaData == null)
        {
            umaData = avatar.gameObject.GetComponent <UMAData>();
        }

        bool isMale = avatar.activeRace.name.Equals("HumanMaleDCS");

        switch (item.GetItemSlot())
        {
        case EquipmentItemSlot.HEAD:
            avatar.SetSlot("Helmet", isMale ? item.GetRecipeMale() : item.GetRecipeFemale());
            avatar.BuildCharacter();
            break;

        case EquipmentItemSlot.CHEST:
            avatar.SetSlot("Chest", isMale ? item.GetRecipeMale() : item.GetRecipeFemale());
            avatar.BuildCharacter();
            break;

        case EquipmentItemSlot.LEGS:
            avatar.SetSlot("Legs", isMale ? item.GetRecipeMale() : item.GetRecipeFemale());
            avatar.BuildCharacter();
            break;

        case EquipmentItemSlot.HANDS:
            avatar.SetSlot("Hands", isMale ? item.GetRecipeMale() : item.GetRecipeFemale());
            avatar.BuildCharacter();
            break;

        case EquipmentItemSlot.FEET:
            avatar.SetSlot("Feet", isMale ? item.GetRecipeMale() : item.GetRecipeFemale());
            avatar.BuildCharacter();
            break;

        case EquipmentItemSlot.LEFT_HAND:
            UnEquipItem(avatar, EquipmentItemSlot.LEFT_HAND);
            // Find left hand bone.
            GameObject boneObjL = umaData.GetBoneGameObject("LeftHand");
            // Create the item.
            GameObject newObjL = Instantiate(ItemData.Instance.itemPrefabs[item.GetPrefabId()]);
            newObjL.name = "LeftHandItem";
            newObjL.transform.SetParent(boneObjL.transform, false);
            if (isMale)
            {
                newObjL.transform.localPosition = item.GetPositionMale();
                newObjL.transform.localRotation = item.GetRotationMale();
                newObjL.transform.localScale    = item.GetScaleMale();
            }
            else
            {
                newObjL.transform.localPosition = item.GetPositionFemale();
                newObjL.transform.localRotation = item.GetRotationFemale();
                newObjL.transform.localScale    = item.GetScaleFemale();
            }
            break;

        case EquipmentItemSlot.RIGHT_HAND:
            UnEquipItem(avatar, EquipmentItemSlot.RIGHT_HAND);
            // Find right hand bone.
            GameObject boneObjR = umaData.GetBoneGameObject("RightHand");
            // Create the item.
            GameObject newObjR = Instantiate(ItemData.Instance.itemPrefabs[item.GetPrefabId()]);
            newObjR.name = "RightHandItem";
            newObjR.transform.SetParent(boneObjR.transform, false);
            if (isMale)
            {
                newObjR.transform.localPosition = item.GetPositionMale();
                newObjR.transform.localRotation = item.GetRotationMale();
                newObjR.transform.localScale    = item.GetScaleMale();
            }
            else
            {
                newObjR.transform.localPosition = item.GetPositionFemale();
                newObjR.transform.localRotation = item.GetRotationFemale();
                newObjR.transform.localScale    = item.GetScaleFemale();
            }
            break;

        case EquipmentItemSlot.TWO_HAND:
            UnEquipItem(avatar, EquipmentItemSlot.TWO_HAND);
            // Find right hand bone.
            GameObject boneObjTH = umaData.GetBoneGameObject("RightHand");
            // Create the item.
            GameObject newObjTH = Instantiate(ItemData.Instance.itemPrefabs[item.GetPrefabId()]);
            newObjTH.name = "TwoHandItem";
            boneObjTH.transform.SetParent(boneObjTH.transform, false);
            if (isMale)
            {
                boneObjTH.transform.localPosition = item.GetPositionMale();
                boneObjTH.transform.localRotation = item.GetRotationMale();
                boneObjTH.transform.localScale    = item.GetScaleMale();
            }
            else
            {
                boneObjTH.transform.localPosition = item.GetPositionFemale();
                boneObjTH.transform.localRotation = item.GetRotationFemale();
                boneObjTH.transform.localScale    = item.GetScaleFemale();
            }
            break;
        }
    }
        //This is the save method used by DCA.DoSave and the 'optimized' UMA Menu save options

        /// <summary>
        /// Save the DynamicCharacterAvatar using the optimized DCSPackRecipe model (Not compatible with non-DynamicCharacterAvatars)
        /// </summary>
        /// <param name="dcaToSave"></param>
        /// <param name="recipeName"></param>
        /// <param name="saveOptions">Set the save flags options to choose which properties of the Avatar to save</param>
        public void SaveDCS(DynamicCharacterAvatar dcaToSave, string recipeName, DynamicCharacterAvatar.SaveOptions saveOptions)
        {
            recipeString = JsonUtility.ToJson(new DCSPackRecipe(dcaToSave, recipeName, "DynamicCharacterAvatar", saveOptions));
        }
Esempio n. 3
0
    public IEnumerator CustomizeCharacterAppearance(CharacterDataHolder characterData, DynamicCharacterAvatar newAvatar)
    {
        // Hide avatar until delay ends.
        newAvatar.gameObject.SetActive(false);

        // Unfortunately UMA needs a small delay to initialize.
        yield return(new WaitForSeconds(0.25f));

        // Delay ended. Show avatar.
        newAvatar.gameObject.SetActive(true);

        // Customize character.
        int hairType = characterData.GetHairType();

        if (characterData.GetRace() == 0)
        {
            newAvatar.ChangeRace("HumanMaleDCS");
            if (hairType != 0)
            {
                newAvatar.SetSlot("Hair", hairModelsMale[characterData.GetHairType()]);
            }
        }
        if (characterData.GetRace() == 1)
        {
            newAvatar.ChangeRace("HumanFemaleDCS");
            if (hairType != 0)
            {
                newAvatar.SetSlot("Hair", hairModelsFemale[characterData.GetHairType()]);
            }
        }

        // Set colors.
        newAvatar.SetColor("Hair", Util.IntToColor(characterData.GetHairColor()));
        newAvatar.SetColor("Skin", Util.IntToColor(characterData.GetSkinColor()));
        newAvatar.SetColor("Eyes", Util.IntToColor(characterData.GetEyeColor()));
        newAvatar.UpdateColors(true);

        Dictionary <string, DnaSetter> dna = newAvatar.GetDNA();

        dna["height"].Set(characterData.GetHeight());
        dna["belly"].Set(characterData.GetBelly());
        newAvatar.BuildCharacter(false);

        // Set visible equipable armor items.
        EquipItem(newAvatar, characterData.GetHeadItem());
        EquipItem(newAvatar, characterData.GetChestItem());
        EquipItem(newAvatar, characterData.GetLegsItem());
        EquipItem(newAvatar, characterData.GetHandsItem());
        EquipItem(newAvatar, characterData.GetFeetItem());

        // Without this delay, sometimes, we cannot not see mounted weapons.
        yield return(new WaitForSeconds(0.25f));

        // Set visible equipable left and right hand items.
        EquipItem(newAvatar, characterData.GetLeftHandItem());
        EquipItem(newAvatar, characterData.GetRightHandItem());
    }
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            OverlayColorData       ocd = null;
            DynamicCharacterAvatar dca = property.serializedObject.targetObject as DynamicCharacterAvatar;

            if (dca != null)
            {
                string Name = property.FindPropertyRelative("name").stringValue;
                foreach (OverlayColorData o in dca.characterColors._colors)
                {
                    if (o.name == Name)
                    {
                        ocd = o;
                    }
                }
            }

            EditorGUI.BeginProperty(position, label, property);
            var name     = property.FindPropertyRelative("name");
            var mask     = property.FindPropertyRelative("channelMask");
            var additive = property.FindPropertyRelative("channelAdditiveMask");

            EditorGUILayout.BeginHorizontal();
            name.isExpanded = EditorGUILayout.Foldout(name.isExpanded, label);
            if (!name.isExpanded)
            {
                name.stringValue = EditorGUILayout.TextField(new GUIContent(""), name.stringValue);
            }
            EditorGUILayout.EndHorizontal();
            if (name.isExpanded)
            {
                EditorGUILayout.PropertyField(property.FindPropertyRelative("name"));

                if (ocd != null)
                {
                    string Name         = property.FindPropertyRelative("name").stringValue;
                    int    ChannelCount = EditorGUILayout.IntSlider(Channels, ocd.channelCount, 1, 8);
                    if (ChannelCount != ocd.channelCount)
                    {
                        ocd.SetChannels(ChannelCount);
                        EditorUtility.SetDirty(dca);
                    }
                }

                showAdvanced = EditorGUILayout.Toggle("Show Extended Ranges", showAdvanced);

                GUILayout.Space(5);

                for (int i = 0; i < mask.arraySize; i++)
                {
                    if (showAdvanced)
                    {
                        var channelMask     = mask.GetArrayElementAtIndex(i);
                        var channelColor    = ToVector4(channelMask.colorValue);
                        var newchannelColor = EditorGUILayout.Vector4Field("Multiplier (" + i + ")", channelColor);
                        if (channelColor != newchannelColor)
                        {
                            channelMask.colorValue = ToColor(newchannelColor);
                        }

                        var AdditiveMask     = additive.GetArrayElementAtIndex(i);
                        var AdditiveColor    = ToVector4(AdditiveMask.colorValue);
                        var newAdditiveColor = EditorGUILayout.Vector4Field("Additive (" + i + ")", AdditiveColor);
                        if (newAdditiveColor != AdditiveColor)
                        {
                            AdditiveMask.colorValue = ToColor(newAdditiveColor);
                        }
                    }
                    else
                    {
                        Modulate.text = "Multiplier (" + i + ")";
                        EditorGUILayout.PropertyField(mask.GetArrayElementAtIndex(i), Modulate);
                        Additive.text = "Additive (" + i + ")";
                        EditorGUILayout.PropertyField(additive.GetArrayElementAtIndex(i), Additive);
                    }



                    GUILayout.Space(5);
                }
            }
            else
            {
                EditorGUILayout.PropertyField(mask.GetArrayElementAtIndex(0), new GUIContent("BaseColor"));
                if (additive.arraySize >= 3)
                {
                    EditorGUILayout.PropertyField(additive.GetArrayElementAtIndex(2), new GUIContent("Metallic/Gloss", "Color is metallicness (Black is not metallic), Alpha is glossiness (Black is not glossy)"));
                }
                else
                {
                    //color didn't have a metallic gloss channel so show button to add one?
                }
            }
            EditorGUILayout.Space();
            EditorGUI.EndProperty();
        }
 // Use this for initialization
 void Start()
 {
     avatar = GameObject.Find("PlayerMannequin").GetComponent <DynamicCharacterAvatar>();
 }
        void OnGUI()
        {
            GUILayout.Label("UMA Bone Builder");
            GUILayout.Space(20);

            if (Application.isPlaying)
            {
                EditorGUILayout.HelpBox("The bone builder should not be used while the scene is running.", MessageType.Info);
                return;
            }

            newUmaObj = EditorGUILayout.ObjectField("UMA GameObject  ", umaObject, typeof(GameObject), true) as GameObject;

            //prevent being able to set set a prefab in the bone builder.  It will not work.
            if (newUmaObj != null && EditorUtility.IsPersistent(newUmaObj))
            {
                newUmaObj = null;
            }

            if (newUmaObj != umaObject)
            {
                umaObject = newUmaObj;
                if (newUmaObj != null)
                {
                    _avatar = umaObject.GetComponent <DynamicCharacterAvatar>();
                }
            }

            if (umaObject != null && _avatar == null)
            {
                EditorGUILayout.HelpBox("This UMA is not a DynamicCharacterAvatar so we need to supply the base recipe.", MessageType.Info);
                baseRecipe = EditorGUILayout.ObjectField("Base Recipe", baseRecipe, typeof(UMARecipeBase), false) as UMARecipeBase;
            }
            else
            {
                baseRecipe = null;
            }


            removeUMAData = EditorGUILayout.Toggle(new GUIContent("Remove UMAData", "A recipe and UMAData is created during the bone generation process, checking this will remove it at the end of the process. (Recommended)"), removeUMAData);

            // Currently, this produces an avatar with it's arms twisted.
            // saveAvatar = EditorGUILayout.Toggle(new GUIContent("Save Mecanim Avatar", "This will save the Mecanim Avatar generated as an asset."), saveAvatar);
            GUILayout.Label("You can save the avatar at runtime using the option on the UMA/Runtime menu.", EditorStyles.wordWrappedMiniLabel);
            if (GUILayout.Button("Generate Bones"))
            {
                if (umaObject == null)
                {
                    Debug.LogWarning("UMA GameObject not set!");
                    return;
                }

                if (_avatar != null && _avatar.activeRace.data == null)
                {
                    Debug.LogWarning("No recipe data found. Make sure the race is added to the library!");
                    return;
                }

                if (_avatar != null)
                {
                    baseRecipe = _avatar.activeRace.data.baseRaceRecipe;
                }

                if (baseRecipe == null)
                {
                    Debug.LogWarning("BaseRecipe not set!");
                    return;
                }

                Debug.Log("Processing...");
                InitializeUMAData();
                FindBones();
                EnsureRoot();
                CreateBoneTransforms();
                InitializeAnimator();
                if (removeUMAData)
                {
                    Cleanup();
                }
                Debug.Log("Completed!");
                this.Close();
            }
        }
Esempio n. 7
0
    public void UnEquipItem(DynamicCharacterAvatar avatar, ItemSlot itemSlot)
    {
        // UMAData must not be null, so wait until it is not.
        UMAData umaData = null;

        while (umaData == null)
        {
            umaData = avatar.gameObject.GetComponent <UMAData>();
        }

        switch (itemSlot)
        {
        case ItemSlot.HEAD:
            avatar.ClearSlot("Helmet");
            avatar.BuildCharacter();
            break;

        case ItemSlot.CHEST:
            avatar.ClearSlot("Chest");
            avatar.BuildCharacter();
            break;

        case ItemSlot.LEGS:
            avatar.ClearSlot("Legs");
            avatar.BuildCharacter();
            break;

        case ItemSlot.HANDS:
            avatar.ClearSlot("Hands");
            avatar.BuildCharacter();
            break;

        case ItemSlot.FEET:
            avatar.ClearSlot("Feet");
            avatar.BuildCharacter();
            break;

        case ItemSlot.LEFT_HAND:
            // Find left hand bone.
            GameObject boneObjL = umaData.GetBoneGameObject("LeftHand");
            // If previous item exists remove it.
            Transform objTransformL = boneObjL.transform.Find("LeftHandItem");
            if (objTransformL != null)
            {
                Destroy(objTransformL.gameObject);
            }
            // Find right hand bone.
            GameObject boneObjLR = umaData.GetBoneGameObject("RightHand");
            // If previous two hand item exists remove it.
            Transform objTransformL2 = boneObjLR.transform.Find("TwoHandItem");
            if (objTransformL2 != null)
            {
                Destroy(objTransformL2.gameObject);
            }
            break;

        case ItemSlot.RIGHT_HAND:
            // Find right hand bone.
            GameObject boneObjR = umaData.GetBoneGameObject("RightHand");
            // If previous item exists remove it.
            Transform objTransformR = boneObjR.transform.Find("RightHandItem");
            if (objTransformR != null)
            {
                Destroy(objTransformR.gameObject);
            }
            // If previous two hand item exists remove it.
            Transform objTransformR2 = boneObjR.transform.Find("TwoHandItem");
            if (objTransformR2 != null)
            {
                Destroy(objTransformR2.gameObject);
            }
            break;

        case ItemSlot.TWO_HAND:
            // Find left hand bone.
            GameObject boneObjTHL = umaData.GetBoneGameObject("LeftHand");
            // If previous left hand item exists remove it.
            Transform objTransformTH1 = boneObjTHL.transform.Find("LeftHandItem");
            if (objTransformTH1 != null)
            {
                Destroy(objTransformTH1.gameObject);
            }
            // Find right hand bone.
            GameObject boneObjTHR = umaData.GetBoneGameObject("RightHand");
            // If previous right hand item exists remove it.
            Transform objTransformTH2 = boneObjTHR.transform.Find("RightHandItem");
            if (objTransformTH2 != null)
            {
                Destroy(objTransformTH2.gameObject);
            }
            // If previous two hand item exists remove it.
            Transform objTransformTH3 = boneObjTHR.transform.Find("TwoHandItem");
            if (objTransformTH3 != null)
            {
                Destroy(objTransformTH3.gameObject);
            }
            break;
        }
    }
    private void Update()
    {
        if (_exitingWorld)
        {
            return;
        }
        if (_kickFromWorld)
        {
            ExitWorld();
            MainManager.Instance.LoadScene(MainManager.LOGIN_SCENE);
            return;
        }

        lock (UPDATE_METHOD_LOCK)
        {
            // Distance check.
            foreach (GameObject obj in _gameObjects.Values)
            {
                if (obj != null && CalculateDistance(obj.transform.position) > VISIBILITY_RADIUS)
                {
                    WorldObject worldObject = obj.GetComponent <WorldObject>();
                    if (worldObject != null && !_deleteQueue.Contains(worldObject.GetObjectId()))
                    {
                        _deleteQueue.Add(worldObject.GetObjectId());
                    }
                }
            }

            // Delete pending objects.
            foreach (long objectId in _deleteQueue)
            {
                if (_gameObjects.ContainsKey(objectId))
                {
                    GameObject obj = _gameObjects[objectId];
                    if (obj != null)
                    {
                        // Disable.
                        obj.GetComponent <WorldObjectText>().GetNameMesh().gameObject.SetActive(false);
                        obj.SetActive(false);

                        // Remove from objects list.
                        ((IDictionary <long, GameObject>)_gameObjects).Remove(obj.GetComponent <WorldObject>().GetObjectId());

                        // Delete game object from world with a delay.
                        StartCoroutine(DelayedDestroy(obj));
                    }
                }

                // If object was current target, unselect it.
                if (_targetWorldObject != null && _targetWorldObject.GetObjectId() == objectId)
                {
                    SetTarget(null);
                }
            }
            if (_deleteQueue.Count > 0)
            {
                _deleteQueue.Clear();
            }

            // Move pending objects.
            foreach (KeyValuePair <long, MovementHolder> entry in _moveQueue)
            {
                Vector3 position = new Vector3(entry.Value.GetX(), entry.Value.GetY(), entry.Value.GetZ());
                if (_gameObjects.ContainsKey(entry.Key))
                {
                    GameObject obj = _gameObjects[entry.Key];
                    if (obj != null)
                    {
                        WorldObject worldObject = obj.GetComponent <WorldObject>();
                        if (worldObject != null)
                        {
                            if (CalculateDistance(position) > VISIBILITY_RADIUS) // Moved out of sight.
                            {
                                // Broadcast self position, object out of sight.
                                NetworkManager.ChannelSend(new LocationUpdateRequest(MovementController.GetStoredPosition().x, MovementController.GetStoredPosition().y, MovementController.GetStoredPosition().z, MovementController.GetStoredRotation()));
                                _deleteQueue.Add(worldObject.GetObjectId());
                            }
                            else
                            {
                                worldObject.MoveObject(position, entry.Value.GetHeading());
                            }
                        }
                    }
                }
                // Check self teleporting.
                else if (entry.Key == 0)
                {
                    _activeCharacter.transform.localPosition             = position;
                    _activeCharacter.GetComponent <Rigidbody>().position = position;
                }
                // Request unknown object info from server.
                else if (CalculateDistance(position) <= VISIBILITY_RADIUS)
                {
                    NetworkManager.ChannelSend(new ObjectInfoRequest(entry.Key));
                    // Broadcast self position, in case player is not moving.
                    NetworkManager.ChannelSend(new LocationUpdateRequest(MovementController.GetStoredPosition().x, MovementController.GetStoredPosition().y, MovementController.GetStoredPosition().z, MovementController.GetStoredRotation()));
                }

                ((IDictionary <long, MovementHolder>)_moveQueue).Remove(entry.Key);
            }

            // Animate pending objects.
            foreach (KeyValuePair <long, AnimationHolder> entry in _animationQueue)
            {
                if (_gameObjects.ContainsKey(entry.Key))
                {
                    GameObject obj = _gameObjects[entry.Key];
                    if (obj != null)
                    {
                        WorldObject worldObject = obj.GetComponent <WorldObject>();
                        if (worldObject != null)
                        {
                            if (worldObject.GetDistance() <= VISIBILITY_RADIUS) // Object is in sight radius.
                            {
                                worldObject.AnimateObject(entry.Value.GetVelocityX(), entry.Value.GetVelocityZ(), entry.Value.IsTriggerJump(), entry.Value.IsInWater(), entry.Value.IsGrounded());
                            }
                        }
                    }
                }

                ((IDictionary <long, AnimationHolder>)_animationQueue).Remove(entry.Key);
            }

            // Update pending characters.
            foreach (KeyValuePair <long, CharacterDataHolder> entry in _characterUpdateQueue)
            {
                if (_gameObjects.ContainsKey(entry.Key))
                {
                    GameObject obj = _gameObjects[entry.Key];
                    if (obj != null)
                    {
                        WorldObject worldObject = obj.GetComponent <WorldObject>();
                        if (worldObject != null)
                        {
                            if (worldObject.GetDistance() <= VISIBILITY_RADIUS) // Object is in sight radius.
                            {
                                DynamicCharacterAvatar avatar = obj.GetComponent <DynamicCharacterAvatar>();
                                if (avatar != null)
                                {
                                    // TODO: Manage more things than just item updates.
                                    CharacterDataHolder oldData = worldObject.GetCharacterData();
                                    CharacterDataHolder newData = entry.Value;

                                    int headItem = newData.GetHeadItem();
                                    if (headItem != oldData.GetHeadItem())
                                    {
                                        if (headItem == 0)
                                        {
                                            CharacterManager.Instance.UnEquipItem(avatar, ItemSlot.HEAD);
                                        }
                                        else
                                        {
                                            CharacterManager.Instance.EquipItem(avatar, headItem);
                                        }
                                    }

                                    int chestItem = newData.GetChestItem();
                                    if (chestItem != oldData.GetChestItem())
                                    {
                                        if (chestItem == 0)
                                        {
                                            CharacterManager.Instance.UnEquipItem(avatar, ItemSlot.CHEST);
                                        }
                                        else
                                        {
                                            CharacterManager.Instance.EquipItem(avatar, chestItem);
                                        }
                                    }

                                    int legsItem = newData.GetLegsItem();
                                    if (legsItem != oldData.GetLegsItem())
                                    {
                                        if (legsItem == 0)
                                        {
                                            CharacterManager.Instance.UnEquipItem(avatar, ItemSlot.LEGS);
                                        }
                                        else
                                        {
                                            CharacterManager.Instance.EquipItem(avatar, legsItem);
                                        }
                                    }

                                    int handsItem = newData.GetHandsItem();
                                    if (handsItem != oldData.GetHandsItem())
                                    {
                                        if (handsItem == 0)
                                        {
                                            CharacterManager.Instance.UnEquipItem(avatar, ItemSlot.HANDS);
                                        }
                                        else
                                        {
                                            CharacterManager.Instance.EquipItem(avatar, handsItem);
                                        }
                                    }

                                    int feetItem = newData.GetFeetItem();
                                    if (feetItem != oldData.GetFeetItem())
                                    {
                                        if (feetItem == 0)
                                        {
                                            CharacterManager.Instance.UnEquipItem(avatar, ItemSlot.FEET);
                                        }
                                        else
                                        {
                                            CharacterManager.Instance.EquipItem(avatar, feetItem);
                                        }
                                    }

                                    int leftHandItem = newData.GetLeftHandItem();
                                    if (leftHandItem != oldData.GetLeftHandItem())
                                    {
                                        if (leftHandItem == 0)
                                        {
                                            CharacterManager.Instance.UnEquipItem(avatar, ItemSlot.LEFT_HAND);
                                        }
                                        else
                                        {
                                            CharacterManager.Instance.EquipItem(avatar, leftHandItem);
                                        }
                                    }

                                    int rightHandItem = newData.GetRightHandItem();
                                    if (rightHandItem != oldData.GetRightHandItem())
                                    {
                                        if (rightHandItem == 0)
                                        {
                                            CharacterManager.Instance.UnEquipItem(avatar, ItemSlot.RIGHT_HAND);
                                        }
                                        else
                                        {
                                            CharacterManager.Instance.EquipItem(avatar, rightHandItem);
                                        }
                                    }

                                    // Update world object with new data.
                                    worldObject.SetCharacterData(newData);
                                }
                            }
                        }
                    }
                }

                ((IDictionary <long, CharacterDataHolder>)_characterUpdateQueue).Remove(entry.Key);
            }
        }
    }
Esempio n. 9
0
 public void Setup(DynamicCharacterAvatar avatar, UMATextRecipe recipe, string slot)
 {
     Avatar = avatar;
     Recipe = recipe;
     Slot   = slot;
 }
Esempio n. 10
0
 public void Setup(DynamicCharacterAvatar avatar, string slotName, GameObject wardrobePanel)
 {
     Avatar        = avatar;
     SlotName      = slotName;
     WardrobePanel = wardrobePanel;
 }
Esempio n. 11
0
    public void Initialize()
    {
        if (!qnet.pv.IsMine)
        {
            return;
        }
        dca    = GetComponent <DynamicCharacterAvatar>();
        matrix = new Dictionary <int, string>()
        {
            { 0, "eyeSpacing" },
            { 4, "height" },
            { 5, "headSize" },
            { 6, "headWidth" },
            { 7, "neckThickness" },
            { 8, "armLength" },
            { 9, "forearmLength" },

            { 10, "armWidth" },
            { 11, "forearmWidth" },
            { 12, "handSize" },
            { 13, "feetSize" },
            { 14, "legSeparation" },
            { 15, "upperMuscle" },
            { 16, "lowerMuscle" },
            { 17, "upperWeight" },
            { 18, "lowerWeight" },
            { 19, "legSize" },

            { 20, "belly" },
            { 21, "waist" },
            { 22, "gluteusSize" },
            { 23, "earsSize" },
            { 24, "earsPosition" },
            { 25, "earsRotation" },
            { 26, "noseSize" },
            { 27, "noseCurve" },
            { 28, "noseWidth" },
            { 29, "noseInclination" },

            { 30, "nosePosition" },
            { 31, "nosePronounced" },
            { 32, "noseFlatten" },
            { 33, "chinSize" },
            { 34, "chinPronounced" },
            { 35, "chinPosition" },
            { 36, "mandibleSize" },
            { 37, "jawsSize" },
            { 38, "jawsPosition" },
            { 39, "cheekSize" },

            { 40, "cheekPosition" },
            { 41, "lowCheek Pronounced" },
            { 42, "lowCheek Position" },
            { 43, "foreheadSize" },
            { 44, "foreheadPosition" },
            { 45, "lipsSize" },
            { 46, "mouthSize" },
            { 47, "eyeRotation" },
            { 48, "eyeSize" },
            { 49, "breastSize" }
        };

        UpdateDNA();
        UpdateColors();
        UpdateWardrobe();

        if (PlayerPrefs.HasKey("data"))
        {
            Load();
        }
    }
Esempio n. 12
0
 void Start()
 {
     avatar = GetComponentInChildren <DynamicCharacterAvatar>();
     GetComponent <Character>().itemContainers[ItemContainerId.EQUIPMENT].OnInventoryChanged += CharacterEquipment_OnInventoryChanged;
 }