コード例 #1
0
ファイル: UI.cs プロジェクト: bigstupidx/RailsToNoWhere
    void Awake()
    {
        //Assign the static variable player to the only instance of this class that should exist.
        if (!ui)
        {
            ui = this;
        }
        else
        {
            Debug.LogError("Multiple UI instances on objects: " + ui.name + ", " + name);
            //We HAVE to return to stop execution if there is another instance that exists already, otherwise we may override the original static variables.
            return;
        }

        dialogueUI  = dialogueUIObjects;
        inventoryUI = inventoryUIObjects;
        Crosshair   = CrosshairOb;

        MessageAnimator = _MessageAnimator;
        MessageText     = _MessageText;

        ThoughtsText      = _ThoughtsText;
        ThoughtsObject    = _ThoughtsObject;
        ThoughtContButton = _ThoughtContButton;
        ThoughtExitButton = _ThoughtExitButton;

        CutsceneObject     = _CutsceneObject;
        CutsceneImage      = _CutsceneImage;
        CutsceneContButton = _CutsceneContButton;
        CutsceneExitButton = _CutsceneExitButton;

        InnerDialogueText       = _InnerDialogueText;
        InnerDialogueObject     = _InnerDialogueObject;
        InnerDialogueContButton = _InnerDialogueContButton;
        InnerDialogueExitButton = _InnerDialogueExitButton;
        InnerDialogueName       = _InnerDialogueName;

        //Disable UI objects incase they are left enabled.
        dialogueUI.ResponseButton.SetActive(false);
        dialogueUIObjects.Parent.SetActive(false);

        inventoryUI.Parent.SetActive(false);
        inventoryUI.BaseInventoryItem.SetActive(false);
        inventoryUI.ItemInformationPanel.SetActive(false);
        inventoryUI.MemoryParent.SetActive(false);

        CutsceneObject.SetActive(false);
        InnerDialogueObject.SetActive(false);

        EndingImage = _EndingImage;
        EndingText  = _EndingText;

        HeavenAudio   = _heavenAudio;
        HellAudio     = _hellAudio;
        NeutralAudio  = _neutralAudio;
        CutsceneAudio = _cutsceneAudio;

        //Load Dialogue Nodes
        DialogueController.LoadDictionary();
    }
コード例 #2
0
ファイル: MyBehaviorTree3.cs プロジェクト: turtle-penguin/IBT
 protected Node SpeakUI(GameObject agent1, string text)
 {
     return(new SequenceParallel(
                Speak(agent1),
                new LeafInvoke(() => {
         if (DialogueUI.Available())
         {
             if (DialogueUI.Finished(text))
             {
                 return RunStatus.Success;
             }
             else
             {
                 DialogueUI.SetText(text);
                 return RunStatus.Running;
             }
         }
         else
         {
             return RunStatus.Running;
         }
     }),
                new LeafWait(1000)
                ));
 }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     dialogueNodesListUI = FindObjectOfType <DialogueNodesListUI>();
     playerChoicesListUI = FindObjectOfType <PlayerChoicesListUI>();
     dialogueUI          = FindObjectOfType <DialogueUI>();
     displayController   = GetComponent <UIDisplayController>();
 }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     dialogueUI = FindObjectOfType <DialogueUI>();
     dialogueUI.StartNewDialogue(dialogueID);
     Destroy(this);
     Destroy(gameObject);
 }
コード例 #5
0
    void Start()
    {
        npcManager = NPCManager.instance;
        Ground     = GroundFind.instance.gameObject;
        rewind     = RewindManager.instance;
        player     = PlayerController.instance;

        rb2d       = GetComponent <Rigidbody2D>();
        collider2D = GetComponent <Collider2D>();
        dialogueUI = GetComponentInChildren <DialogueUI>();
        health     = GetComponent <Health>();
        anim       = GetComponent <Animator>();

        currentPathTargetIndex = 0;
        if (path != null)
        {
            currentPathTarget = path.positions[currentPathTargetIndex];
        }
        if (canBeHostile)
        {
            weaponGameObject = Instantiate(items.Find(x => x.itemType == ItemType.Gun).gameObject, rb2d.position,
                                           Quaternion.identity);
            weaponGameObject.GetComponent <PickupObject>().canPickup = false;
            weaponGameObject.GetComponent <SpriteRenderer>().enabled = false;
            weaponGameObject.transform.parent = Ground.transform;
            weapon = weaponGameObject.GetComponent <Item>();


            shotAudioSource = GetComponent <AudioSource>();
            weaponLight     = GetComponentInChildren <Light2D>();
        }
    }
