Exemple #1
0
        public static void CreateSplineTool()
        {
            Puppet2D_Editor.SplineCreation = true;

            SplineCreationGroup = new GameObject(Puppet2D_BoneCreation.GetUniqueBoneName("spline_GRP"));
            Undo.RegisterCreatedObjectUndo(SplineCreationGroup, "undo create Spline");
            splineStoreData = SplineCreationGroup.AddComponent <Puppet2D_FFDStoreData>();
        }
Exemple #2
0
 public static void FFDSetFirstPath()
 {
     FFDControlsGrp = new GameObject(Puppet2D_BoneCreation.GetUniqueBoneName("FFD_Ctrls_GRP"));
     Undo.RegisterCreatedObjectUndo(FFDControlsGrp, "undo create FFD");
     ffdStoreData = FFDControlsGrp.AddComponent <Puppet2D_FFDStoreData>();
     ffdStoreData.OriginalSpritePosition = Puppet2D_Editor.FFDGameObject.transform.position;
     Puppet2D_Editor.FFDGameObject.transform.position = new Vector3(ffdStoreData.OriginalSpritePosition.x, ffdStoreData.OriginalSpritePosition.y, 0);
     if ((Puppet2D_Editor.FFDGameObject != null) && Puppet2D_Editor.FFDGameObject.GetComponent <PolygonCollider2D>())
     {
         Vector2[] firstPath = Puppet2D_Editor.FFDGameObject.GetComponent <PolygonCollider2D>().GetPath(0);
         foreach (Vector2 pos in firstPath)
         {
             FFDCreationMode(pos);
         }
         CloseFFDPath();
     }
 }