示例#1
0
        public new static Frames LoadFromFile(string path)
        {
            Frames frame = JsonAsset.LoadFromFile <Frames>(path);

            if (frame != null)
            {
                // sanity check loaded data
                if (frame.frameGrid != null)
                {
                    if (frame.frameGrid.size.Count == 0)
                    {
                        frame.frameGrid = null;
                    }
                    else if (frame.frameGrid.size.Count == 1)
                    {
                        frame.frameGrid.size.Add(1);
                    }
                    else
                    {
                        frame.frameGrid.size.RemoveRange(2, frame.frameGrid.size.Count - 2);
                    }
                }
                if (frame.frameGrid != null)
                {
                    if (frame.frameGrid.dimensions.Count == 0)
                    {
                        frame.frameGrid = null;
                    }
                    else if (frame.frameGrid.dimensions.Count == 1)
                    {
                        frame.frameGrid.dimensions.Add(1);
                    }
                    else
                    {
                        frame.frameGrid.dimensions.RemoveRange(2, frame.frameGrid.dimensions.Count - 2);
                    }
                }
                if ((frame.frameGrid != null) && (frame.frameGrid.names != null))
                {
                    if (frame.frameGrid.names.Count == 0)
                    {
                        frame.frameGrid.names = null;
                    }
                }

                frame.RecalcFrameItems();
            }

            return(frame);
        }
示例#2
0
 public void FrameGridPropertiesChanged()
 {
     PropagateToFrames();
     Frame.RecalcFrameItems();
     Globals.AppForm.Invalidate();
 }