private void destroyScript() { vitals.setDrunkState(false); //deletes this game object Destroy(gameObject); print("You sober again boi!"); }
// Use this for initialization private void Start() { //get some components & objects GameObject player = GameObject.Find("Character"); vitals = player.GetComponent <Vitals>(); vitals.setDrunkState(true); FPPCamera = player.transform.Find("FPPCamera").GetComponent <Camera>(); //get the 2 sub images within the drunk canvas object drunkOverlay = transform.Find("DrunkOverlay").GetComponent <Image>(); drunkFade = transform.Find("Fade").GetComponent <Image>(); //get the initial fov initialFOV = FPPCamera.fieldOfView; }