using System.Collections;
using System.Collections.Generic;
using JetBrains.Annotations;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class ImgChange : MonoBehaviour
{
public Image imageToChange; // 변경할 이미지를 가리키는 변수
public Sprite newImage; // 새로운 이미지
private bool ImgCheck = false;
public void ChangeImage()
{
if(ImgCheck){
Debug.Log("성공--------------");
SceneManager.LoadScene("scene2");
} else {
ImgCheck = true;
imageToChange.sprite = newImage; // 이미지 변경
}
}
// Start is called before the first frame update
void Start()
{
// Debug.Log("메롱");
}
// Update is called once per frame
void Update()
{
// Debug.Log("메롱메롱");
}
using System.Collections; using System.Collections.Generic; using JetBrains.Annotations; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement;
public class ImgChange : MonoBehaviour { public Image imageToChange; // 변경할 이미지를 가리키는 변수 public Sprite newImage; // 새로운 이미지
}