示例#1
0
文件: HPTK.cs 项目: jorgejgnz/HPTK
        public void AddAvatar(AvatarController avatar)
        {
            this._avatars.Add(avatar);

            avatar.ControllerStart();

            if (applyThisLayerToAvatars != "")
            {
                int layer = LayerMask.NameToLayer(applyThisLayerToAvatars);
                if (layer >= 0)
                {
                    foreach (BodyModel body in avatar.model.bodies)
                    {
                        BoneModel rootBone = body.root.root;

                        foreach (KeyValuePair <string, ReprModel> entry in rootBone.point.reprs)
                        {
                            BasicHelpers.ApplyLayerRecursively(entry.Value.transformRef, layer);
                        }
                    }
                }
            }

            onAvatarEntered.Invoke(avatar.model.view);
        }