void OnTriggerEnter(Collider other) { if (other.tag == "Player" && trigger == TriggerType.SimpleTrigger && CheckTokens()) { ConversationController.Enable(this); } }
// A function so other scripts can provide a conversation to play. public void ApplyConversation(string[] newConversation) { if (newConversation.Length == 0) { DisableLetters(); choices = new string[0]; choiceConvoPointers = new string[0]; } else { ParseTags(newConversation); // Silly glitch again with no-op text assignment. See above function. if (newConversation[0] == textBase.text) { newConversation[0] += " "; } } conversation = newConversation; DeleteChoices(); Reset(); // Extra work for nowhere conversations... Can't exactly "scroll" nothing. if (conversation.Length == 0) { scrolling = false; ConversationController.SoftDisable(); } }
public ConversationView(uint id, bool styleChoice) { // Create the controller controller = new ConversationController(id); // Handlers for external events controller.NewSay += new ConversationController.ExternalEventHandler(OnNewSay); controller.ChangeUserState += new ConversationController.ExternalEventHandler(OnChangeUserState); controller.ReceivedPartnerInfo += new ConversationController.ExternalEventHandler(OnReceivedParnterInfo); // Register the controller handlers to the service controller.RegisterHandlers(); // Initialize Component InitializeComponent(); _styleChoice = styleChoice; _id = id; // Set the parent and display the window SetMdiParent(); ShowForm(); // Handlers for internal events this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FriendListView_FormClosing); }
public override void SetState(ConversationController conversationController) { GameObject.FindGameObjectWithTag ("Banker").GetComponent<NPCController> ().SetDirection (new Vector2 (1, 0)); // load variables if (conversationController.dialogueEngine.checkVar ("SawIntroCutscene")) { GameObject.FindGameObjectWithTag("GameController").GetComponent<Controller>().LoadCutsceneResults("Intro"); } if (conversationController.dialogueEngine.checkVar ("FoundID")) { GameObject.FindGameObjectWithTag("BraydensID").GetComponent<InventoryItemController>().Enable(); GameObject.FindGameObjectWithTag("WashingMachine").GetComponent<InventoryItemController>().Enable(); Destroy(GameObject.FindGameObjectWithTag("THEWasher")); } if (conversationController.dialogueEngine.checkVar ("BraydenIDReturned")) { GameObject.FindGameObjectWithTag ("BraydensID").GetComponent<InventoryItemController> ().Disable (); NPCController brayden = GameObject.FindGameObjectWithTag("Brayden").GetComponent<NPCController>(); brayden.SetPosition (new Vector2 (-33.117f, 0.657f)); brayden.SetDirection(new Vector2(-1, 0)); } if (conversationController.dialogueEngine.checkVar ("ShowedID")) { NPCController bouncer = GameObject.FindGameObjectWithTag("Bouncer").GetComponent<NPCController>(); bouncer.SetPosition (new Vector2 (-17.62f, -0.05f)); bouncer.SetDirection(new Vector2(0, -1)); } if (conversationController.dialogueEngine.checkVar ("HasMoney")) { GameObject.FindGameObjectWithTag ("Money").GetComponent<InventoryItemController> ().Enable (); } }
void OnTriggerStay(Collider other) { if (other.tag == "Player" && trigger == TriggerType.ButtonTrigger && Input.GetKey(keyRequired) && CheckTokens()) { ConversationController.Enable(this); } }
public ConversationView(uint id, bool styleChoice) { // Create the controller controller = new ConversationController(id); // Handlers for external events controller.NewSay += new ConversationController.ExternalEventHandler(OnNewSay); controller.ChangeUserState += new ConversationController.ExternalEventHandler(OnChangeUserState); controller.ReceivedPartnerInfo += new ConversationController.ExternalEventHandler(OnReceivedParnterInfo); // Register the controller handlers to the service controller.RegisterHandlers(); // Initialize Component InitializeComponent(); _styleChoice = styleChoice; _id = id; // Set the parent and display the window SetMdiParent(); ShowForm(); // Handlers for internal events this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FriendListView_FormClosing); }
void MakeCallback() { if (BotScenario != null) { //Init callbacks args. callbackArgs.ChatHandlerCallbackArgs1.NewMessages = newMsg1; //callbackArgs.ChatHandlerCallbackArgs1.IsStillTalking = isTalk1; //callbackArgs.ChatHandlerCallbackArgs1.IsSearchingCompanion = isSearch1; callbackArgs.ChatHandlerCallbackArgs2.NewMessages = newMsg2; //callbackArgs.ChatHandlerCallbackArgs2.IsStillTalking = isTalk2; //callbackArgs.ChatHandlerCallbackArgs2.IsSearchingCompanion = isSearch2; //Scenario ConversationController.OnCallback(callbackArgs); //Handle result of callback args. if (callbackArgs.IsCompleted != null) { FinishConversation((bool)callbackArgs.IsCompleted); } SendMessages(Chat1, callbackArgs.ChatHandlerCallbackArgs1.MessagesToSend); SendMessages(Chat2, callbackArgs.ChatHandlerCallbackArgs2.MessagesToSend); } }
protected override void FetchReferences() { base.FetchReferences(); data = DataController.Instance; characters = CharacterController.Instance; messaging = ConversationController.Instance; }
public void Initialize() { mockStore = new Mock <IConversationStore>(); mockLogger = new Mock <ILogger <ConversationController> >(); mockService = new Mock <INotificationServiceClient>(); mockClient = TestUtils.GenerateClient(); myController = new ConversationController(mockStore.Object, mockLogger.Object, mockClient, mockService.Object); }
public ConversationControllerTest() { _mockContext = new Mock <DataContext>(); _mockRepo = new Mock <IConversationRepository>(); _mockMapper = new Mock <IMapper>(); _urlHelper = new Mock <IUrlHelper>(); _conversationController = new ConversationController(_mockRepo.Object, _mockMapper.Object, _urlHelper.Object); }
public void Interact(Helpers.Direction fromDirection) { FaceDirection(fromDirection); ConversationController conversationController = FindObjectOfType <ConversationController> (); conversationController.StartConversation(name, thingsToSay); }
void Start() { GetComponentInChildren <Text>().text = choiceText; GetComponent <Button>().onClick.AddListener(() => // Adds an event to the button { ConversationController.Enable(choicePointer); ConversationTrigger.AddToken(choiceToken); }); }
public void CloseDialogue() { ConversationController conversation = DialogueManager.ConversationController; if (conversation != null) { conversation.Close(); } }
protected override void Awake() { base.Awake(); conversationController = owner.GetComponentInChildren <ConversationController>(); // Resources 폴더에 있는 파일을 로드합니다. // 이렇게 런타임 중에 파일을 로드하려면 Resources 폴더에 파일이 있어야합니다. data = Resources.Load <ConversationData>("Conversations/IntroScene"); }
public void Awake() { if (ConversationController.instance == null) { instance = this; } else if (this != instance) { Destroy(this.gameObject); } }
public override void SetState(ConversationController conversationController) { GameObject.Find ("StateController").GetComponent<StateController> ().npcImageMap.SetImage ("Cocktail God", "Cocktail God Sunglasses"); // load variables if (conversationController.dialogueEngine.checkVar ("SawIntroCutscene")) { GameObject.FindGameObjectWithTag ("GameController").GetComponent<Controller> ().LoadCutsceneResults ("Intro"); } else { GameObject.FindGameObjectWithTag ("GameController").GetComponent<Controller> ().LoadCutscene ("Intro"); } if (conversationController.dialogueEngine.checkVar ("HasFakeID")) { GameObject.Find("Money").GetComponent<InventoryItemController>().Disable(); GameObject.Find("Fake ID").GetComponent<InventoryItemController>().Enable(); } if (conversationController.dialogueEngine.checkVar ("HasBear")) { GameObject.Find("Bear").GetComponent<InventoryItemController>().Enable(); } if (conversationController.dialogueEngine.checkVar ("HasHat")) { GameObject.Find("Hat").GetComponent<InventoryItemController>().Enable(); Destroy(GameObject.Find("Crockett")); } if (conversationController.dialogueEngine.checkVar ("HasTail")) { GameObject.Find("Tail").GetComponent<InventoryItemController>().Enable(); } if (conversationController.dialogueEngine.checkVar ("HasSunglasses")) { GameObject.Find("Sunglasses").GetComponent<InventoryItemController>().Enable(); GameObject.Find ("StateController").GetComponent<StateController> ().npcImageMap.SetImage ("Cocktail God", "Cocktail God"); } if (conversationController.dialogueEngine.checkVar ("WearingMoustache") && conversationController.dialogueEngine.checkVar ("WearingSunglasses")) { GameObject.FindGameObjectWithTag("PlayerImage").GetComponent<Image>().sprite = (Sprite) Resources.Load ("Images/BlakeDisguise", typeof(Sprite)); GameObject.Find("Tail").GetComponent<InventoryItemController>().Disable(); GameObject.Find("Sunglasses").GetComponent<InventoryItemController>().Disable(); } else if (conversationController.dialogueEngine.checkVar ("WearingMoustache")) { GameObject.FindGameObjectWithTag("PlayerImage").GetComponent<Image>().sprite = (Sprite) Resources.Load ("Images/BlakeMoustache", typeof(Sprite)); GameObject.Find("Tail").GetComponent<InventoryItemController>().Disable(); } else if (conversationController.dialogueEngine.checkVar ("WearingSunglasses")) { GameObject.FindGameObjectWithTag("PlayerImage").GetComponent<Image>().sprite = (Sprite) Resources.Load ("Images/BlakeSunglasses", typeof(Sprite)); GameObject.Find("Sunglasses").GetComponent<InventoryItemController>().Disable(); } if (conversationController.dialogueEngine.checkVar ("FakeIDSuccess")) { NPCController bouncer = GameObject.FindGameObjectWithTag("Bouncer").GetComponent<NPCController>(); bouncer.SetPosition (new Vector2 (1.39f, -5.72f)); bouncer.SetDirection(new Vector2(0, -1)); } }
public void OnMouseExit() { if (this.enabled) { ConversationTrigger.RemoveToken(displayTokens[0]); if (displayTokens.Length > 1) { ConversationTrigger.RemoveToken(displayTokens[1]); } ConversationController.Disable(); } }
// called when player clicks the "Put Away Fuser" button public void putAwayFuserAndStartTask() { putAwayButton.gameObject.SetActive(false); lowPowerText.enabled = false; Deselect(); //disable mouse cursor ConversationController.LockMouse(); enablePlayerControl(); screenFader.fadeIn(0.2f); ConversationTrigger.AddToken("findBatteries"); }
public void disableTooltips() { allTooltips = FindObjectsOfType <Tooltip>(); for (int i = 0; i < allTooltips.Length; i++) { allTooltips[i].enabled = false; for (int t = 0; t < allTooltips[i].displayTokens.Length; t++) { ConversationTrigger.RemoveToken(allTooltips[i].displayTokens[t]); } } // makes any currently displayed tooltip go away ConversationController.Disable(); }
// Start is called before the first frame update void Start() { if (GameObject.Find("ConversationController") != null) { conversationController = GameObject.Find("ConversationController").GetComponent <ConversationController>(); } flagManager = GameObject.Find("FlagManager").GetComponent <FlagManager>(); gameClear = GameObject.Find("NextStage").GetComponent <GameClear>(); if (GameObject.Find("Data") != null) { data = GameObject.Find("Data").GetComponent <Data>(); } canvasGroup = GetComponent <CanvasGroup>(); scenetime = 0; }
public bool Load(bool server) { model.Load(); model.LocalNode.Host = interfaceController.CheckAddress(model.LocalNode.Host); //User chose to quit rather than select an interface =s if (string.IsNullOrEmpty(model.LocalNode.Host)) { return(false); } model.CheckSetDefaults(); updateChecker.Run(); //Immediatly send model upates model.LocalNode.PropertyChanged += LocalNode_PropertyChanged; if (!server) { //Register FAP protocol string location = Assembly.GetCallingAssembly().Location; registerProtocolService.Register("fap", location, "-url \"%1\""); //Delete any empty folders in the incomplete folder RemoveEmptyFolders(model.IncompleteFolder); LogManager.GetLogger("faplog").Debug("Client started with ID: {0}", model.LocalNode.ID); model.DownloadQueue.Load(); shareInfo = container.Resolve <ShareInfoService>(); shareInfo.Load(); shareController = new SharesController(container, model); shareController.Initalise(); popupController = container.Resolve <PopupWindowController>(); conversationController = (ConversationController)container.Resolve <IConversationController>(); watchdogController = container.Resolve <WatchdogController>(); watchdogController.Start(); if (!model.DisplayedHelp) { ShowQuickStart(); } } return(true); }
// Start is called before the first frame update public void OnTriggerEnter(Collider other) { if ((other.gameObject.name == "Cat") && (other.gameObject.GetComponent <Cat>().GetLevel() < 1)) { if (dialogBox == null) { dialogBox = FindObjectOfType <ConversationController>(); OnTriggerEnter(other); return; } //FindObjectOfType<UIController>().ActivateUI(); //FindObjectOfType<ConversationController>() dialogBox.OpenConversation(); //FindObjectOfType<ConversationController>() dialogBox.UpdateConversation("Woah, that fire looks hot. Better find something wet before you singe your paws!"); } }
// Start is called before the first frame update public void OnTriggerEnter(Collider other) { if ((other.gameObject.name == "Cat") && (other.gameObject.GetComponent <Cat>().GetLevel() < 3)) { if (dialogBox == null) { dialogBox = FindObjectOfType <ConversationController>(); OnTriggerEnter(other); return; } //FindObjectOfType<UIController>().ActivateUI(); //FindObjectOfType<ConversationController>() dialogBox.OpenConversation(); //FindObjectOfType<ConversationController>() dialogBox.UpdateConversation("Everything here looks really heavy. A cat probably can't move it without a force as strong as a hurricane."); } }
private void Start() { TextMeshProUGUI buttonTMP = GetComponent <Button>().GetComponentInChildren <TextMeshProUGUI>(); //Get button text if (questionController.rigthToLeft) { buttonTMP.isRightToLeftText = true; } buttonTMP.text = choice.text; //If the instances are not assigned they will be searched in the scene if (conversationController == null) { conversationController = FindObjectOfType <ConversationController>(); } if (questionController == null) { questionController = FindObjectOfType <QuestionController>(); } }
// Use this for initialization void Start() { cameraController = GetComponent <MainCameraController>(); ioController = GetComponent <InputController>(); convoController = GetComponent <ConversationController>(); hero = GameObject.Find("Hero").GetComponent <HeroController>(); drunkBarStartingScale = drunkBar.transform.localScale; pointsText = pointsTextObject.GetComponent <Text>(); drunkLevel = 0; startingDrunkLevel = 50; currentPoints = 0; selectionGroupDepth = -4.0f; blackedOut = false; blackOutTimer = 3.0f; heroDrunk = false; brownOutTimer = 10.0f; WipeUI(); UpdateUI(); }
// Use this for initialization void Start() { grid = GetComponent <GridController>(); cameraController = GetComponent <MainCameraController>(); itemController = GetComponent <InteractableController>(); uiController = GetComponent <InterfaceController>(); convoController = GetComponent <ConversationController>(); textController = GetComponent <TextController>(); hero = GameObject.Find("Hero").GetComponent <HeroController>(); isScrolling = false; canClick = true; canScroll = true; scrollTimerVal = .2f; isScrollingTimer = scrollTimerVal; supportsMultiTouch = Input.multiTouchEnabled; textShowing = false; clickTimer = 0.0f; mouseX = 0.0f; mouseY = 0.0f; }
void FixedUpdate() { if (trigger == TriggerType.Instant || trigger == TriggerType.HardInstant) { timer += Time.deltaTime; if (timer > 0.25f && CheckTokens() && (!ConversationController.currentlyEnabled || trigger == TriggerType.HardInstant)) { timer = 0f; //Debug.Log("Token already exists in dict: " + conversationName); if (trigger == TriggerType.HardInstant) { tokens.Add("HardInstant_" + conversationName); } ConversationController.Enable(this); } else if (timer > 0.5f) { timer = 0f; } } }
public void ConversationControllerTest() { initializeMocksObject(); convCtrl = new ConversationController(mockUserFem.Object, mockStudySession.Object); }
protected override void Awake() { base.Awake(); conversationController = Owner.GetComponentInChildren <ConversationController>(); data = Resources.Load <ConversationData>(ConversationPath); }
protected override void Awake() { base.Awake(); conversationController = owner.GetComponentInChildren <ConversationController>(); data = Resources.Load <ConversationData>("Conversations/SampleScene"); }
public abstract void SetState(ConversationController conversationController);
private void Awake() => conversationController = FindObjectOfType <ConversationController>();
protected override void Awake() { base.Awake (); conversationController = owner.GetComponentInChildren<ConversationController> (); }
protected override void Awake() { base.Awake (); conversationController = owner.GetComponentInChildren<ConversationController>(); data = Resources.Load<ConversationData>("Conversations/IntroScene"); }
protected override void Awake() { base.Awake(); conversationController = owner.GetComponentInChildren <ConversationController>(); }
/// <summary> Creation of the Controller </summary> private void Awake() { this.controller = new ConversationController(this.Model); }