Created
July 17, 2017 16:34
-
-
Save JonathanYin/fc9cc3dd2abc933eda35df4d10deb270 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 UnityEngine; | |
public class Note : MonoBehaviour | |
{ | |
private Texture pic1; | |
public GameObject panel; | |
private float open = 0f; | |
public bool toggleBool; | |
public GameObject player; | |
public GameObject player2; | |
private void Start() | |
{ | |
//pic1 = (Texture)Resources.Load("pic1"); | |
} | |
void OnGUI() | |
{ | |
if (player && player2) { | |
if (player.transform.position.x < -1.25 && player2.transform.position.x < -1.25) | |
{ | |
if (GUI.Button(new Rect(150, 375, 20, 20), "?")) | |
{ | |
toggleBool = !toggleBool; | |
panel.SetActive(toggleBool); | |
//Application.OpenURL("Assets\\Resources\\pic1"); | |
//Object img; | |
//img = Resources.Load("pic1"); | |
//GameObject instance = Instantiate(Resources.Load("pic1", typeof(GameObject))) as GameObject; | |
} | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Due to a bug that happened with how the bombs in my game were exploding, I decided to add a warning for players new to my game about how the bug works. This script would create a button that, when pressed, would toggle on and off a canvas which held two images.