Exemplo n.º 1
0
    public void CreateNew()
    {
        var newHolder = new PictureDataHolder(holders.Count);

        holders.Add(newHolder);
        Instantiate(tableItemPrefab, tableContent).GetComponent <PictureTableItem>().SetUp(this, newHolder);
    }
Exemplo n.º 2
0
    public void CreateDuplicate(PictureDataHolder holder)
    {
        var newHolder = PictureDataHolder.GetCopy(holder);

        newHolder.index = holders.Count;
        holders.Add(newHolder);
        Instantiate(tableItemPrefab, tableContent).GetComponent <PictureTableItem>().SetUp(this, newHolder);
    }
Exemplo n.º 3
0
 public static PictureDataHolder GetCopy(PictureDataHolder input)
 {
     return(new PictureDataHolder()
     {
         configuration = input.configuration,
         description = input.description,
         timeCycleCount = input.timeCycleCount,
         miniaturePictureTexture = input.miniaturePictureTexture
     });
 }
Exemplo n.º 4
0
 public void MoveItemDown(PictureDataHolder holder)
 {
     if (holder.index < holders.Count - 1)
     {
         int index = holder.index;
         holders[index]     = holders[index + 1];
         holders[index + 1] = holder;
         holders[index + 1].index++;
         holders[index].index--;
         StartCoroutine(Redraw());
     }
 }
Exemplo n.º 5
0
 public void MoveItemUp(PictureDataHolder holder)
 {
     if (holder.index > 0)
     {
         int index = holder.index;
         holders[index]     = holders[index - 1];
         holders[index - 1] = holder;
         holders[index - 1].index--;
         holders[index].index++;
         StartCoroutine(Redraw());
     }
 }
Exemplo n.º 6
0
    public void SetUp(MainMenu mainMenu, PictureDataHolder pictureDataHolder)
    {
        menu       = mainMenu;
        dataHolder = pictureDataHolder;
        timeCycleCountInputField.text = pictureDataHolder.timeCycleCount.ToString();
        descriptionInputField.text    = pictureDataHolder.description;

        if (pictureDataHolder.miniaturePictureTexture != null)
        {
            Texture2D bufer = new Texture2D(256, 128);
            bufer.LoadImage(pictureDataHolder.miniaturePictureTexture);
            miniature.texture = bufer;
//            Graphics.CopyTexture(bufer, 0, 0, miniature.texture,0,0);
        }
    }
Exemplo n.º 7
0
    public static PictureDataHolder GetLoadHolder(string data)
    {
        string[] separator = { "\n\r" };
        string[] options   = data.Split(separator, StringSplitOptions.RemoveEmptyEntries);

        PictureDataHolder result = new PictureDataHolder()
        {
            configuration           = options[0].Replace("Configuration: ", string.Empty),
            miniaturePictureTexture = GetTextureDataFromString(options[1].Replace("Texture: ", string.Empty)),
            description             = options[2].Replace("Description: ", string.Empty),
            timeCycleCount          = int.Parse(options[3].Replace("TimeCycleCount: ", string.Empty))
        };

        return(result);
    }
Exemplo n.º 8
0
    public (string danceName, List <PictureDataHolder> dataHolders) Load()
    {
        string[] separator = { "\r\n=======================\n\r" };

        string path    = Path.Combine(saveFilesDirectory, "test.dance");
        string content = File.ReadAllText(path);

        List <PictureDataHolder> holders = new List <PictureDataHolder>();

        string[] items = content.Split(separator, StringSplitOptions.RemoveEmptyEntries);

        for (int i = 1; i < items.Length; i++)
        {
            holders.Add(PictureDataHolder.GetLoadHolder(items[i]));
        }

        return(items[0].Replace("DanceName: ", string.Empty), holders);
    }
Exemplo n.º 9
0
 public void DeleteItem(PictureDataHolder holder)
 {
     holders.Remove(holder);
     CheckIndexes();
     StartCoroutine(Redraw());
 }
Exemplo n.º 10
0
 public void EditItem(PictureDataHolder holder)
 {
     readerModule.buferHolder = holder;
     menuPanel.SetActive(false);
     readerModule.LoadPictureConfiguration();
 }