Inheritance: Object
Exemplo n.º 1
0
    static void Avatar_isHuman(JSVCall vc)
    {
        UnityEngine.Avatar _this = (UnityEngine.Avatar)vc.csObj;
        var result = _this.isHuman;

        JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(result));
    }
Exemplo n.º 2
0
        protected override async Task OnLoadHierarchy(IAwaitCaller awaitCaller, Func <string, IDisposable> MeasureTime)
        {
            Root.name = "VRM1";

            // humanoid
            var humanoid = Root.AddComponent <UniHumanoid.Humanoid>();

            humanoid.AssignBones(m_map.Nodes.Select(x => (ToUnity(x.Key.HumanoidBone.GetValueOrDefault()), x.Value.transform)));
            m_humanoid      = humanoid.CreateAvatar();
            m_humanoid.name = "humanoid";
            var animator = Root.AddComponent <Animator>();

            animator.avatar = m_humanoid;

            // VrmController
            var controller = Root.AddComponent <VRM10Controller>();

            // vrm
            controller.Vrm = await LoadVrmAsync(awaitCaller, m_vrm);

            // springBone
            if (UniGLTF.Extensions.VRMC_springBone.GltfDeserializer.TryGet(Data.GLTF.extensions, out UniGLTF.Extensions.VRMC_springBone.VRMC_springBone springBone))
            {
                await LoadSpringBoneAsync(awaitCaller, controller, springBone);
            }
            // constraint
            await LoadConstraintAsync(awaitCaller, controller);
        }
Exemplo n.º 3
0
 static public int constructor(IntPtr l)
 {
     UnityEngine.Avatar o;
     o = new UnityEngine.Avatar();
     pushObject(l, o);
     return(1);
 }
 static public int get_humanDescription(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.Avatar self = (UnityEngine.Avatar)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.humanDescription);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
 static public void FastSetter(this UnityEngine.Animator o, string propertyName, UnityEngine.Avatar value)
 {
     switch (propertyName)
     {
     case "avatar":
         o.avatar = value; return;
     }
     LBoot.LogUtil.Error("UnityEngine.Animator no Setter Found : " + propertyName);
 }
