Inheritance: MonoBehaviour
        private IEnumerator PlayCutScene()
        {
            yield return(ShowNextTextSection(4, 2));

            yield return(HospitalCutscene());

            AudioPlayer.Stop();
            PlayIntroMusic();
            ReactivateText();
            yield return(ShowNextTextSection(5));

            yield return(SwordRoomCutscene());

            yield return(TextController.ShowCharactersNextBubbleText(Character.Dani, 2));

            DaniAnimator.SetTrigger("GiveSword");
            yield return(new WaitForSecondsRealtime(7));

            cameraAnimator.SetTrigger("MoveCameraUp");
            yield return(new WaitForSecondsRealtime(6.3f));

            StartCoroutine(Fade(Title, 0, 1));
            moveSword = true;
            yield return(new WaitForSecondsRealtime(6));

            EnableNextScene();
        }
    // Use this for initialization
    void Start()
    {
        // テキストを渡すスクリプトの参照
        textMesh   = GameObject.Find("Word");
        controller = textMesh.GetComponent <TextController>();

        // 音声認識セッションの初期化
        session = PXCMSession.CreateInstance();
        source  = session.CreateAudioSource();

        PXCMAudioSource.DeviceInfo dinfo = null;

        source.QueryDeviceInfo(1, out dinfo);
        source.SetDevice(dinfo);
        Debug.Log(dinfo.name);

        session.CreateImpl <PXCMSpeechRecognition>(out sr);

        PXCMSpeechRecognition.ProfileInfo pinfo;
        sr.QueryProfile(out pinfo);
        pinfo.language = PXCMSpeechRecognition.LanguageType.LANGUAGE_JP_JAPANESE;
        sr.SetProfile(pinfo);

        handler = new PXCMSpeechRecognition.Handler();
        handler.onRecognition = (x) => controller.SetText(x.scores[0].sentence);
        sr.SetDictation();
        sr.StartRec(source, handler);
    }
Example #3
0
    private void instantiateNewObj()
    {
        //Instantiate ship (cube) and get a ref to it in newObj
        newObj = (GameObject)Instantiate(obj, pos, rot);

        //Instantiate text and get a red to it in newTextObj
        newTextObj = (GameObject)Instantiate(textObj, pos + offset, transform.rotation);

        /*
         *  TextController.cpp seems redundant at the moment since you can just apply the newObj (ship)'s position to the text
         *  But I kept it as its own script so more control over it later on e.g. rotating to face active camera
         */
        /*
         *  get a ref of the instance's TextController.cpp in tc (short for TextController)
         *  assign target to follow -> newObj
         *  assign newTextObj's offset from its target so no overlap
         */
        tc        = newTextObj.GetComponent <TextController>();
        tc.target = newObj;
        tc.offset = offset;

        //change text
        newTextObj.GetComponent <TextMesh>().text = names[index];

        //Increase index for names (arbitary atm)
        index++;
    }
    // Reset variables for new level
    public void reset()
    {
        numOfLives       = 9;
        playerKats       = new GameObject[numberOfPlayers];
        currentGameState = GameState.start;
        gameTime         = 0;
        currentSequence  = 0;
        totalSequences   = 0;
        currentScore     = 0;
        targetScore      = 0;
        nextGameTime     = 0;
        isGameOver       = false;
        isTutorial       = false;

        currentLevel          = 0;
        killZPlane            = 0;
        wallManagerObject     = null;
        modelManagerObject    = null;
        livesText             = null;
        centerText            = null;
        timerText             = null;
        wavesLeftText         = null;
        tutorialText          = null;
        GameUI                = null;
        PauseUI               = null;
        platformManagerObject = null;
        platformManager       = null;
        spawnPoints           = null;
        wallSpawnPoints       = null;
        nextLevel             = "";
    }
        public void TestInitialize()
        {
            statisticService = new Mock <IStatisticService>();
            sortService      = new Mock <ISortService>();

            textController = new TextController(statisticService.Object, sortService.Object);
        }
Example #6
0
    private void RoleCallback(GameObject go)
    {
        var role = SceneController.GetComponent <SceneController>().Role;

        TextController.ReplaceSprite("Role/3", role);
        SceneController.GetComponent <AnimatorScript>().AddRising(role, 0.3f, -0.5f);
    }
