// Update is called once per frame public virtual void Update() { if (playIn.currentTarget == this.gameObject && playIn.button4 && playerStatus.sheathed && !playerStatus.casting && !playerStatus.unconscious && !playerStatus.slain && !comms.commIn.interactInstantiated && !comms.commIn.dialogueInstantiated && !comms.commIn.inspectInstantiated && !comms.commIn.menuInstantiated) { Flowchart.BroadcastFungusMessage(flowMessage); } comms.Ins = true; }
// Start is called before the first frame update private void OnTriggerEnter(Collider other) { // to do // if (StoryController.) { Flowchart.BroadcastFungusMessage("DialogueEvent"); } }
// Update is called once per frame void Update() { if (flowchart.GetIntegerVariable("InvestigatedNum") == 4 && OS_Invastigated_avialible == true) { Flowchart.BroadcastFungusMessage("OS_Invastigated"); OS_Invastigated_avialible = false; } }
void SwitchToDialogue(int dia) { string message = ""; switch (dia) { case 1: message = "parlour"; break; case 2: message = "incendiarist"; break; case 3: message = "physicist"; break; case 4: message = "scryer"; break; case 5: message = "harpy"; break; case 6: message = "fig"; break; case 7: message = "soul"; break; case 8: message = "brewmaster"; break; case 9: message = "troothsayer"; break; case 10: message = "high"; break; case 11: message = "amourist"; break; case 12: message = "queen"; break; } Flowchart.BroadcastFungusMessage(message); }
// Update is called once per frame void Update() { var ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0)); RaycastHit hit; //射線 if (Physics.Raycast(ray, out hit, raylength)) { if (hit.transform.tag == "doorpuzzle") { if (Input.GetMouseButtonDown(0)) { if (index < 5) { index++; } else { index = 0; } //index = ( 0, 6 ) hit.transform.gameObject.GetComponent <Renderer>().material = password[index]; //改變material ID = (int)Enum.Parse(typeof(doorLock), hit.transform.name); inputPassword[ID] = index; //print(inputPassword[0] +" "+ inputPassword[1]+" " + inputPassword[2] +" "+ inputPassword[3]); //把密碼記下來 } } } if (inputPassword[0] == 3 && inputPassword[1] == 2 && inputPassword[2] == 5 && inputPassword[3] == 4) { Flowchart.BroadcastFungusMessage("magic_Unlock"); lock_vanish(); // gameObject.SetActive(false); } //如果已經解開法陣,讓它慢慢變透明 if (beginVanish == true) { Renderer currentRenderer = gameObject.GetComponent <Renderer>(); if (currentRenderer.material.color.a >= 0) { print(currentRenderer.material.color.a); currentRenderer.material.color -= alpha; print("minus"); print(currentRenderer.material.color.a); } else if (currentRenderer.material.color.a <= 0) { gameObject.SetActive(false); print(currentRenderer.material.color.a); } transport.SetActive(true); } }
// Update is called once per frame void Update() { //ray在camera中間 ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0)); Vector3 forward = transform.TransformDirection(Vector3.forward) * 2; Debug.DrawRay(transform.position, forward, Color.yellow); if (Physics.Raycast(ray, out hit, raylength)) //out是被打到ㄉ { if (Input.GetMouseButtonUp(0)) //按下滑鼠 { if (hit.transform.gameObject.tag == "interactive") //可以使用的道具 { int index = (int)Enum.Parse(typeof(intereactiveIndex), hit.transform.gameObject.name); //檢查點到東西的名稱,把ability的真假值改掉 //print(ability[index]); //debug Destroy(hit.transform.gameObject); } else if (hit.transform.gameObject.tag == "clues") // 要蒐集的物件 { if (hit.transform.gameObject.name == "diary") { diary.gameObject.SetActive(true); } } else if (hit.transform.gameObject.tag == "checking") //調查物件 { if (flowchart.GetBooleanVariable("talking") == false) { player.GetComponent <player_fungus_village>().send_messege(hit.transform.name);//用fungus顯示物品資訊 } if (hit.transform.gameObject.name == "Target_Box") { print("拿到貨物"); Flowchart.BroadcastFungusMessage("check_targetbox"); flowchart.SetBooleanVariable("DoneBoxTask", true); } } else if (hit.transform.gameObject.tag == "Door") { hit.transform.gameObject.GetComponent <Door_controller>().hit(); } } } if (diary.gameObject.activeSelf) { if (Input.anyKey) { diary.gameObject.SetActive(false); } } }
void OnTriggerEnter(Collider other) { if (other.transform.name == "Kyder") { other.transform.GetChild(0).GetComponent <Renderer> ().enabled = false; other.gameObject.GetComponent <Collider> ().enabled = false; Flowchart.BroadcastFungusMessage("GetKyder"); PlayerStatusImage.GetStatus("None"); } }
void OnCollisionEnter(UnityEngine.Collision other) { if (other.transform.name == "Lucas") { Flowchart.BroadcastFungusMessage("LucasTalk01"); PlayerStatusImage.GetStatus("None"); } if (other.transform.name == "Soyna") { Flowchart.BroadcastFungusMessage("SoynaTalk01"); PlayerStatusImage.GetStatus("None"); } if (other.transform.name == "Riven") { Flowchart.BroadcastFungusMessage("RivenTalk01"); PlayerStatusImage.GetStatus("None"); } if (other.transform.name == "Engine") { Flowchart.BroadcastFungusMessage("GetEngine"); PlayerStatusImage.GetStatus("None"); other.transform.GetChild(0).GetComponent <Renderer> ().enabled = false; other.gameObject.GetComponent <Collider> ().enabled = false; } if (other.transform.name == "Redleaf_A" || other.transform.name == "Redleaf_B" || other.transform.name == "Redleaf_C") { other.transform.GetChild(0).GetComponent <Renderer> ().enabled = false; other.gameObject.GetComponent <Collider> ().enabled = false; Destroy(other.gameObject); PlayerStatusImage.GetStatus("None"); //print(RedLeaf); RedLeaf++; } if (other.transform.name == "Sisco") { Flowchart.BroadcastFungusMessage("SiscoTalk01"); PlayerStatusImage.GetStatus("None"); } if ((other.transform.name == "SpaceShip_Door1" || other.transform.name == "SpaceShip_Door2" || other.transform.name == "SpaceShip_Door3") || other.transform.name == "SpaceShip_Door4") { Flowchart.BroadcastFungusMessage("GO"); PlayerStatusImage.GetStatus("None"); } if (other.transform.name == "Mike") { Flowchart.BroadcastFungusMessage("MikeTalk01"); PlayerStatusImage.GetStatus("None"); } if (other.transform.name == "Bill") { Flowchart.BroadcastFungusMessage("BillTalk01"); PlayerStatusImage.GetStatus("None"); } }
/// <summary> /// 购买指定物品 /// </summary> /// <param name="item"></param> public void BuyItem(Item item, int index) { if (RemoveGold(item.BasePrice)) { itemInInventory[index] = item; } else { Flowchart.BroadcastFungusMessage("NoMoney"); } }
// QUESTS END CHECK & ACTIONS void questEndIntroduction() { if (questEnabled == true && GameObject.FindGameObjectsWithTag("Mob").Length == 0) { Debug.Log("Introduction completed"); Flowchart.BroadcastFungusMessage("questEnd"); //inv.addItem (1, 1); questEnabled = false; currentQuestID++; } }
private void OnTriggerEnter2D(Collider2D collision) { //Debug.Log("adasd"); GameObject col_gameobject = collision.gameObject; if (col_gameobject.tag == "Task") { Flowchart.BroadcastFungusMessage(col_gameobject.name); Destroy(col_gameobject); } }
public void StartGame() { if (StartBtn.text == "開始遊戲") { Flowchart.BroadcastFungusMessage("StartGame"); } else if (StartBtn.text == "上一頁") { Flowchart.BroadcastFungusMessage("Back"); } }
protected virtual void OnTrackingLost() { var renderers = GetComponentsInChildren <Renderer>(true); foreach (var item in renderers) { item.enabled = false; } Flowchart.BroadcastFungusMessage("OnTrackingLost"); }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.F) && nearby == true) { canMoveFalse(); if (questManager.questEnabled == false && questManager.getCurrentQuestState == QuestManager.QuestState.UNCOMPLETE) { switch (questManager.getCurrentQuestID) { case 0: Flowchart.BroadcastFungusMessage("veilleurStart"); break; case 1: Flowchart.BroadcastFungusMessage("veilleur2"); break; case 2: Flowchart.BroadcastFungusMessage("veilleur3"); break; case 3: Flowchart.BroadcastFungusMessage("veilleur4"); break; default: Flowchart.BroadcastFungusMessage("veilleurNope"); break; } //Debug.Log ("Quest activated. Quest Source: "+questManager.getQuest (1).getSource+" // Quest Name : "+questManager.getQuest (1).getName+""); //questManager.launchQuest (questManager.getCurrentQuestID); //.Log("Quest activated! ID: "+currentQuest.getID+" // Name: "+currentQuest.getName+""); } else if (questManager.questEnabled == true && questManager.getCurrentQuestState == QuestManager.QuestState.COMPLETE) { switch (questManager.getCurrentQuestID) { case 2: Flowchart.BroadcastFungusMessage("Veilleur 3 End"); break; case 3: Flowchart.BroadcastFungusMessage("Veilleur 4 End"); break; } } else { Flowchart.BroadcastFungusMessage("questActive"); } } }
void OnTriggerEnter() { if (count == 0) { Flowchart.BroadcastFungusMessage("對話1"); count++; } else if (count == 1) { Flowchart.BroadcastFungusMessage("對話2"); count++; } }
private void OnTriggerEnter(Collider other) { if (wasMessageSent) { return; } if (GameManager.GetGameState() == GameStateScriptableObject.GameState.mainGameplayLoop && (other.CompareTag("Player") || other.gameObject.layer == LayerMask.NameToLayer("Player"))) { Flowchart.BroadcastFungusMessage(fungusMessageName); GameManager.DialogueStart(); wasMessageSent = true; } }
private void OnCollisionEnter(UnityEngine.Collision other) { if (other.gameObject.name == "Obstacle") { Flowchart.BroadcastFungusMessage("Collision_Obstacle"); //GameObject.Find("magic_lock").SetActive(true); } else if (other.gameObject.name == "Check_magic_lcok") { Flowchart.BroadcastFungusMessage("Check_magic_lcok"); Destroy(other.gameObject); } }
// Update is called once per frame void Update() { if (box == 3) { Flowchart.BroadcastFungusMessage("BoxDestory"); box = 0; } if (RedLeaf == 3) { Flowchart.BroadcastFungusMessage("RedLeafx3"); RedLeaf = 0; } }
public void StartUsingInteractable() { if (CheckActiveResource()) { UnLocked(); } else { Locked(); } flowchart.SetIntegerVariable("choice", sayInt); Flowchart.BroadcastFungusMessage("WaterHeater"); }
void questEnd2() { QuestTrigger trigger; trigger = FindObjectOfType <QuestTrigger> (); if (trigger.completed == true) { Debug.Log("Location trouvée"); Flowchart.BroadcastFungusMessage("questEnd"); //inv.addItem (1, 4); questEnabled = false; currentQuestID++; } }
// Update is called once per frame public virtual void Update() { if (playIn.currentTarget == this.gameObject && playIn.button3 && playerStatus.sheathed && !playerStatus.casting && !playerStatus.unconscious && !playerStatus.slain && Vector3.Distance(transform.position, playerStatus.gameObject.transform.position) <= minDistance && !comms.commIn.interactInstantiated && !comms.commIn.dialogueInstantiated && !comms.commIn.inspectInstantiated && !comms.commIn.menuInstantiated) { Flowchart.BroadcastFungusMessage(flowMessage); } if (Vector3.Distance(transform.position, playerStatus.gameObject.transform.position) > minDistance) { comms.Dlg = false; } else { comms.Dlg = true; } }
private void BroadcastToFungus(string message, Flowchart flowchart = null) { string fullMessage = (prefixForAllMessages + message).TrimEnd(); if (flowchart == null) { Debug.Log("Message to all flowcharts: «" + fullMessage + "»"); Flowchart.BroadcastFungusMessage(fullMessage); } else { Debug.Log("Message to flowchart " + flowchart.name + ": «" + fullMessage + "»"); flowchart.SendFungusMessage(fullMessage); } }
public void StartUsingInteractable() { flowchart.SetBooleanVariable("inProgress", true); if (CheckActiveResource()) { UnLocked(); } else { Locked(); } flowchart.SetIntegerVariable("choice", sayInt); Flowchart.BroadcastFungusMessage("TaskBox"); }
/// <summary> /// NPC与玩家交互 /// </summary> public void Interaction() { switch (NpcData.NpcType) { case NPCType.Normal: Log.Debug(NpcData.Conversation); Flowchart.BroadcastFungusMessage(NpcData.Conversation); break; case NPCType.Shop: // 打开商店界面 GameEntry.Controller.Shop.OpenShopForm(NpcData.StoreId); break; } }
public void OnCollisionEnter(UnityEngine.Collision other) { switch (other.gameObject.name) { case "Scene_Boundary": if (flowchart.GetIntegerVariable("InvestigatedNum") < 4) { Flowchart.BroadcastFungusMessage("Bumped_Boundary"); } else { Flowchart.BroadcastFungusMessage("Bumped_Boundary_Invastigated"); } break; default: break; } }
// Update is called once per frame void Update() { if (Physics2D.OverlapArea(Range.bounds.min, Range.bounds.max, TargetLayer)) { GO.SetActive(true); if (Input.GetKeyDown(KeyCodeList.Instance.Interactive)) { Flowchart.BroadcastFungusMessage(MessageName); } if (Input.GetKeyDown(KeyCode.Q)) { showItemSlot(); } } else { GO.SetActive(false); } }
private void PickUpResource() { // Debug.Log("PickUp Resource"); GetComponent <BoxCollider2D>().enabled = false; GetComponent <Rigidbody2D>().velocity = Vector3.zero; GetComponent <Rigidbody2D>().isKinematic = true; var key = GetComponent <Key>(); if (key != null) { Flowchart.BroadcastFungusMessage(key.fungusMsg); } canUse = false; inUse = true; transform.parent = GameObject.FindGameObjectWithTag("Player").transform; transform.position = GameObject.FindGameObjectWithTag("Player").transform.position + Vector3.up; }
private void GetResults() // Aquí iría el final de la reacción { Debug.Log("Porcentaje de acierto: " + GetTotalAccuracy() + "%"); if (GetTotalAccuracy() >= level.minTotalAccuracy) { Debug.Log("Nivel superado!"); if (sendFlowchartMessageWhenGameEnds) { Flowchart.BroadcastFungusMessage("GameWon"); } } else { Debug.Log("Nivel no superado..."); if (sendFlowchartMessageWhenGameEnds) { Flowchart.BroadcastFungusMessage("GameLost"); } } }
// Update is called once per frame void Update() { BtnSetActive(); LockPlayer(); ContinuedButton(); if (Input.GetKeyDown(KeyCode.O) && UiController.CG1End) { Flowchart.BroadcastFungusMessage("EscGameOperation"); if (UiController.Teach) { NextButton.SetActive(false); LastButton.SetActive(false); teach1.SetActive(false); teach2.SetActive(false); GameOperation.SetActive(false); PageText.text = ""; PageNumer = 0; } else if (!UiController.Teach && !teach1.activeSelf) { teach1.SetActive(true); NextButton.SetActive(true); PageNumer = 1; PageText.text = "1/3"; } } if (Input.GetKeyDown(KeyCode.P)) { if (EscCount == 0) { ExitButton.SetActive(true); EscCount = 1; } else { ExitButton.SetActive(false); EscCount = 0; } } }
void OnCollisionEnter(UnityEngine.Collision other) { if (GetBread && other.transform.name == "Rose") { Rose = GameObject.Find("Rose"); Flowchart.BroadcastFungusMessage("GiveBread"); PlayerStatusImage.GetStatus("None"); } if (other.transform.name == "PrinceHome_Door") { Flowchart.BroadcastFungusMessage("RoseGoHome"); Flowchart.BroadcastFungusMessage("SecGoHome"); PlayerStatusImage.GetStatus("None"); } if (other.transform.name == "GlassRepair") { Flowchart.BroadcastFungusMessage("FindGP"); PlayerStatusImage.GetStatus("None"); } if (!Ship && (other.transform.name == "Mt.SpaceShip_Door1" || other.transform.name == "Mt.SpaceShip_Door2" || other.transform.name == "Mt.SpaceShip_Door3")) { Flowchart.BroadcastFungusMessage("GoShip"); PlayerStatusImage.GetStatus("None"); } if (other.transform.name == "Marley") { Flowchart.BroadcastFungusMessage("MarletTalk"); PlayerStatusImage.GetStatus("None"); } if (other.transform.name == "AnotherHouse_Door1" || other.transform.name == "AnotherHouse_Door2" || other.transform.name == "AnotherHouse_Door3") { Flowchart.BroadcastFungusMessage("HouseTalk"); PlayerStatusImage.GetStatus("None"); } if (other.transform.name == "WareHouse_Door") { Flowchart.BroadcastFungusMessage("WareHouseTalk"); PlayerStatusImage.GetStatus("None"); } }