コード例 #6
0
    private void SetDialogue(DialogueUI show, DialogueUI hide, string text)
    {
        show.Dialogue = text;
        show.ShowUI();

        hide.HideUI();
    }
コード例 #7
0
 void Awake()
 {
     if (gc == null)
     {
         gc = this;
     }
     else
     {
         // if this one's a duplicate, destroy
         Destroy(this.gameObject);
         return;
     }
     DontDestroyOnLoad(this);
     titleText         = editorTitleText;
     dialogueUI        = GetComponentInChildren <DialogueUI>();
     signUI            = GetComponentInChildren <SignUI>();
     pc                = GetComponentInChildren <PlayerController>();
     rm                = GetComponent <RespawnManager>();
     playerFollower    = gc.GetComponentInChildren <PlayerFollower>();
     save              = gc.GetComponent <SaveWrapper>().save;
     blackoutUI        = GetComponentInChildren <BlackFadeUI>();
     pauseUI           = GetComponentInChildren <PauseUI>();
     abilityUIAnimator = GameObject.Find("AbilityGetUI").GetComponent <Animator>();
     inventory         = gc.GetComponentInChildren <InventoryController>();
     parallaxOption    = gc.GetComponentInChildren <ParallaxOption>();
     bossHealthUI      = GameObject.Find("BossHealthUI").GetComponent <BarUI>();
     bossHealthUI.gameObject.SetActive(false);
     playerMenu     = GameObject.Find("PlayerMenu");
     binarySaver    = gc.GetComponent <BinarySaver>();
     saveWrapper    = gc.GetComponent <SaveWrapper>();
     audioListener  = gc.GetComponentInChildren <AudioListener>();
     bossFightIntro = gc.GetComponentInChildren <BossFightIntro>(includeInactive: true);
 }
コード例 #8
0
 private void SetDialogue(DialogueUI show, DialogueUI hide, string text)
 {
     show.ShowUI();
     hide.HideUI();
     show.Dialogue(text);
     typingState = TypingState.Typing;
 }
コード例 #9
0
 void Start()
 {
     //cm = GetComponent<CharacterMovement>();
     rpi    = GetComponent <RayPlayerInput>();
     rm     = GetComponent <RayMovement>();
     diagUI = FindObjectOfType <DialogueUI>();
 }
コード例 #10
0
 void Awake()
 {
     if (gc == null)
     {
         gc = this;
     }
     else
     {
         // if this one's a duplicate, destroy
         Destroy(this.gameObject);
         return;
     }
     DontDestroyOnLoad(this);
     titleText         = editorTitleText;
     dialogueUI        = GetComponentInChildren <DialogueUI>();
     signUI            = GetComponentInChildren <SignUI>();
     pc                = GetComponentInChildren <PlayerController>();
     rm                = GetComponent <RespawnManager>();
     playerFollower    = gc.GetComponentInChildren <PlayerFollower>();
     save              = gc.GetComponent <Save>();
     blackoutUI        = GetComponentInChildren <BlackFadeUI>();
     pauseUI           = gc.transform.Find("PixelCanvas").transform.Find("PauseUI").GetComponent <Animator>();
     abilityUIAnimator = gc.transform.Find("PixelCanvas").transform.Find("AbilityGetUI").GetComponent <Animator>();
     inventory         = gc.GetComponentInChildren <InventoryController>();
     parallaxOption    = gc.GetComponentInChildren <ParallaxOption>();
 }
コード例 #11
0
        public static void BoardPosition(GameObject _object)
        {
            board = CheckBoard();

            if (!IsBoardFull())
            {
                _object.transform.position = new Vector3(GetPositionX(), GetPositionY(), 0);

                EndBoardPlace();
            }
            else
            {
                GameManager.waitingDecision = true;

                if (GameManager.mainPlayerTurn)
                {
                    GameManager.optionsObject.SetActive(false);
                    DialogueUI.ShowDialogue("Full board. Choice <b>one</b> card to replace!");
                }
                else
                {
                    InitializeGame.mainAI.GetComponent <AI> ().SelectCardToReplace();
                }
            }
        }