Exemplo n.º 6
0
 static public int get_isHuman(IntPtr l)
 {
     try {
         UnityEngine.Avatar self = (UnityEngine.Avatar)checkSelf(l);
         pushValue(l, self.isHuman);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int get_isValid(IntPtr l)
 {
     try {
         UnityEngine.Avatar self = (UnityEngine.Avatar)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.isValid);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 8
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Avatar o;
         o = new UnityEngine.Avatar();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Avatar o;
         o = new UnityEngine.Avatar();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 10
0
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.Avatar o;
         o=new UnityEngine.Avatar();
         pushValue(l,true);
         pushValue(l,o);
         return 2;
     }
     catch(Exception e) {
         return error(l,e);
     }
 }
Exemplo n.º 11
0
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.Avatar o;
         o=new UnityEngine.Avatar();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
Exemplo n.º 12
0
 static public int constructor(IntPtr l)
 {
     LuaDLL.lua_remove(l, 1);
     UnityEngine.Avatar o;
     if (matchType(l, 1))
     {
         o = new UnityEngine.Avatar();
         pushObject(l, o);
         return(1);
     }
     LuaDLL.luaL_error(l, "New object failed.");
     return(0);
 }
 /// <summary>
 ///   <para>Creates a human pose handler from an avatar and a root transform.</para>
 /// </summary>
 /// <param name="avatar">The avatar that defines the humanoid rig on skeleton hierarchy with root as the top most parent.</param>
 /// <param name="root">The top most node of the skeleton hierarchy defined in humanoid avatar.</param>
 public HumanPoseHandler(Avatar avatar, Transform root)
 {
   this.m_Ptr = IntPtr.Zero;
   if ((Object) root == (Object) null)
     throw new ArgumentNullException("HumanPoseHandler root Transform is null");
   if ((Object) avatar == (Object) null)
     throw new ArgumentNullException("HumanPoseHandler avatar is null");
   if (!avatar.isValid)
     throw new ArgumentException("HumanPoseHandler avatar is invalid");
   if (!avatar.isHuman)
     throw new ArgumentException("HumanPoseHandler avatar is not human");
   this.Internal_HumanPoseHandler(avatar, root);
 }
Exemplo n.º 14
0
 static public int BuildGenericAvatar_s(IntPtr l)
 {
     try{
         UnityEngine.GameObject a1;
         checkType(l, 1, out a1);
         System.String a2;
         checkType(l, 2, out a2);
         UnityEngine.Avatar ret = UnityEngine.AvatarBuilder.BuildGenericAvatar(a1, a2);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Exemplo n.º 15
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.Avatar avatar = (UnityEngine.Avatar)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "name":
                    avatar.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    avatar.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
Exemplo n.º 16
0
////////////////////// HumanPoseHandler ///////////////////////////////////////
// constructors

    static bool HumanPoseHandler_HumanPoseHandler1(JSVCall vc, int argc)
    {
        int _this = JSApi.getObject((int)JSApi.GetType.Arg);

        JSApi.attachFinalizerObject(_this);
        --argc;

        int len = argc;

        if (len == 2)
        {
            UnityEngine.Avatar    arg0 = (UnityEngine.Avatar)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            UnityEngine.Transform arg1 = (UnityEngine.Transform)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            JSMgr.addJSCSRel(_this, new UnityEngine.HumanPoseHandler(arg0, arg1));
        }

        return(true);
    }
Exemplo n.º 17
0
 /// <summary>
 /// <para>Creates a human pose handler from an avatar and a root transform.</para>
 /// </summary>
 /// <param name="avatar">The avatar that defines the humanoid rig on skeleton hierarchy with root as the top most parent.</param>
 /// <param name="root">The top most node of the skeleton hierarchy defined in humanoid avatar.</param>
 public HumanPoseHandler(Avatar avatar, Transform root)
 {
     if (root == null)
     {
         throw new ArgumentNullException("HumanPoseHandler root Transform is null");
     }
     if (avatar == null)
     {
         throw new ArgumentNullException("HumanPoseHandler avatar is null");
     }
     if (!avatar.isValid)
     {
         throw new ArgumentException("HumanPoseHandler avatar is invalid");
     }
     if (!avatar.isHuman)
     {
         throw new ArgumentException("HumanPoseHandler avatar is not human");
     }
     this.Internal_HumanPoseHandler(avatar, root);
 }
Exemplo n.º 18
0
 static public int get_isHuman(IntPtr l)
 {
     UnityEngine.Avatar o = (UnityEngine.Avatar)checkSelf(l);
     pushValue(l, o.isHuman);
     return(1);
 }
Exemplo n.º 19
0
 private static extern void INTERNAL_CALL_GetPreRotation(Avatar self, int humanId, out Quaternion value);
 extern private static IntPtr Internal_Create(Avatar avatar, Transform root);
		private void ImportAvatarReference()
		{
			EditorGUI.BeginChangeCheck();
			this.m_RefAvatar = (EditorGUILayout.ObjectField("Use skeleton from", this.m_RefAvatar, typeof(Avatar), true, new GUILayoutOption[0]) as Avatar);
			if (EditorGUI.EndChangeCheck())
			{
				this.m_RefImporter = (AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(this.m_RefAvatar)) as ModelImporter);
			}
			if (this.m_RefImporter != null && GUILayout.Button("Import skeleton", new GUILayoutOption[0]))
			{
				AvatarMaskUtility.UpdateTransformMask(this.target as AvatarMask, this.m_RefImporter.transformPaths, null);
			}
		}
Exemplo n.º 22
0
 private static extern IntPtr Internal_CreateFromRoot(Avatar avatar, Transform root);
 private void CheckAvatar(Avatar sourceAvatar)
 {
   if (!((UnityEngine.Object) sourceAvatar != (UnityEngine.Object) null))
     return;
   if (sourceAvatar.isHuman && this.animationType != ModelImporterAnimationType.Human)
   {
     if (EditorUtility.DisplayDialog("Asigning an Humanoid Avatar on a Generic Rig", "Do you want to change Animation Type to Humanoid ?", "Yes", "No"))
       this.animationType = ModelImporterAnimationType.Human;
     else
       this.m_AvatarSource.objectReferenceValue = (UnityEngine.Object) null;
   }
   else
   {
     if (sourceAvatar.isHuman || this.animationType == ModelImporterAnimationType.Generic)
       return;
     if (EditorUtility.DisplayDialog("Asigning an Generic Avatar on a Humanoid Rig", "Do you want to change Animation Type to Generic ?", "Yes", "No"))
       this.animationType = ModelImporterAnimationType.Generic;
     else
       this.m_AvatarSource.objectReferenceValue = (UnityEngine.Object) null;
   }
 }
Exemplo n.º 24
0
 internal static extern bool HasCollider(Avatar avatar, int i);
Exemplo n.º 25
0
 internal static extern bool HasCollider(Avatar avatar, int i);
 private void Internal_HumanPoseHandler(Avatar avatar, Transform root);
Exemplo n.º 27
0
 private static extern void INTERNAL_CALL_GetZYPostQ(Avatar self, int humanId, ref Quaternion parentQ, ref Quaternion q, out Quaternion value);
		private void CheckAvatar(Avatar sourceAvatar)
		{
			if (sourceAvatar != null)
			{
				if (sourceAvatar.isHuman && this.animationType != ModelImporterAnimationType.Human)
				{
					if (EditorUtility.DisplayDialog("Asigning an Humanoid Avatar on a Generic Rig", "Do you want to change Animation Type to Humanoid ?", "Yes", "No"))
					{
						this.animationType = ModelImporterAnimationType.Human;
					}
					else
					{
						this.m_AvatarSource.objectReferenceValue = null;
					}
				}
				else
				{
					if (!sourceAvatar.isHuman && this.animationType != ModelImporterAnimationType.Generic)
					{
						if (EditorUtility.DisplayDialog("Asigning an Generic Avatar on a Humanoid Rig", "Do you want to change Animation Type to Generic ?", "Yes", "No"))
						{
							this.animationType = ModelImporterAnimationType.Generic;
						}
						else
						{
							this.m_AvatarSource.objectReferenceValue = null;
						}
					}
				}
			}
		}
Exemplo n.º 29
0
		private static Quaternion INTERNAL_CALL_GetZYRoll(Avatar self, int humanId, ref Vector3 uvw) { throw new NotImplementedException("なにこれ"); }
Exemplo n.º 30
0
		private static Quaternion INTERNAL_CALL_GetZYPostQ(Avatar self, int humanId, ref Quaternion parentQ, ref Quaternion q) { throw new NotImplementedException("なにこれ"); }
Exemplo n.º 31
0
 private static extern void INTERNAL_CALL_GetZYRoll(Avatar self, int humanId, ref Vector3 uvw, out Quaternion value);
Exemplo n.º 32
0
 private static extern void INTERNAL_CALL_GetLimitSign(Avatar self, int humanId, out Vector3 value);
Exemplo n.º 33
0
 internal Quaternion GetZYRoll(int humanId, Vector3 uvw)
 {
     return(Avatar.INTERNAL_CALL_GetZYRoll(this, humanId, ref uvw));
 }
Exemplo n.º 34
0
 private void CopyHumanDescriptionFromOtherModel(Avatar sourceAvatar)
 {
     SerializedObject modelImporterSerializedObject = GetModelImporterSerializedObject(AssetDatabase.GetAssetPath(sourceAvatar));
     CopyHumanDescriptionToDestination(modelImporterSerializedObject, base.serializedObject);
     modelImporterSerializedObject.Dispose();
 }
Exemplo n.º 35
0
 private static extern Quaternion INTERNAL_CALL_GetZYRoll(Avatar self, int humanId, ref Vector3 uvw);
 private void CopyHumanDescriptionFromOtherModel(Avatar sourceAvatar)
 {
   SerializedObject serializedObject = ModelImporterRigEditor.GetModelImporterSerializedObject(AssetDatabase.GetAssetPath((UnityEngine.Object) sourceAvatar));
   ModelImporterRigEditor.CopyHumanDescriptionToDestination(serializedObject, this.serializedObject);
   serializedObject.Dispose();
 }
Exemplo n.º 37
0
 private static extern Quaternion INTERNAL_CALL_GetZYRoll(Avatar self, int humanId, ref Vector3 uvw);
Exemplo n.º 38
0
 private extern void Internal_HumanPoseHandler(Avatar avatar, Transform root);
Exemplo n.º 39
0
 internal static bool HasCollider(Avatar avatar, int i)
 {
     throw new NotImplementedException("なにこれ");
 }
Exemplo n.º 40
0
 private static extern void INTERNAL_CALL_GetZYPostQ(Avatar self, int humanId, ref Quaternion parentQ, ref Quaternion q, out Quaternion value);
Exemplo n.º 41
0
 private static extern IntPtr Internal_CreateFromJointPaths(Avatar avatar, string[] jointPaths);
Exemplo n.º 42
0
 /// <summary>
 /// Write the specified value using the writer.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <param name="writer">Writer.</param>
 public override void Write(object value, ISaveGameWriter writer)
 {
     UnityEngine.Avatar avatar = (UnityEngine.Avatar)value;
     writer.WriteProperty("name", avatar.name);
     writer.WriteProperty("hideFlags", avatar.hideFlags);
 }
Exemplo n.º 43
0
 private static extern void INTERNAL_CALL_GetZYRoll(Avatar self, int humanId, ref Vector3 uvw, out Quaternion value);
Exemplo n.º 44
0
 private static extern Quaternion INTERNAL_CALL_GetZYPostQ(Avatar self, int humanId, ref Quaternion parentQ, ref Quaternion q);
Exemplo n.º 45
0
 private static extern void INTERNAL_CALL_GetLimitSign(Avatar self, int humanId, out Vector3 value);
		internal override void ResetValues()
		{
			base.ResetValues();
			this.m_Avatar = (AssetDatabase.LoadAssetAtPath((this.target as ModelImporter).assetPath, typeof(Avatar)) as Avatar);
		}
Exemplo n.º 47
0
 private static extern Quaternion INTERNAL_CALL_GetZYPostQ(Avatar self, int humanId, ref Quaternion parentQ, ref Quaternion q);
		private void CopyHumanDescriptionFromOtherModel(Avatar sourceAvatar)
		{
			string assetPath = AssetDatabase.GetAssetPath(sourceAvatar);
			SerializedObject modelImporterSerializedObject = ModelImporterRigEditor.GetModelImporterSerializedObject(assetPath);
			ModelImporterRigEditor.CopyHumanDescriptionToDestination(modelImporterSerializedObject, base.serializedObject);
			modelImporterSerializedObject.Dispose();
		}
 private void ImportAvatarReference()
 {
   EditorGUI.BeginChangeCheck();
   this.m_RefAvatar = EditorGUILayout.ObjectField("Use skeleton from", (UnityEngine.Object) this.m_RefAvatar, typeof (Avatar), true, new GUILayoutOption[0]) as Avatar;
   if (EditorGUI.EndChangeCheck())
     this.m_RefImporter = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath((UnityEngine.Object) this.m_RefAvatar)) as ModelImporter;
   if (!((UnityEngine.Object) this.m_RefImporter != (UnityEngine.Object) null) || !GUILayout.Button("Import skeleton"))
     return;
   AvatarMaskUtility.UpdateTransformMask(this.m_TransformMask, this.m_RefImporter.transformPaths, (string[]) null);
 }
Exemplo n.º 50
0
 public static extern void HumanGetColliderTransform(Avatar avatar, int index, TransformX boneX, out TransformX colliderX);
Exemplo n.º 51
0
 private static extern void INTERNAL_CALL_GetPostRotation(Avatar self, int humanId, out Quaternion value);