public void Start() { if (interactText == null) { interactText = GameObject.Find("MiniGameClose").transform.Find("GUI").GetComponent <GuiDisplayer>().GetInteract(); } // get reference for inventory manipulation if (hasItem) { inventory = Systems.Inventory; } // materials for material blinking if (BlinkWhenPlayerNear) { mat_original = gameObject.GetComponent <MeshRenderer>().material; mat_blink = Resources.Load("Materials/Transparent Object 1", typeof(Material)) as Material; _meshRenderer = GetComponent <MeshRenderer>(); } if (BlinkOnInteract) { mat_original = gameObject.GetComponent <MeshRenderer>().material; mat_blinkOnce = Resources.Load("Materials/Transparent Object 1", typeof(Material)) as Material; //pick another color (blue) how? _meshRenderer = GetComponent <MeshRenderer>(); } }
public override bool Use(ref Item i) { Item item; if (Systems.Inventory.HasItem((item = Resources.Load <Item>("Items/DirtyMustardWater")), 1)) { Systems.Inventory.RemoveItem(Resources.Load <Item>("Items/PurificationTablet"), 4); Systems.Inventory.RemoveItem(item, 1); Systems.Inventory.AddItem(Resources.Load <Item>("Items/CleanMustardWater"), 1); _banner = GameObject.Find("GUI").GetComponent <GuiDisplayer>().GetBanner(); string current = _banner.info.text; if (current.Contains(", and clean water")) { current = current.Replace(", and clean water", ""); current = current.Replace(", ", ", and "); } current = current.Replace(", clean water", ""); current = current.Replace(" clean water,", ""); current = current.Replace("Find and", "Find"); if (current == "Find ") { _banner.ChangeText("Talk to survivors"); } //things left on list to find else { _banner.ChangeText(current); } } return(false); }
private void MiniGameFinished() { Systems.Status.UnPause(); SceneManager.UnloadSceneAsync(MiniGameSceneName); Systems.Objectives.Satisfy("TOILETEVENT"); camera.SetActive(true); vcam.SetActive(true); canvi.SetActive(true); sunlight.SetActive(true); levelMusic.SetActive(true); toiletMusic.SetActive(false); _inventory.RemoveItem(Bucket, 2); _inventory.RemoveItem(Bag, 1); _inventory.RemoveItem(Sawdust, 1); // _inventory.RemoveItem( Sanitizer, 1); // _inventory.RemoveItem( ToiletPaper, 1); UIManager.Instance.ToggleActive(theGUI); _canvi = GameObject.Find("GUI").GetComponent <GuiDisplayer>().GetBanner(); _canvi.ChangeText("Talk to Ahmad"); Buckets.SetActive(true); Spot.SetActive(false); //Destroy(gameObject); //Destroy(this); Systems.Status.AffectRelief(100); GameObject.Find("MeterDing").GetComponent <AudioSource>().Play(); Systems.Status.SpeedUpWarmthLoss(); }
private void Start() { StartCoroutine(nameof(QuakeCountdown), TimeBeforeQuake); doors = GameObject.FindGameObjectsWithTag("Door"); bodies = Array.ConvertAll(doors, d => d.GetComponent(typeof(Rigidbody)) as Rigidbody); clobberers = Array.ConvertAll(doors, d => d.GetComponent(typeof(Clobberer)) as Clobberer); _informationCanvas = GameObject.Find("Canvi").transform.Find("GUI").GetComponent <GuiDisplayer>().GetBanner(); }
void Awake() { clock = FindObjectOfType <Clock>(); infoDisplay = FindObjectOfType <InformationCanvas>(); instructionDisplay = FindObjectOfType <InstructionCanvas>(); meterDisplay = FindObjectOfType <MeterCanvas>(); musicMat = FindObjectOfType <MusicMat>().GetComponent <VisibilityToggle>(); playerController = FindObjectOfType <PlayerController>(); scoreDisplays = FindObjectsOfType <ScoreCanvas>(); swarm = FindObjectOfType <Swarm>(); titleDisplay = FindObjectOfType <TitleCanvas>(); }
private void Start() { StartCoroutine(nameof(QuakeCountdown), TimeBeforeQuake); doors = GameObject.FindGameObjectsWithTag("Door"); bodies = Array.ConvertAll(doors, d => d.GetComponent(typeof(Rigidbody)) as Rigidbody); clobberers = Array.ConvertAll(doors, d => d.GetComponent(typeof(Clobberer)) as Clobberer); Sink = GameObject.Find("Kitchen Sink").gameObject; _informationCanvas = GameObject.Find("MiniGameClose").transform.Find("GUI").GetComponent <GuiDisplayer>().GetBanner(); virtualCameraNoise = VirtualCamera.GetCinemachineComponent <Cinemachine.CinemachineBasicMultiChannelPerlin>(); logger = GameObject.Find("Logger").GetComponent <LogToServer>(); }
public override void DoOutcome(ref NPC n) { find = Find; _satisfied = false; if ((Systems.Objectives.Register(ObjectiveName, () => _satisfied = true))) { //this is the offending statement Systems.Objectives.Satisfy(ObjectiveName); } _banner = GameObject.Find("GUI").GetComponent <GuiDisplayer>().GetBanner(); current = _banner.info.text; shorten = words.Replace("Find ", ""); //no repeats if (current.Contains(shorten) || (ItemToFind != null && Systems.Inventory.HasItem(ItemToFind, 1))) { find = false; } //for any find task if (find) { // Find task if (words.Contains("Find") && current.Contains("Find")) { current = current.Replace(" and ", ", "); current = current + " and " + shorten; _banner.ChangeText(current); } // any task to replace entire banner else { _banner.ChangeText(words); } } //for any found task if (Found) { Debug.Log("Found item"); //if there are three or more things if (current.Contains(" and " + shorten)) //if the found item is the last in the list { //remove the found item from the list current = current.Replace(" and " + shorten, ""); //add "and" in place of commas current = current.Replace(", ", " and "); } //if the found item is not the last in the list else { current = current.Replace(shorten + ", ", ""); //if there are commas between the items current = current.Replace(shorten + " and ", ""); //if there is an and after the found item } //current = current.Replace(shorten, ""); //current = current.Replace(" ,", ""); current = current.Replace(", and ", " and "); current = current.Replace("Find and", "Find"); //if there is nothing to find // found everything go to franks yard in L3 if (Systems.Inventory.HasItem(Resources.Load <Item>("Items/CleanMustardWater"), 1) && Systems.Inventory.HasItem(Resources.Load <Item>("Items/Rope"), 1) && Systems.Inventory.HasItem(Resources.Load <Item>("Items/Shovel"), 1)) { _banner.ChangeText("Find Frank's back yard"); } /* * else if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/Shovel"), 1)) * { * _banner.ChangeText("Find a rope"); * } * * else if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/Rope"), 1)) * { * _banner.ChangeText("Find a shovel"); * } */ //else if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/DirtyMustardWater"), 1)) //{ // _banner.ChangeText("Add tablets from inventory to clean water"); //} //else if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/Gun"), 1)) //{ // _banner.ChangeText("Throw away the gun, then ask Zelda to enter the shelter"); //} //else if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/Gun"), 0)) //{ // _banner.ChangeText("Enter the shelter"); //} //else if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/CleanMustardWater"), 1)) //{ // _banner.ChangeText("Go talk to Zelda"); //} //if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/DirtyMustardWater"), 1)) //{ // _banner.ChangeText("Add tablets from inventory to clean water"); //} // if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/CleanMustardWater"), 1) && Systems.Inventory.HasItem(Resources.Load<Item>("Items/Shovel"), 1)) // { // _banner.ChangeText("Talk to Frank about building a pit latrine"); // } //found everything for now but more things to find else if (current == "Find") { _banner.ChangeText("Talk to survivors"); } //things left on list to find else { _banner.ChangeText(current); } } if (completeReset) { _banner.ChangeText(resetTo); } }
void RayPointedOut() { // TODO : Mouse Exit (SHJO) if(pointed != null) { //hit.collider.gameObject.renderer.material.color=Color.red; pointed.PointedOut(); pointed=null; } else if(MainMenu_pointed !=null) { MainMenu_pointed.PointedOut(); MainMenu_pointed = null; } else if (Information_pointed != null) //add Jin { Information_pointed.PointedOut(); Information_pointed = null; } else if (InformationButton_pointed != null) //add Jin { InformationButton_pointed.PointedOut(); InformationButton_pointed = null; } else if (InfoCanvas_pointed != null) //add Jin { InfoCanvas_pointed.PointedOut(); InfoCanvas_pointed = null; } }
void RayPoint() { if(hit.collider != null) { target.transform.position = hit.transform.position; if(hit.collider.gameObject.tag == "Button") { pointed = hit.collider.gameObject.GetComponent<Button>(); if(pointed != null) { pointed.Pointed(); } } else if(hit.collider.gameObject.tag == "MainMenu") { MainMenu_pointed = hit.collider.gameObject.GetComponent<MainMenu>(); if(MainMenu_pointed != null) { // TODO : Mouse Enter (HJOOn) MainMenu_pointed.Pointed(); } } else if (hit.collider.gameObject.tag == "Information") //Information 버튼 구현(add Jin) { Information_pointed = hit.collider.gameObject.GetComponent<Information>(); if (Information_pointed != null) { Information_pointed.Pointed(); } } else if (hit.collider.gameObject.tag == "InformationButton") //Information 버튼 구현(add Jin) { InformationButton_pointed = hit.collider.gameObject.GetComponent<InformationButton>(); if (InformationButton_pointed != null) { InformationButton_pointed.Pointed(); } } else if (hit.collider.gameObject.tag == "InformationCanvas") //Information 버튼 구현(add Jin) { InfoCanvas_pointed = hit.collider.gameObject.GetComponent<InformationCanvas>(); if (InfoCanvas_pointed != null) { InfoCanvas_pointed.Pointed(); } } } }