Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
public class Switch_Backgrounds : MonoBehaviour { | ||
public Sprite new_background; | ||
private GameObject bill_dialogue_closing; | ||
private bool swap; | ||
|
||
void Awake(){ | ||
bill_dialogue_closing = GameObject.Find ("bill_dialogue_controller"); | ||
} | ||
// Update is called once per frame | ||
void Update () { | ||
if (GameObject.FindGameObjectsWithTag("dialogue").Length<=1 && !swap){ | ||
GetComponent<SpriteRenderer>().sprite = new_background; | ||
bill_dialogue_closing.GetComponent<Chat_text>().enabled = true; | ||
bill_dialogue_closing.GetComponent<Dialogue_controller>().enabled = true; | ||
swap = true; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
public class Ant_Name : MonoBehaviour { | ||
public string name; | ||
public int[] cutscenes = new int[3]; | ||
public Vector3 display_location; | ||
public GUIStyle style; | ||
private Camera camera; | ||
// Use this for initialization | ||
void Start () { | ||
DontDestroyOnLoad (gameObject); | ||
} | ||
|
||
void Update(){ | ||
foreach (int scene_number in cutscenes) { | ||
if(Application.loadedLevel == scene_number){ | ||
camera = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<Camera> (); | ||
Debug.Log("Yeah butty"); | ||
Vector3 screen_coords = camera.WorldToScreenPoint(display_location); | ||
Debug.Log("display_location: "+display_location); | ||
Debug.Log("screen_coords: "+screen_coords); | ||
GUI.Label(new Rect(screen_coords.x,screen_coords.y,300,1000),name,style); | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.