Example #7
0
        public async Task GetAllShouldExecuteRepositoryGetAll()
        {
            //Arrange
            List <Text> arr = new List <Text>();

            for (int i = 0; i < 5; i++)
            {
                arr.Add(new Text()
                {
                    Id        = Guid.NewGuid(),
                    TextValue = "Текст" + i
                });
            }

            _textRepository.Setup(x => x.GetAll()).ReturnsAsync(arr);
            var controller = new TextController(_logger, _textService);

            //Act
            var actionResult = await controller.GetAll();

            //Assert
            var result   = actionResult.Result as OkObjectResult;
            var textFile = result.Value as List <TextFile>;

            Assert.NotNull(result);
            Assert.NotNull(textFile);
            for (int i = 0; i < textFile.Count; i++)
            {
                Assert.Equal(textFile[i].id, arr[i].Id);
                Assert.Equal(textFile[i].TextValue, arr[i].TextValue);
            }
            _textRepository.Verify(x => x.GetAll());
        }
Example #8
0
    /// <summary>
    /// Animation event for fading in a text block.
    /// </summary>
    /// <param name='paramsString'>
    /// Parameters string. Parameters are given as pairs "key=value" separated by ", ".
    /// Required keys:
    ///  target - the target text controller to execute the event.
    ///  block - the name of the text game object
    /// Optional keys:
    ///  time - how much time the fade in animation should last
    /// </param>
    public void Event_FadeOutText(string paramsString)
    {
        Dictionary <string, string> values;

        TextController textController = GetTargetAndValues <TextController>(paramsString, out values);

        if (textController == null)
        {
            Debug.LogError("Event_FadeOutText(" + paramsString + ") does not contain target parameter or target not found. Ignoring event.");
            return;
        }

        if (!values.ContainsKey("block"))
        {
            Debug.LogError("Event_FadeOutText(" + paramsString + ") does not contain text block name parameter. Ignoring event.");
            return;
        }

        float time = TextBlock.DEFAULT_ANIMATION_TIME;

        if (values.ContainsKey("time"))
        {
            if (!float.TryParse(values["time"], out time))
            {
                Debug.LogWarning("Event_FadeOutText(" + paramsString + ") has bad formatting for the time parameter. Ignoring time parameter.");
                time = TextBlock.DEFAULT_ANIMATION_TIME;
            }
        }

        textController.FadeOutText(values["block"], time);
    }
Example #9
0
        public async Task AddTextStream_ShouldExecuteRepository_AddTextStream()
        {
            //Arrange
            string str  = "Новый текст";
            var    text = new Text()
            {
                Id        = Guid.NewGuid(),
                TextValue = str
            };

            using var testStream = new MemoryStream(Encoding.UTF8.GetBytes("whatever"));



            _textRepository.Setup(x => x.Create(It.IsAny <Text>())).ReturnsAsync(text);
            var controller = new TextController(_logger, _textService);

            //Act
            var actionResult = await controller.PostFile(testStream);

            //Assert
            var result   = actionResult.Result as OkObjectResult;
            var textFile = result.Value as TextFile;

            Assert.NotNull(result);
            Assert.Equal(textFile.id, text.Id);
            _textRepository.Verify(x => x.Create(It.IsAny <Text>()));
        }
Example #10
0
        public async Task AddTextPostFileUrl_ShouldExecuteRepository_AddTextPostFileUrl()
        {
            //Arrange
            string str  = "Новый текст";
            var    text = new Text()
            {
                Id        = Guid.NewGuid(),
                TextValue = str
            };
            var textFileUrl = "https://habr.com/ru/company/otus/blog/529576/";

            _textRepository.Setup(x => x.Create(It.IsAny <Text>())).ReturnsAsync(text);
            var controller = new TextController(_logger, _textService);

            //Act
            var actionResult = await controller.PostFileUrl(textFileUrl);

            //Assert
            var result   = actionResult.Result as OkObjectResult;
            var textFile = result.Value as TextFile;

            Assert.NotNull(result);
            Assert.Equal(textFile.id, text.Id);
            _textRepository.Verify(x => x.Create(It.IsAny <Text>()));
        }
Example #11
0
    public void read()
    {
        //check data
        if (title.Length < 2)
        {
            err.text = "Titlul este prea scurt";
            return;
        }

        if (path.Length == 0)
        {
            err.text = "Alegeti un fisier PDF";
            return;
        }


        //if path is first time added
        if (!TextController.searchInFile(pathFileString, path))
        {
            TextController.appendToFile(pathFileString, path);
        }


        PlayerPrefs.SetString(path + "-title", title);
        PlayerPrefs.SetInt(path + "-startPage", startFromPage);
        PlayerPrefs.SetString("current_path", path);

        PlayerPrefs.SetString("tempTitle", "");
        PlayerPrefs.SetString("dialogWindowPath", "");

        Application.LoadLevel(1);   //load reading scene
    }
