Exemplo n.º 1
0
        public void LoadTexture()
        {
            if (currentButton == null)
            {
                InfoMessage.ShowError("No current images choosed");
                return;
            }

            LevelCreatorManager.Instance.AddTexture(currentButton.myTextureData.Path);
        }
Exemplo n.º 2
0
 public void SetTexture()
 {
     if (CurrentTB == null)
     {
         InfoMessage.ShowError("No current image choosed");
         return;
     }
     myTextureDataHandler.SetTextureData(CurrentTB.myTextureData);
     gameObject.SetActive(false);
 }
Exemplo n.º 3
0
        public void Accept()
        {
            if (SaveOrLoad)
            {
                if (string.IsNullOrEmpty(FileStr) && string.IsNullOrEmpty(FolderStr))
                {
                    InfoMessage.ShowError("Choose folder and file to save in.");
                    UpdateShot();
                    return;
                }

                if (!string.IsNullOrEmpty(FileStr))
                {
                    if (System.IO.Path.GetExtension(FileStr) != ".jrl")
                    {
                        LevelCreatorManager.FileName = FileStr + ".jrl";
                    }
                    else
                    {
                        LevelCreatorManager.FileName = FileStr;
                    }
                }
                else
                {
                    LevelCreatorManager.FileName = LevelCreatorManager.Instance.LevelName + ".jrl";
                }

                LevelCreatorManager.SavePath = PathStr + (string.IsNullOrEmpty(FolderStr) ? "" : @"\" + FolderStr);
            }
            else
            {
                if (!System.IO.File.Exists((string.IsNullOrEmpty(PathStr) ? "" : PathStr + @"\") + FileStr))
                {
                    InfoMessage.ShowError("File: \"" + FileStr + "\" doesn't exist");
                    UpdateShot();
                    return;
                }

                LevelCreatorManager.FileName = FileStr;
                LevelCreatorManager.SavePath = PathStr;
            }

            onSuccessEvent.Invoke();

            gameObject.SetActive(false);
        }