Exemplo n.º 1
0
        private void AttachLimbMarker()
        {
            var chara = FkCharaMgr.FindSelectChara();

            if (chara == null)
            {
                return;
            }
            chara.Limbs().Foreach(b =>
            {
                var marker = BoneMarker.Create(b.Transform);
                _limbMarkers.Add(marker);
                marker.OnDrag = (m) =>
                {
                    var screenVec = m.MouseEndPos - m.MouseStartPos;
                    var pos       = Kit.MapScreenVecToWorld(screenVec, b.Transform.position);
                    FkJointAssist.MoveEnd(b.GuideObject, pos);
                };
                marker.OnMidClick = (m) =>
                {
//                    ClearLimbMarker();
                    DisableLimbMarker();
                    _follower = b;
                    AttachSelectorMarker();
                };
                marker.OnRightClick = (m) => { ToggleLockBone(b, m); };
                marker.OnLeftDown   = (m) => { UndoRedoHelper.Record(); };
                marker.OnLeftUp     = (m) => { UndoRedoHelper.Finish(); };
            });
        }
Exemplo n.º 2
0
 private void AttachHangMarker()
 {
     DisableLimbMarker();
     FkCharaMgr.FindSelectChara().Bones().Foreach(b =>
     {
         var marker = BoneMarker.Create(b.Transform);
         marker.SetColor(_hangColor);
         _hangMarkers.Add(marker);
         marker.OnLeftClick = m =>
         {
             var r  = new HangRecord();
             r.Bone = b;
             r.Pos  = b.Transform.position;
             r.Rot  = b.Transform.rotation;
             _hangRecords.Add(r);
             ClearHangMarker();
             EnableLimbMarker();
         };
     });
 }
Exemplo n.º 3
0
        private void AttachSelectorMarker()
        {
            var chars = FkCharaMgr.FindSelectCharas();

            chars.Foreach(c =>
            {
                c.Bones().Foreach(b =>
                {
                    var marker = BoneMarker.Create(b.Transform);
                    marker.SetColor(_selectorColor);
                    _selectorMarkers.Add(marker);
                    marker.OnLeftClick = (m) =>
                    {
                        var attach      = new AttachRecord();
                        attach.Leader   = b;
                        attach.Follower = _follower;
                        attach.Pos      = attach.Follower.Transform.position - attach.Leader.Transform.position;
                        _attachRecords.Add(attach);
                        ClearSelectorMarker();
                        EnableLimbMarker();
                    };
                });
            });
        }