Наследование: MonoBehaviour
Пример #1
0
    public void Init(DialogTrigger dt)
    {
        canvasObject.SetActive(true);
        NPCName.text = dt.NPCName;
        DialogCamera.Instance.SetDialogTarget(dt.targetLookObj);
        Cursor.lockState = CursorLockMode.None;
        Cursor.visible   = true;
        dialogTrigger    = dt;
        if (dialogTrigger.dialogObject.canExit)
        {
            exitButton.SetActive(true);
        }
        else
        {
            exitButton.SetActive(false);
        }
        int start = GetStartingDialog();

        if (start < 0)
        {
            CloseDialog();
        }
        else
        {
            SetDialogSection(start);
        }
    }
Пример #2
0
    // Start is called before the first frame update
    void Start()
    {
        _dt   = GetComponent <DialogTrigger>();
        _eKey = GetComponentInChildren <EtoInteract>();

        _initialDialog = true;
    }
Пример #3
0
        private void BuildSimpleDialogue()
        {
            DialogueFactory.CreateDialogLogic(this.parent, this.name, this.guid, this.showOnlyOnce);

            MessageCenterMessageType messageType;

            if (this.trigger != null)
            {
                if (!Enum.TryParse(this.trigger, out messageType))
                {
                    MessageTypes customMessageType;
                    if (!Enum.TryParse(this.trigger, out customMessageType))
                    {
                        Main.Logger.LogError("[DialogueBuilder] Invalid 'Trigger' provided.");
                    }
                    else
                    {
                        messageType = (MessageCenterMessageType)customMessageType;
                    }
                }

                DialogTrigger dialogueTrigger = new DialogTrigger(messageType, this.guid);
                dialogueTrigger.Run();
            }
        }
Пример #4
0
 private void Start()
 {
     audio         = GetComponent <AudioSource>();
     dialogManager = FindObjectOfType <DialogManager>();
     dialogTrigger = CookieDialog.GetComponent <DialogTrigger>();
     outlineC.SetColor("_Color", Color.black);
 }
Пример #5
0
    // Start is called before the first frame update
    void Start()
    {
        _clubNotFound = true;
        _eventManager = EventManager.Instance != null ? EventManager.Instance : FindObjectOfType <EventManager>();
        if (_eventManager == null)
        {
            Debug.Log("Event Manager is null");
        }

        _eToInteract = GetComponentInChildren <EtoInteract>();
        if (_eToInteract == null)
        {
            Debug.Log("Player Canvas is NULL");
        }

        _dt = GetComponent <DialogTrigger>();
        if (_dt == null)
        {
            Debug.Log("Dialog Trigger is NULL");
        }

        _dt.SetActiveOnEnterFalse();

        _eventManager.ClubFound += StartHintDialog;
    }
Пример #6
0
    private IEnumerator StartDialogTurn(GameObject gameObject)
    {
        DialogTrigger dTrigger = gameObject.GetComponent <DialogTrigger>();

        cameraControl.MoveCamera(gameObject.transform.position);
        return(dTrigger.TriggerDialog());
    }
Пример #7
0
 public void Setup(Transform[] wayPoints)
 {
     enemyMovement           = instance.GetComponent <EnemyMovement>();
     fieldOfView             = instance.GetComponent <FieldOfView>();
     dialog                  = instance.GetComponent <DialogTrigger>();
     enemyMovement.waypoints = wayPoints;
 }
Пример #8
0
 public void StartDialog(DialogTrigger dialog)
 {
     currentDialog = dialog;
     currentDialog.DisableInteractionTemp();
     otherAudio        = dialog.Source;
     currentDialogNode = dialog.CurrentNode;
     interfaceController.AddMask_(this);
 }
Пример #9
0
 public virtual void Setup(List <GameObject> answerDests)
 {
     playerMovement = instance.GetComponent <PlayerMovement>();
     playerContent  = instance.GetComponent <PlayerContent>();
     dialog         = instance.GetComponent <DialogTrigger>();
     playerContent.answerDestinations = answerDests;
     playerContent.homeSeat           = homeSeat;
     playerContent.SetAnswers();
 }
Пример #10
0
    public void OnTriggerExit2D(Collider2D other)
    {
        DialogTrigger trigger = other.GetComponentInChildren <DialogTrigger>();

        if (trigger != null)
        {
            dialogGiver = null;
        }
    }
Пример #11
0
    private void Awake()
    {
        if (PlayerPrefs.GetInt("ActionFigure") == 1 || PlayerPrefs.GetInt("ActionInDoor") == 1)
        {
            Destroy(gameObject);
        }

        dialogManager = FindObjectOfType <DialogManager>();
        dialogTrigger = GetComponent <DialogTrigger>();
    }
Пример #12
0
 protected override void Close_()
 {
     currentDialog.EnableInteractionTemp();
     currentDialog     = null;
     currentDialogNode = null;
     currentTextAnimation?.Stop();
     GetComponent <Rigidbody>().isKinematic = false;
     GameManager.UnfreezePlayer();
     GameManager.UnfreezeCamera();
 }
Пример #13
0
 // Start is called before the first frame update
 void Start()
 {
     dialogTrigger = GetComponent <DialogTrigger>();
     dialog        = new Dialog {
         Name = "JICE"
     };
     dialog.Sentences = new Queue();
     dialog.Sentences.Enqueue("GreatJob");
     dialogTrigger.TriggerDialog(dialog);
 }
Пример #14
0
        private void BuildSimpleDialogue()
        {
            DialogueFactory.CreateDialogLogic(this.parent, this.name, this.guid, this.showOnlyOnce);

            if (this.trigger != null)
            {
                MessageCenterMessageType triggerMessageType = (MessageCenterMessageType)Enum.Parse(typeof(MessageCenterMessageType), this.trigger);
                DialogTrigger            dialogueTrigger    = new DialogTrigger(triggerMessageType, this.guid);
                dialogueTrigger.Run();
            }
        }
Пример #15
0
    // Use this for initialization
    void Start()
    {
        InstantiatePlayer();
        userInterface = GameObject.Find("User Interface");
        dialogManager = userInterface.GetComponentInChildren <DialogManager>();

        storyTrigger = GameObject.Find("WinScript").GetComponent <DialogTrigger>();

        //GameObject.Find("WinScript").GetComponent<DialogTrigger>().TriggerEvent();
        notYetStarted = true;
    }
Пример #16
0
 public void StartConversation(Conversation conversation, DialogTrigger trigger)
 {
     if (eventList.Count != 0)
     {
         return;
     }
     eventList = conversation.Conversations;
     //Debug.Log(trigger.gameObject.name);
     ResetEvents();
     StartTimer();
 }
Пример #17
0
    //DialogController dialogController;

    private void Start()
    {
        //dialogController = GameObject.FindGameObjectWithTag("ClientMenu").GetComponent<DialogController>();
        stopPoint   = GameObject.FindGameObjectWithTag("Player").transform;
        gonePoint   = GameObject.Find("ClientGonePoint").GetComponent <Transform>();
        onStopPoint = false;
        DataHolder.currentClientComplete = false;
        dialogTrigger   = GetComponent <DialogTrigger>();
        alreadySelected = false;
        outline.SetActive(false);
    }
Пример #18
0
    private void Awake()
    {
        if (PlayerPrefs.GetInt("Besen") == 1)
        {
            Destroy(gameObject);
        }

        demonMode     = FindObjectOfType <DemonMode>();
        dialogManager = FindObjectOfType <DialogManager>();
        dialogTrigger = GetComponent <DialogTrigger>();
    }
Пример #19
0
    // Start is called before the first frame update
    void Start()
    {
        _dt = GetComponent <DialogTrigger>();

        _eventManager = EventManager.Instance != null ? EventManager.Instance : FindObjectOfType <EventManager>();
        if (_eventManager == null)
        {
            Debug.Log("Event Manager is null");
        }

        _eventManager.SkeletonCrushed += TriggerCrushDialog;
    }
