Created
June 9, 2019 06:51
-
-
Save bibinba/6a1cbc91064458bd23bda757569b7487 to your computer and use it in GitHub Desktop.
タッチしたらスプライトの色が変わる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
using System; | |
public class touch : MonoBehaviour | |
{ | |
public Image image; | |
[SerializeField] | |
Color btnColor1 = Color.red; | |
[SerializeField] | |
Color btnColor2 = Color.blue; | |
bool btnChangeFlag = true; | |
public void onButton() | |
{ | |
btnChangeFlag = !btnChangeFlag; | |
image.color= btnChangeFlag ? btnColor1 : btnColor2; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment