示例#1
0
		public static List<Ik2D> BuildIkList(Ik2D ik2D)
		{
			if(ik2D.target)
			{
				return BuildIkList(ik2D.target);
			}

			return new List<Ik2D>();
		}
示例#2
0
		protected virtual void OnEnable()
		{
			m_Ik2D = target as Ik2D;

			m_RecordProperty = serializedObject.FindProperty("m_Record");
			m_TargetTransformProperty = serializedObject.FindProperty("m_TargetTransform");
			m_WeightProperty = serializedObject.FindProperty("m_Weight");
			m_RestorePoseProperty = serializedObject.FindProperty("m_RestoreDefaultPose");
			m_OrientChildProperty = serializedObject.FindProperty("m_OrientChild");
		}
        static void Update()
        {
            EditorUpdaterProxy.Instance.onLateUpdate -= OnLateUpdate;
            EditorUpdaterProxy.Instance.onLateUpdate += OnLateUpdate;

            if (s_DraggingATool)
            {
                s_DraggingATool = false;

                string undoName = "Move";

                if (Tools.current == Tool.Rotate)
                {
                    undoName = "Rotate";
                }
                if (Tools.current == Tool.Scale)
                {
                    undoName = "Scale";
                }

                for (int i = 0; i < Selection.transforms.Length; i++)
                {
                    Transform transform = Selection.transforms [i];
                    Control   control   = transform.GetComponent <Control> ();
                    if (control && control.isActiveAndEnabled && control.bone)
                    {
                        Undo.RecordObject(control.bone.transform, undoName);

                        control.bone.transform.position = control.transform.position;
                        control.bone.transform.rotation = control.transform.rotation;

                        BoneUtils.OrientToChild(control.bone.parentBone, false, undoName, true);
                    }

                    Ik2D ik2D = transform.GetComponent <Ik2D>();
                    if (ik2D && ik2D.record)
                    {
                        IkUtils.UpdateIK(ik2D, undoName, true);
                    }
                }

                SetDirty();
            }

            AnimationModeCheck();
            AnimationWindowTimeCheck();

            //IkUtils.UpdateAttachedIKs(s_SMI);

            UpdateSprites();
        }
示例#4
0
		public static List<Ik2D> UpdateIK(Ik2D ik2D, string undoName, bool recordObject)
		{
			if(ik2D && ik2D.target)
			{
				return UpdateIK(ik2D.target.chainRoot,undoName,recordObject);
			}
			return null;
		}