Пример #20
0
 void Start()
 {
     trigger = GetComponent <DialogTrigger>();
     //target = GameObject.FindGameObjectWithTag("Player").transform;
     canvasGroup = GameObject.Find("Interface").GetComponent <CanvasGroup>();
     Alert       = GameObject.Find("Alert");
     audi_source = Player.GetComponent <Player_Movement>().audi;
     //fail_sound = Player.GetComponent<Player_Movement>().Fail;
     //success_sound = Player.GetComponent<Player_Movement>().Success;
     click_sound = Player.GetComponent <Player_Movement>().Click;
     PC          = GameObject.Find("Progress_Obj").GetComponent <Progress_Controller>();
 }
Пример #21
0
    private void Start()
    {
        audio                 = GetComponent <AudioSource>();
        dialogManager         = FindObjectOfType <DialogManager>();
        dialog                = GetComponent <DialogTrigger>();
        spriteRenderer        = hamsterCage.GetComponent <SpriteRenderer>();
        spriteRenderer.sprite = lockedCage;

        if (PlayerPrefs.GetInt("CageUnlocked") == 1 || PlayerPrefs.GetInt("TeddyInDoor") == 1)
        {
            spriteRenderer.sprite = unlockedCage;
        }
    }
Пример #22
0
    void Awake()
    {
        dialog = gameObject.Q <DialogTrigger>();

        if (Gamepad.current != null)
        {
            dialog.listSentences.Add(sentenceGamepad);
        }
        else
        {
            dialog.listSentences.Add(sentenceKeyboard);
        }
    }
Пример #23
0
 private void OnTriggerEnter(Collider collision)
 {
     if (collision.gameObject.tag == "Dialog")
     {
         enter_dialod = collision.gameObject;
         collision.gameObject.GetComponent <DialogTrigger>().hintView(true);
     }
     if (collision.gameObject.tag == "Battle")
     {
         enter_battle = collision.gameObject.GetComponent <DialogTrigger>();
         collision.gameObject.GetComponent <DialogTrigger>().hintView(true);
     }
 }
Пример #24
0
    // Use this for initialization
    void Start()
    {
        luna          = GameObject.Find("Luna");
        userInterface = GameObject.Find("User Interface");
        dialogManager = userInterface.GetComponentInChildren <DialogManager>();
        audioSource   = GameObject.Find("Music").GetComponentInChildren <AudioSource>();
        storyTrigger  = luna.GetComponent <DialogTrigger>();

        SetPosition();
        audioSource.Stop();
        startBattleToggle = 0;
        luna.GetComponent <LunaBehavior>().attackSkipToggle = false;
    }
Пример #25
0
    // Start is called before the first frame update
    void Start()
    {
        _anim    = GetComponent <Animator>();
        _spriteR = GetComponent <SpriteRenderer>();
        _dt      = GetComponent <DialogTrigger>();

        _eventManager = EventManager.Instance != null ? EventManager.Instance : FindObjectOfType <EventManager>();
        if (_eventManager == null)
        {
            Debug.Log("Event Manager is NULL");
        }

        _eventManager.FreeGammieSceneActive += StartGammieDialogue;
    }
Пример #26
0
 private void OnTriggerExit(Collider collision)
 {
     if (collision.gameObject.tag == "Dialog")
     {
         enter_dialod.GetComponent <DialogTrigger>().dialog_panel.GetComponent <Dialog>().CloseDialog();
         enter_dialod = null;
         collision.gameObject.GetComponent <DialogTrigger>().hintView(false);
     }
     if (collision.gameObject.tag == "Battle")
     {
         enter_battle = null;
         collision.gameObject.GetComponent <DialogTrigger>().hintView(false);
     }
 }
Пример #27
0
    IEnumerator CheckAllKeysFound()
    {
        DialogTrigger storyTrigger  = GetComponent <DialogTrigger>();
        DialogManager dialogManager = FindObjectOfType <DialogManager>();

        yield return(null);

        /*if (lunaKey >= 4) {
         *      yield return new WaitUntil(() => dialogManager.GetStillPlaying() == false);
         *      storyTrigger.TriggerEvent();
         *      yield return new WaitUntil(() => dialogManager.GetStillPlaying() == false);
         *      SceneManager.LoadScene(0);
         * }*/
    }
Пример #28
0
 private void OnEnable()
 {
     this.mb = target as DialogTrigger;
     this.triggerTypeProp         = serializedObject.FindProperty("triggerType");
     this.startTypeProp           = serializedObject.FindProperty("startType");
     this.targetDialogSystemPorp  = serializedObject.FindProperty("targetDialogSystem");
     this.dialogNameToTriggerProp = serializedObject.FindProperty("dialogNameToTrigger");
     this.triggerOnlyOnce         = serializedObject.FindProperty("triggerOnlyOnce");
     this.sequenceRangeProp       = serializedObject.FindProperty("sequenceRange");
     this.disableObjProp          = serializedObject.FindProperty("disableThisGameObjectOnEnd");
     this.messageToStartProp      = serializedObject.FindProperty("messageToStart");
     this.messageToEnableThisProp = serializedObject.FindProperty("messageToEnableThis");
     this.workTypeProp            = serializedObject.FindProperty("workType");
     this.allowProgressRangeProp  = serializedObject.FindProperty("allowProgressRange");
 }
Пример #29
0
    public static void FightSteersman()
    {
        PirateSwordFight steersmanFight = GameObject.FindGameObjectWithTag("Steersman").GetComponent <PirateSwordFight>();
        DialogTrigger    d = steersmanFight.GetComponent <DialogTrigger>();

        GameManager.Story.IsFightingSteersman = true;
        PartyAffiliation player = GameManager.GetPlayerComponent <PartyAffiliation>();

        d.DisableInteraction();
        player.party = PartyAffiliation.PartyName.French;
        steersmanFight.DoDelayed(5f, delegate
        {
            GameManager.GetPlayerComponent <InterfaceController>().Clear();
            steersmanFight.AttackTarget(player);
        });
    }
Пример #30
0
    public void StartDialog(NPC npc, int numberOfInteractions, DialogTrigger dialogTrigger)
    {
        this.dialogTrigger = dialogTrigger;

        dialogText.text = "";

        animator.SetBool("IsOpen", true);

        nameText.text = npc.name;

        sentences.Clear();

        foreach (string sentence in npc.dialogs[numberOfInteractions].sentences)
        {
            sentences.Enqueue(sentence);
        }

        StartCoroutine(WaitForEndOfAnimation());
    }
    /// <summary>
    /// Creates Game2.
    /// </summary>
    public GMGame CreateGame2()
    {
        //create conditions
        ACondition falseCond = new FalseCondition();
        ACondition trueCond = new TrueCondition();
        ScriptCondition<bool> scriptCond =  new ScriptCondition<bool>(TestScriptConditionEvaulateBool, true);

        //create triggers
        ScriptTrigger<int> trigger1 = new ScriptTrigger<int>(2, 2, trueCond.Check, trueCond.Check, TestScriptFunctionInt, 1);
        ScriptTrigger<float> trigger2 = new ScriptTrigger<float>(5, 10, trueCond.Check, falseCond.Check, TestScriptFunctionFloat, 2.2f);
        ScriptTrigger<string> trigger3 = new ScriptTrigger<string>(1, 3, null, null, TestScriptFunctionString, "no conditions");
        DialogTrigger trigger4 = new DialogTrigger(1, 3, scriptCond.Check, null, "myDialog");

        //create games and add triggers
        GMGame game = new GMGame("game2");
        game.AddTrigger(trigger1);
        game.AddTrigger(trigger2);
        game.AddTrigger(trigger3);
        game.AddTrigger(trigger4);

        return game;
    }