Example #12
0
 void Awake()
 {
     textController = GameObject.Find("Scripts").GetComponent <TextController>();
     items.Add(gameObject.AddComponent <Interactable>());
     items[0].SetupObject("magnifying glass");
     AddInteractable("fingerprint kit");
 }
Example #13
0
 //initialisation
 void Start()
 {
     powerupsHeld = 0;
     player       = GameObject.FindGameObjectWithTag("Player");
     ps           = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerStats> ();
     tc           = GameObject.FindGameObjectWithTag("GameController").GetComponent <TextController> ();
 }
    void notifyTextController()
    {
        GameObject     player         = GameObject.Find("PlayerSphere");
        TextController textController = player.GetComponent <TextController>();

        textController.enemyHit();
    }
Example #15
0
    public virtual void Setup()
    {
        Transform win = transform.Find("Screen").Find("UI").Find("Canvas").Find("Windows");

        Numpad = win.parent.Find("Screen").GetComponentInChildren <NumpadController>();

        Sound = GetComponent <ComputerSounds>();
        Sound.Setup(this);

        Login = win.GetComponent <LoginController>();
        Login.Setup(this);

        Desktop = win.GetComponent <DesktopController>();
        Desktop.Setup();

        SS = win.GetComponent <StudentStress>();
        SS.Setup();

        Windows = win.GetComponent <ComputerWindows>();
        Windows.Setup(this);

        Calculator = win.GetComponent <CalculatorController>();
        Calculator.Setup();

        Question = win.GetComponent <QuestionController>();
        Question.Setup();

        Exam = win.GetComponent <ExamController>();

        Text = win.GetComponent <TextController>();
        Text.Setup();

        Commands = new ComputerCommands(this);
    }
Example #16
0
    private void OnDestroy()
    {
        TextController instance = TextController.instance;

        instance.SetTextProperties = (TextController.TextDelegate)Delegate.Remove(instance.SetTextProperties, new TextController.TextDelegate(SetText));
        subscribed = false;
    }
Example #17
0
 private void Awake()
 {
     if (TextController.instance == null)
     {
         TextController.instance = this;
     }
 }
Example #18
0
    void SetInstances()
    {
        enemyObject = (GameObject)Resources.Load("KagayakiKun");
        scoreText   = GameObject.Find("ScoreText").GetComponent <TextController>();

        audioSource = GetComponent <AudioSource>();
    }
Example #19
0
    // Adds a player object and register the player
    void addPlayer(InputDevice input)
    {
        print("adding" + input.name);
        // Register player
        playerInGame [nextPlayer] = true;
        playerReady.Add(false);          // Set ready to false
        playerVirtualInput.Add(input);

        // Create Player Selector Object
        GameObject player = Instantiate(playerSelectorObject,
                                        playerSpawnPoints[nextPlayer].transform.position,
                                        playerSpawnPoints[nextPlayer].transform.rotation) as GameObject;

        playerObjects[nextPlayer] = player;
        player.AddComponent <Rigidbody>();
        KatModelSelector playerModelSelector = player.GetComponent <KatModelSelector> ();

        playerModelSelector.spawnPoint = playerSpawnPoints [nextPlayer];
        playerModelSelector.setVirtualInputController(input);         // Use the start key to map to the control set in model selector
        playerModelSelector.playerNumber = nextPlayer;

        // Update the player start text if it exists
        if (nextPlayer < playerTextObjects.Length)
        {
            TextController playerTextController = playerTextObjects [nextPlayer].GetComponent <TextController>();
            playerTextController.toggleAnimation();
            playerTextController.changeText("Press 'Left' or 'Right' to \nchange your Kat! \nPress 'Start' again to Ready!", 38);
        }
        // increment next player counter
        nextPlayer += 1;
    }
Example #20
0
    private TextController textController;             //テキストコントローラー

    //=================================================================
    //コンポーネント参照用
    private void ComponentRef()
    {
        neuralNetworkManager = GameObject.Find("NeuralNetworkManager").GetComponent <NeuralNetworkManager>();
        parameterManager     = GameObject.Find("ParameterManager").GetComponent <ParameterManager>();
        manager        = GameObject.Find("Manager").GetComponent <Manager>();
        textController = transform.Find("TextController").GetComponent <TextController>();
    }
Example #21
0
    void toggleReady(int playerId)
    {
        // Toggle Ready
        TextController playerTextController = playerTextObjects [playerId].GetComponent <TextController>();
        bool           isReady = (bool)playerReady[playerId];

        if (!isReady)
        {
            // Save selected model type
            KatModelSelector modelSelector = playerObjects [playerId].GetComponent <KatModelSelector> ();
            playerModels [playerId] = modelSelector.getCurrentModel();
            // -> Ready Up
            playerTextController.changeText("READY", 55);
            playerReady [playerId] = true;
            modelSelector.isReady  = true;
            playReadyAudio();
        }
        else
        {
            // -> Not ready
            playerTextController.changeText("Press 'Left' or 'Right' to \nchange your Kat! \nPress 'Start' again to Ready!", 38);
            playerReady [playerId] = false;
            KatModelSelector modelSelector = playerObjects [playerId].GetComponent <KatModelSelector> ();
            modelSelector.isReady = false;
        }

        // Check if all ready
        if (isAllReady())
        {
            Debug.Log("All Ready");
            GoToGameScreen();
            bgmAudio.Stop();
        }
    }
Example #22
0
        protected override void OnInit()
        {
            base.OnInit();

            ButtonController button = CreateItem(UIComponentManager.Components.button, UIContainerTag.Tag0);

            button.Text   = "назад";
            button.Click += () => HideShow <MainMenuScreen>();

            TextController title = CreateItem(UIComponentManager.Components.text, UIContainerTag.Tag3);

            title.Text = "сезончик";
            title.TextComponent.fontSize = 30;

            ButtonController leftButton = CreateItem(UIComponentManager.Components.button, UIContainerTag.Tag4);

            leftButton.Text   = "лево";
            leftButton.Click += UpdateLevelList;

            ButtonController rightButton = CreateItem(UIComponentManager.Components.button, UIContainerTag.Tag5);

            rightButton.Text   = "право";
            rightButton.Click += UpdateLevelList;

            _levelList = CreateItem(UIComponentManager.Components.collectionView, UIContainerTag.Tag1);
            UpdateLevelList();
            _levelList.CollectionGrouper.SetAsList(60f, 10f);
        }
        private IEnumerator ActivateBackground()
        {
            TextController.ActivateCanvas(false);
            yield return(new WaitForSecondsRealtime(1));

            GameElements.GetComponent <SpriteRenderer>().enabled = true;
        }
Example #24
0
        private void Start()
        {
            Player player1 = new Player(Player.PlayerPosition.Self);

            player1.AddPlayZone(PlaySelfZone);
            Player player2 = new Player(Player.PlayerPosition.Right);

            player2.AddPlayZone(PlayRightZone);
            Player player3 = new Player(Player.PlayerPosition.Left);

            player3.AddPlayZone(PlayLeftZone);

            Players.Add(player1);
            Players.Add(player2);
            Players.Add(player3);
            _selfPos  = Players[0].GetPlayerRealPosition();
            _rightPos = Players[1].GetPlayerRealPosition();
            _leftPos  = Players[2].GetPlayerRealPosition();

            UIEventListener.Get(StartBt.gameObject).onClick        = StartGameButtonClick;
            UIEventListener.Get(CallLandLordBt.gameObject).onClick = CallLandLordButtonClick;
            UIEventListener.Get(PassLandLordBt.gameObject).onClick = PassLandLordButtonClick;
            UIEventListener.Get(PlayBt.gameObject).onClick         = PlayButtonClick;
            UIEventListener.Get(PassBt.gameObject).onClick         = PassButtonClick;
            UIEventListener.Get(TipsBt.gameObject).onClick         = TipsButtonClick;

            //得到TextController
            _textController = transform.GetComponent <TextController>();
            _gameController = transform.GetComponent <GameController>();
        }
        static void Main(string[] args)
        {
            //Controller
            TextController textController = new TextController();

            //Input
            Boolean option = true;

            while (option)
            {
                try
                {
                    Console.WriteLine("============[Bienvenido!]============");
                    Console.WriteLine("[ Por favor, a continuación ingrese la\n palabra que desea convertir! ]");
                    string resultCoords = textController.getNumberSecuence(Console.ReadLine());
                    Console.WriteLine($"Tus cordenadas numéricas serán: {resultCoords}");
                    Console.WriteLine("[ ¿Desee cargar otra palabra? (y/n) ]");
                    Console.WriteLine("==================[]=================");
                    option = Console.ReadLine() == "n" ? false : true;
                    Console.Clear();
                    Console.WriteLine(". . .Adiós!");
                }
                catch (System.Exception e)
                {
                    Console.Clear();
                    Console.WriteLine($"Error Handler says: ´{e.Message}´ Executing => restarting the app...\n");
                }
            }
        }
Example #26
0
 private void Awake()
 {
     //UI
     speedup_text   = new TextController(textType.announce);
     speeddown_text = new TextController(textType.announce);
     gameover_text  = new TextController(textType.gameover);
     CTS            = GetComponent <changeText>();
 }
        private IEnumerator Talk()
        {
            yield return(TextController.ShowCharactersNextBubbleText(Character.Pollin));

            yield return(TextController.ShowCharactersNextBubbleText(Character.Muni));

            DisableFollowingCamera();
        }
Example #28
0
    // Use this for initialization
    void Start()
    {
        m_textController    = GetComponent <TextController>();
        m_commandController = GetComponent <CommandController>();

        UpdateLines(LoadFileName);
        RequestNextLine();
    }
 private void ShowOne(GameObject go, int number, bool show)
 {
     go.GetComponent <Renderer>().enabled = show;
     if (show)
     {
         TextController.ReplaceSprite("Number/Score/" + number, go);
     }
 }
    // Start is called before the first frame update
    async void Start()
    {
        this.textController = this.UIText.GetComponent <TextController>();

        var signalRConnData = await this.GetSignalRConnDataAsync();

        await this.StartSignalRAsync(signalRConnData);
    }
	//
	// Initialize
	//
	void Start () {
		livesLeft = totalLives;
		
		// Link the level mgr 
		levelManager = Object.FindObjectOfType<LevelManager>();	
		textController = GameObject.FindObjectOfType<TextController>();
		
//		camera = Object.FindObjectOfType<Camera>();	
	}
Example #32
0
 public void LoadLevel(string name)
 {
     //Debug.Log ("Level load requested for: " + name);
     Application.LoadLevel(name);
     textControl = GameObject.FindObjectOfType<TextController>();
     textControl.PrintLivesLeft();
     textControl.PrintScore();
     Bricks.breakableCount=0;
 }
Example #33
0
 void OnTriggerEnter2D(Collider2D trigger)
 {
     //print("Trigger");
     // decrese lives until 0 then end
     levelManager=GameObject.FindObjectOfType<LevelManager>();
     textControl=GameObject.FindObjectOfType<TextController>();
     ball = GameObject.FindObjectOfType<Ball>();
     LevelManager.GameLives--;
     //Debug.Log (LevelManager.GameLives);
     if (LevelManager.GameLives <=0) {
         levelManager.LoadLevel("Lost Game");
     } else {
         ball.BallReset();
         textControl.PrintLivesLeft();
     }
 }
Example #34
0
    void Start()
    {
        m_textController = GetComponent<TextController>();
        m_commandController = GetComponent<CommandController>();

        UpdateLines(LoadFileName);
        RequestNextLine();
    }
Example #35
0
 // Use this for initialization
 void Start()
 {
     CountBreakable();
     timesHit = 0;
     levelManager = GameObject.FindObjectOfType<LevelManager>();
     levelGenerator = GameObject.FindObjectOfType<LevelGenerator>();
     textControl = GameObject.FindObjectOfType<TextController>();
 }
Example #36
0
 void Awake()
 {
     instance = this;
 }
Example #37
0
    private void addSimpleDialog(string res, TextController ti, DabingController di)
    {
        var entries = res.Split(new[] { '=' }, 2);
        if (entries.Length != 2)
        {
            Debug.LogErrorFormat("Neplatná řádka: {0}", res);
            return;
        }

        var lines = entries[1].Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
        var dialogLines = new List<DialogLine>(lines.Length);
        dialogLines.AddRange(
            from line in lines
            let actor = line.Substring(0, 4)
            select new DialogLine(Statics.ActorMappings[actor], ti.GetText(entries[0]), di.GetClip(entries[0])));

        dialogs.Add(entries[0], new Dialog
        {
            DialogLines = dialogLines
        });
    }
Example #38
0
    // Use this for initialization
    void Start()
    {
        instance = this;
        ParagraphPanels.Add (p1);
        ParagraphPanels.Add (p2);
        ParagraphPanels.Add (p3);
        ParagraphPanels.Add (p4);

        ParagraphObjects = new List<ParagraphObject> ();
        ParagraphObjects.Add(TextPool.instance.GetParagraph(0));
        ParagraphObjects.Add(TextPool.instance.GetParagraph(1));
        ParagraphObjects.Add(TextPool.instance.GetParagraph(2));
        ParagraphObjects.Add(TextPool.instance.GetParagraph(3));

        ParagraphPanels[0].GetComponent<Text> ().enabled = false;
        ParagraphPanels[1].GetComponent<Text> ().enabled = false;
        ParagraphPanels[2].GetComponent<Text> ().enabled = false;
        ParagraphPanels[3].GetComponent<Text> ().enabled = false;

        SetWholeText ();
    }