コード例 #12
0
ファイル: ResponseHandler.cs プロジェクト: Pattrigue/Dialogue
    private void Start()
    {
        dialogueUI = GetComponent <DialogueUI>();

        responseBox.gameObject.SetActive(false);
        responseButtonTemplate.gameObject.SetActive(false);
    }
コード例 #13
0
ファイル: PersistentScene.cs プロジェクト: tcape/stc_game
    private void Start()
    {
        // load local resources
        // (moving all logic from start function to this first time function)
        gameDataSaver = GetComponent <GameDataSaver>();
        logoutButton.onClick.AddListener(onLogout);
        exitButton.onClick.AddListener(onExit);
        logoutCanvas     = FindObjectOfType <LogoutCanvas>();
        questWindowUI    = FindObjectOfType <QuestWindowUI>();
        reviveController = FindObjectOfType <ReviveController>();
        hud              = FindObjectOfType <HUDController>();
        dialogueUI       = FindObjectOfType <DialogueUI>();
        actionBar        = GetComponentInChildren <ActionBarController>();
        inventoryManager = gameObject.GetComponentInChildren <InventoryManager>(true);
        inventory        = inventoryManager.inventory;
        equipment        = gameObject.GetComponentInChildren <EquipmentPanel>(true).equipment;

        // set up component
        logoutCanvas.gameObject.SetActive(false);
        hud.gameObject.SetActive(false);
        QuestManager.instance.questWindowUI = questWindowUI;
        DialogueManager.instance.dialogueUI = dialogueUI;
        StartCoroutine(LoadGameScene());
        exitButton.enabled = false;
        logoutButton.gameObject.SetActive(false);
        exitButton.gameObject.SetActive(false);

        // If game data exists in the database
        // Override the first stats load using the user data
        if (User.GetActiveCharacter().GameState.isDirty)
        {
            GameCharacter.Stats = GameCharacter.GetStatsFromData(UserService.Instance.User.GetActiveCharacter().GameState.Stats);
            GameCharacter.Stats.Setup();
        }
    }
コード例 #14
0
    private void Awake()
    {
        shipController = GetComponent <ShipController>();
        lHandler       = GetComponent <LandingHandler>();
        dialogueUI     = GameObject.FindObjectOfType <DialogueUI>();

        shipMaterial = GetComponentInChildren <Renderer>().material;
    }
コード例 #15
0
    private bool doNotEngage = false;                 // when player has everything they need, do not converse anymore

    // Start is called before the first frame update
    void Start()
    {
        dialogueUI = FindObjectOfType <DialogueUI>();
        assigned   = GetComponent <VIDE_Assign>();
        npcName    = this.gameObject.tag;

        Debug.Log("This NPC name is " + npcName);
    }
コード例 #16
0
 void Start()
 {
     dialogueUI    = GetPanel().GetComponentInChildren <DialogueUI>();
     translationUI = GetPanel().GetComponentInChildren <TranslationUI>();
     questsUI      = GetPanel().GetComponentInChildren <QuestsUI>();
     dataUImenusToggleGroupName = "DataUImenusToggleGroup";
     CreateNewMenuToggleGroup(dataUImenusToggleGroupName);
 }
コード例 #17
0
    public void SetAvatar()
    {
        print("setting avatar for " + gameObject.name);
        DialogueUI dialogueUI = FindObjectOfType <DialogueUI>();

        dialogueUI.SetAvatar(_avatarImage);
        dialogueUI.SetName(_displayName);
    }
コード例 #18
0
 void Awake()
 {
     m_Input            = FindObjectOfType <PlayerInput>();
     m_playerController = FindObjectOfType <PlayerController>();
     dialogueRunner     = FindObjectOfType <DialogueRunner>();
     dialogueUI         = FindObjectOfType <DialogueUI>();
     s_Instance         = this;
 }
