Advertisement
MrKubic

Untitled

Mar 12th, 2017
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using System;
  6.  
  7. public class Write_Save : MonoBehaviour {
  8.  
  9.     public InputField mainInputField;
  10.     public GameObject Pic;
  11.     public GameObject Close;
  12.  
  13.  
  14.     public void Start()
  15.     {
  16.         mainInputField.text = PlayerPrefs.GetString("");
  17.         PlayerPrefs.SetString("", mainInputField.text);
  18.  
  19.         if(mainInputField.text == ""){Pic.SetActive (true);}
  20.     }
  21.  
  22.     public void Update()
  23.     {
  24.  
  25.         if (mainInputField.text == "")
  26.         {
  27.              
  28.             Pic.SetActive(false);
  29.         }
  30.         else
  31.             Pic.SetActive(true);
  32.  
  33.         PlayerPrefs.SetString("", mainInputField.text);
  34.  
  35.     }
  36.  
  37.     public void Click_Close()
  38.     {
  39.         Close.SetActive(false);
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement