void CheckToOpenDoor() { if ((variableStorage.GetValue("$open_door").AsBool == true) && (thisCharacter == Characters.MartinDoor)) { gameObject.SetActive(false); roomShade.FadeOut(); } else if ((variableStorage.GetValue("$open_door").AsBool == false) && (thisCharacter == Characters.MartinDoor)) { roomShade.FadeIn(); } if ((variableStorage.GetValue("$open_door").AsBool == true) && (thisCharacter == Characters.WilliamsDoor)) { print("Door Disabled Williams"); roomShade.FadeOut(); gameObject.GetComponent <SpriteRenderer>().enabled = false; gameObject.GetComponent <BoxCollider2D>().enabled = false; //talkToNode = null; gameObject.transform.GetChild(0).gameObject.SetActive(false); } if ((variableStorage.GetValue("$open_door").AsBool == false) && (thisCharacter == Characters.WilliamsDoor)) { gameObject.GetComponent <SpriteRenderer>().enabled = true; gameObject.GetComponent <BoxCollider2D>().enabled = true; roomShade.FadeIn(); } }
public void fadeGraceJosephIn() { fade = gameObject.GetComponent<FadeObjectInOut> (); megaCache = gameObject.GetComponent<MegaCacheOBJ> (); fade.FadeIn (); megaCache.animate = true; }
// Update is called once per frame void Update() { if (Camera.main == null) { return; } float distToCam = (transform.position - Camera.main.transform.position).magnitude; if (distToCam < threshhold) { if (fader != null && !faded) { fader.FadeOut(); } faded = true; } else { if (faded) { fader.FadeIn(); faded = false; } } }
void OnTriggerExit(Collider other) { if (other.GetComponent <PlayerCharacterController>() != null && --heroCount == 0) { fade.FadeIn(); } }
public void fadeGhostsIn() { fade = gameObject.GetComponent<FadeObjectInOut> (); megaCache = gameObject.GetComponent<MegaCacheOBJ> (); megaCache.animate = true; fade.fadeTime = 0.5f; fade.FadeIn (); }
public void StateChange(bool currentState) { if (currentState != dayTime) { if (dayTime == true) { if (flower_elevator != null) { foreach (GameObject flower in flower_elevator) { if (flower.GetComponent <ChangeToDay>() != null) { Destroy(flower.GetComponent <ChangeToDay>()); } if (flower.GetComponent <ChangeToNight>() == null) { flower.AddComponent <ChangeToNight>(); } } } //flower.Change(); dayTime = false; fday.FadeOut(0.8f); night.SetActive(true); cameraNight.SetActive(true); SetAllCollidersStatus(day, false); dayBGM.Stop(); nightBGM.Play(); } else { foreach (GameObject flower in flower_elevator) { if (flower.GetComponent <ChangeToNight>() != null) { Destroy(flower.GetComponent <ChangeToNight>()); } if (flower.GetComponent <ChangeToDay>() == null) { flower.AddComponent <ChangeToDay>(); } } //System.Threading.Thread.Sleep(2000); //flower.Change(); dayTime = true; fday.FadeIn(0.6f); night.SetActive(false); cameraNight.SetActive(false); SetAllCollidersStatus(day, true); dayBGM.Play(); nightBGM.Stop(); } } }
//FlowerGrowShrink flower; //public GameObject[] nightObjects = GameObject.FindGameObjectsWithTag("Night"); //public GameObject[] dayObjects = GameObject.FindGameObjectsWithTag("Day"); private void Start() { fday = day.AddComponent <FadeObjectInOut>(); fnight = day.AddComponent <FadeObjectInOut>(); fday.FadeIn(); dayBGM.Play(); nightBGM.Stop(); //flower = new FlowerGrowShrink(); }
// Use this for initialization void Start() { //Renderer r = this.gameObject.GetComponent<Renderer> (); //r.material.SetColor ("_Color", new Color (0, 0, 0, 0)); fader = this.gameObject.GetComponent <FadeObjectInOut> (); fader.logInitialFadeSequence = true; fader.FadeIn(); StartCoroutine(FadeOut()); }
public void DisplayTooltip() { PlayHighlightSound(); tooltipText.text = tooltipMessage; if (tooltipFader.visible == false) { tooltipFader.FadeIn(1f); } }
public void activateMarkers(int i) { GameObject marker = GameObject.FindGameObjectWithTag ("lp" + i); amis = marker.GetComponents<AdjacentMarkerIdentifier> (); foreach (AdjacentMarkerIdentifier ami in amis) { GameObject newMarker = GameObject.FindGameObjectWithTag("lp"+ami.markerToActivate); fade = newMarker.GetComponent<FadeObjectInOut> (); fade.FadeIn (); coll = newMarker.GetComponent<MeshCollider> (); coll.enabled = true; } }
// Use this for initialization void Start() { //find all location markers locationMarkers = GameObject.Find ("LocationMarkers"); locationPoints=locationMarkers.GetComponentsInChildren<Transform> (); //For each location marker disable the renderer and collider for (int i=0; i<locationPoints.Length; i++) { if (locationPoints[i].gameObject.name!="LocationMarkers"){//Don't add these to the parent locationPoints[i].gameObject.AddComponent<FadeObjectInOut>(); fade = locationPoints[i].gameObject.GetComponent<FadeObjectInOut>(); fade.FadeOut(0.01f); coll = locationPoints[i].gameObject.GetComponent<MeshCollider>(); coll.enabled=false; locationPoints[i].gameObject.tag="lp"+i; } } GameObject firstMarker = GameObject.FindGameObjectWithTag ("lp1"); fade = firstMarker.GetComponent<FadeObjectInOut> (); fade.FadeIn (); coll = firstMarker.GetComponent<MeshCollider> (); coll.enabled = true; }