コード例 #19
0
    void Awake()
    {
        dialogueData   = GetComponent <DialogueData>();
        dialogueUi     = GameObject.Find("DialogueOutput").GetComponent <DialogueUI>();
        dialoguePlayer = GameObject.Find("PlayerCharacter").GetComponent <DialoguePlayer>();

        allDoorsInScene = FindObjectsOfType <DialogueSceneDoor>();
    }
コード例 #20
0
    private void Awake()
    {
        dialogueUI = FindObjectOfType <DialogueUI>();

        spawner = FindObjectOfType <Spawner>();

        rb = GetComponent <Rigidbody>();
    }
コード例 #21
0
    /// <summary>
    /// Register the add quest code when dialogue ends.
    /// </summary>
    /// <param name="dialogueElem"></param>
    /// <param name="questName"></param>
    private void RegisterQuestOnDiaglogueEnd(DialogueUI dialogueElem, string questName)
    {
        DialogueEndedEventArgs args = new DialogueEndedEventArgs();

        args.questName              = questName;
        dialogueElem.args           = args;
        dialogueElem.DialogueEnded += questManager.AddQuest;
    }
コード例 #22
0
 void Start()
 {
     playerShip           = GameObject.Find("PlayerShip");
     dialogueUI           = FindObjectOfType <DungeonEntryDialogueManager>().dialogueUI;
     dialogueBlackOverlay = dialogueUI.blackOverlayAnimator.gameObject;
     Instantiate(firstBossStatue, transform.position + new Vector3(0.4f, -2, 0), Quaternion.identity);
     adjustRotation();
 }
コード例 #23
0
        public void ClientResponse()
        {
            //GET DIALOGUE COMPONENT
            Dialogue[] dialogues = gameObject.GetComponents <Dialogue>();
            if (dialogues.Length == 0)
            {
                return;                        //NO DIALOGUES
            }
            if (!ui)
            {
                ui = FindObjectOfType <DialogueUI>();
            }
            //ASSIGN UI HEADER VARIABLES
            if (ui != null)
            {
                //ITERATE THROUGH SPEECHES
                foreach (Dialogue speech in dialogues)
                {
                    if (speech.isActiveAndEnabled)
                    {
                        ui.dialogue = speech;
                    }
                    //ui.speakerImage.sprite = speech.icon; //SET UI IMAGE
                    //ui.speakerTitle.text = speech.title; //SET UI TITLE
                }

                //QUEUE SPEECH LINES
                //foreach (string line in speech.lines)
                //{
                //if (line.StartsWith("?")) { } //Use later for Dialogue Options
                //    _dialogue.Enqueue(line);
                //}
            }

            if (_dialogue.Count < 1)
            {
                return;                      //NO DIALOGUE
            }
            //if (ui != null)
            //{
            //    foreach (string dialogueLine in dialogue)
            //    {
            //TODO: This does not seem to delete
            //ui.dialogueLine.text += _dialogue.Dequeue(); //SET UI DIALOGUE LINE
            //    }
            //}

            #region DEBUG
#if UNITY_EDITOR && DEBUG
            System.Text.StringBuilder log = new System.Text.StringBuilder((ui != null) ? ui.speakerTitle.text.ToString() : "");
            foreach (string line in dialogue)
            {
                log.AppendLine(line);
            }
            Debug.Log(log.ToString());
#endif
            #endregion //DEBUG
        }
コード例 #24
0
 /**
  * @param timeShown - null to estimate based on text length; negative to denote 'indefinataly'
  */
 public static SpeechBubble Think(this GameObject speaker, string text,
                                  float?timeShown           = null,
                                  Vector3?speechPosition    = null,
                                  SpeechBubble.Side?tipSide = null,
                                  float?tipPositionOnSide   = null)
 {
     return(ShowSpeechBubble(speaker, DialogueUI.Load("Thought Bubble"), text,
                             timeShown, speechPosition, tipSide, tipPositionOnSide));
 }
コード例 #25
0
    void Start()
    {
        // Finds stuff
        if (ui == null)
        {
            ui = GameObject.FindGameObjectWithTag("UI");
        }
        if (diagUI == null)
        {
            diagUI = FindObjectOfType <DialogueUI>();
        }

        // Checking for existing singleton
        if (instance != null)
        {
            Destroy(this.gameObject);
            return;
        }
        instance = this;
        DontDestroyOnLoad(this.gameObject);

        // Initializes the hivemind
        for (int i = 0; i < transform.childCount; i++)
        {
#if UNITY_5_3_OR_NEWER
            hivemind.Add(new InfectedCharacter()
            {
                Character = transform.GetChild(i).gameObject, Floor = SceneManager.GetActiveScene().buildIndex, InPlayerControl = i == 0, Life = 100
            });
#else
            hivemind.Add(new InfectedCharacter()
            {
                Character = transform.GetChild(i).gameObject, Floor = Application.loadedLevel, InPlayerControl = i == 0, Life = 100
            });
#endif
        }

        if (hivemind.Count <= 0)
        {
            return;
        }

        // Sets the currently active character
        currentCharacter = hivemind[currentCharacterIndex].Character;
        //currentCharacter.AddComponent<InfectionTimer>().BeginTimer();
        DisableOthers();

        // Disable input for every character except the first one
        for (int i = 0; i < hivemind.Count; i++)
        {
            hivemind[i].Character.GetComponent <RayPlayerInput>().enabled = (i == 0) ? true : false;
        }

        // Gets the camera manager
        //cameraManager = Camera.main.transform.parent.gameObject.GetComponent<Cameras>();
        //cameraManager.target = currentCharacter.transform;
    }
コード例 #26
0
 // Use this for initialization
 void Start()
 {
     playerChoicesListUI = FindObjectOfType <PlayerChoicesListUI>();
     dialogueUI          = FindObjectOfType <DialogueUI>();
     options             = transform.Find("DialogueOptions").gameObject;
     saveDialogue        = transform.Find("Save").gameObject;
     activeToggle        = transform.GetComponentInChildren <Toggle>();
     dialogueNodesListUI = FindObjectOfType <DialogueNodesListUI>();
 }
コード例 #27
0
 void Start()
 {
     playerShip           = GameObject.Find("PlayerShip");
     dialogueUI           = FindObjectOfType <DungeonEntryDialogueManager>().dialogueUI;
     dialogueBlackOverlay = FindObjectOfType <DungeonEntryDialogueManager>().dialogueBlackOverlay;
     text            = this.GetComponent <Text>();
     obstacleToolTip = GameObject.Find("PlayerShip").GetComponent <PlayerScript>().obstacleToolTip;
     SetInventoryAnimation();
 }
コード例 #28
0
 public void InitialiseMe()
 {
     dialogueUI = FindObjectOfType <DialogueUI>();
     imageRoot  = transform.Find("CentreOfGravity").GetComponent <Transform>();
     myAnimator = gameObject.GetComponent <Animator>();
     SetCombatController();
     interactionDistance = 1f;
     SetDefaultAnimation();
 }
コード例 #29
0
    public void StartDialogue()
    {
        UIleft  = speakerLeft.GetComponent <DialogueUI>();
        UIright = speakerRight.GetComponent <DialogueUI>();

        UIleft.Speaker  = dialogue.getCharLeft();
        UIright.Speaker = dialogue.getCharRight();

        DisplayLine();
    }
コード例 #30
0
    private void Start()
    {
        gameHandler     = GetComponent <GameHandler>();
        _dialogueUI     = gameHandler.dialogueUI;
        _dialogueRunner = gameHandler.dialogueRunner;

        _dialogueRunner.AddCommandHandler("showBox", ShowDialogueBox);
        _dialogueRunner.AddCommandHandler("hideBox", HideDialogueBox);
        _dialogueRunner.AddCommandHandler("setBoxPosition", SetDialogueBoxPosition);
    }
コード例 #31
0
    public void Start()
    {
        dui = GlobalVars.dialogue_ui;
        inv = GlobalVars.inventory;
        db = GlobalVars.database;
        im = GlobalVars.interact_mode;
        ps = GlobalVars.plot_system;

        fui = gameObject.GetComponent<FailUI>();
    }
コード例 #32
0
 public void Start()
 {
     dui = GlobalVars.dialogue_ui; // gameObject.GetComponent<DialogueManager>();
     inv = GlobalVars.inventory;
     db = GlobalVars.database;
 }