Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     instance                = this;
     audioSource             = gameObject.AddComponent <AudioSource>();
     audioSource.playOnAwake = false;
     StartCoroutine("PlayWelcome");
 }
Exemplo n.º 2
0
        private static void Main(string[] args)
        {
            var bcDirInput    = ExtractArg(args, 0);
            var logLevelInput = ExtractArg(args, 1);

            var logger = GetLogger(logLevelInput);

            var directory = GetDirectory(bcDirInput);

            var narrator = new Narrator(directory, logger);

            Console.WriteLine("Press enter to start hosting bounded context");
            Console.WriteLine();
            Console.ReadLine();

            narrator.Start();

            while (true)
            {
                var command = Console.ReadLine();

                if (command == "Exit Hosting")
                {
                    break;
                }
            }
        }
Exemplo n.º 3
0
 private void InitializeComponents()
 {
     audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <AudioSource>();
     faderPanel   = GameObject.FindGameObjectWithTag("FaderPanel").GetComponent <Image>();
     autoRotator  = FindObjectOfType <AutoRotate>();
     narrator     = FindObjectOfType <Narrator>();
 }
Exemplo n.º 4
0
 public override void Act()
 {
     if (!string.IsNullOrEmpty(wakupMessage))
     {
         if (remainingActionPoints == actionsPerTurn)
         {
             if (!emittedMesasge)
             {
                 Narrator.ShowPieceByKey(wakupMessage);
                 emittedMesasge = true;
             }
             else
             {
                 Narrator.ClearDisplay(wakupMessage);
                 wakupMessage = "";
             }
         }
     }
     for (int i = 0; i < 4; i++)
     {
         if (Walk())
         {
             break;
         }
     }
 }
Exemplo n.º 5
0
        public override void CommandReceived(int signal)
        {
            Narrator.StopNarration();
            switch (signal)
            {
            case EXIT:
                OnIntroductionStoped(Narrator.GetMediaHandler());
                OnStepIntoMenu(null);
                return;

            case BACK_TO_PARENT_MENU:
                OnIntroductionStoped(Narrator.GetMediaHandler());
                OnStepIntoMenu(Parent);
                return;
            }

            foreach (var child in ChildMenus)
            {
                if (child.TouchToneKey == signal.ToString())
                {
                    OnIntroductionStoped(Narrator.GetMediaHandler());
                    OnStepIntoMenu(child);
                    return;
                }
            }

            //Wrong signal received so it restarts the playing.
            Narrator.Finished += Narrator_IntroductionFinished;
            RestartIntroduction();
        }
        public override void CommandReceived(int signal)
        {
            Narrator.StopNarration();
            switch (signal)
            {
            case EXIT:
                OnIntroductionStoped(Narrator.GetMediaHandler());
                OnStepIntoMenu(null);
                return;

            case BACK_TO_PARENT_MENU:
                OnIntroductionStoped(Narrator.GetMediaHandler());
                OnStepIntoMenu(Parent);
                return;
            }
            for (int i = 1; i < 10; i++)
            {
                if (signal == i && !string.IsNullOrEmpty(TransferDestinations[i - 1].Destination))
                {
                    OnCallTransferRequired(TransferDestinations[i - 1].Destination);
                    return;
                }
            }
            RestartIntroduction();
        }
Exemplo n.º 7
0
 private void OnDestroy()
 {
     if (_instance == this)
     {
         _instance = null;
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// Indicates the post message has read. The call ends.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void narrator_PostIntroductionFinished(object sender, EventArgs e)
 {
     Narrator.Finished -= narrator_PostIntroductionFinished;
     OnIntroductionStoped(Narrator.GetMediaHandler());
     Narrator.Finished += Narrator_IntroductionFinished;
     OnStepIntoMenu(null);
 }
Exemplo n.º 9
0
        public string Save()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("[MAPCONDITION]");
            sb.AppendLine();
            sb.Append(String.Format("exists:{0}", Exists));
            sb.AppendLine();
            sb.Append(String.Format("startIndex:{0}", StartIndex));
            sb.AppendLine();
            sb.Append(String.Format("endIndex:{0}", EndIndex));
            sb.AppendLine();
            Enemy     e = null;
            Narrator  n = null;
            Character c = null;

            if (mapCond is Enemy)
            {
                e = (Enemy)mapCond;
            }
            else if (mapCond is Narrator)
            {
                n = (Narrator)mapCond;
            }
            else if (mapCond is Character)
            {
                c = (Character)mapCond;
            }
            sb.Append(e != null ? e.Save() : n != null ? n.Save() : c.Save());
            sb.AppendLine();
            sb.Append("[MAPCONDITION]");
            return(sb.ToString());
        }
Exemplo n.º 10
0
        public ActionResult DeleteConfirmed(int id)
        {
            Narrator narrator = db.Narrators.Find(id);

            db.Narrators.Remove(narrator);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 11
0
    // ================================================================================
    //  unity methods
    // --------------------------------------------------------------------------------

    void Awake()
    {
        _rooms         = FindObjectOfType <Rooms>();
        _narrator      = FindObjectOfType <Narrator>();
        _playerDisplay = FindObjectOfType <PlayerDisplay>();

        _cameraShake = FindObjectOfType <CameraShake>();
    }
Exemplo n.º 12
0
    void NarratorItemUpdate(Narrator nar, NarratorData dat, int index)
    {
        var mod = nar.content.model.parent;

        mod.data.sizeDelta.y = dat.contentSize.y + 80;
        nar.content.text     = dat.content;
        ModelElement.ScaleSize(mod);
    }
Exemplo n.º 13
0
 // Use this for initialization
 void Start()
 {
     dialogue     = GetComponent <Dialogue>();
     scriptHolder = GetComponent <ScriptHolder>();
     narrator     = GetComponent <Narrator>();
     playerMic    = GetComponent <PlayerMic>();
     PlayerAudio  = GameObject.Find("/OVRPlayerController").GetComponent <AudioSource>();
 }
Exemplo n.º 14
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var passedEnvironment = e.Parameter as IWriterEnvironment;

            var environment = passedEnvironment ?? new UwpWriterEnvironment();

            _model = new ApplicationModel(environment);
            ((INotifyPropertyChanged)_model.Environment.Settings).PropertyChanged +=
                (s, ee) => _model.RefreshSuggestionsView();
            TheHost.Model = _model;
            _demo         = ApplicationDemo.Create(this);
            var vocalizer = NarratorVocalization.Create(TheMediaElement, "en");

            _ = Narrator.AttachNarrator(_model, vocalizer);

            if (e.Parameter == null)
            {
                _model.Environment.Settings.SpeakWordByWord            = false;
                _model.Environment.Settings.SpeakWordByWord            = false;
                _model.Environment.Settings.FindFollowOnPredictions    = false;
                _model.Environment.Settings.CombineCorePredictions     = false;
                _model.Environment.Settings.FindCorePredictionPrefixes = false;
                _model.Environment.Settings.FindCorePredictionSuffixes = false;
            }
            else if (passedEnvironment == null)
            {
                IsEnabled = false;
                try
                {
                    var values = ApplicationData.Current.LocalSettings.Values;
                    foreach (WriterSettingName name in Enum.GetValues(typeof(WriterSettingName)))
                    {
                        var ob = values[name.ToString()];
                        if (ob != null)
                        {
                            var value = (bool)ob;
                            _model.Environment.Settings.Set(name, value);
                        }
                    }
                    ((INotifyPropertyChanged)_model.Environment.Settings).PropertyChanged += (s, ee) =>
                    {
                        if (ee.PropertyName != null && Enum.TryParse <WriterSettingName>(ee.PropertyName, out var name))
                        {
                            var value = _model.Environment.Settings.Get(name);
                            values[name.ToString()] = value;
                        }
                    };
                    await _model.LoadUtterancesAsync();
                }
                finally
                {
                    IsEnabled = true;
                }
            }
            Model = _model;
        }
Exemplo n.º 15
0
 // Start is called before the first frame update
 void Start()
 {
     SoundManager.Play("MusiqueIntro", Vector3.zero);
     Narrator.SayTextStatic(true, "Notre histoire se déroule au lendemain de la capitulation de Ville-Marie.");
     Narrator.SayTextStatic(true, "Quatre aventuriers français sont déterminés à libérer la Nouvelle-France de l'envahisseur Anglais, qui tente éperdumment de les assimiler.");
     Narrator.SayTextStatic(true, "Notre capitaine François et ses trois acolytes Pierre, Jacques et Charles, longeront alors la rive du fabuleux Saint-Laurent afin de libérer les grandes villes de la colonie.");
     Narrator.SayTextStatic(true, "Leur aventure ne se terminera pas avant une traversée complète de l'Atlantique afin d'anéantir totalement l'Angleterre.");
     StartCoroutine(ChangeScene());
 }
Exemplo n.º 16
0
 void Start()
 {
     location = GetComponentInParent <Location>();
     location.PlaceCharacter(this);
     if (!string.IsNullOrEmpty(messageOnLoad))
     {
         Narrator.ShowPieceByKey(messageOnLoad);
     }
     StartCoroutine(AudioSequencer());
 }
Exemplo n.º 17
0
 public ActionResult Edit([Bind(Include = "Id,Narrator1")] Narrator narrator)
 {
     if (ModelState.IsValid)
     {
         db.Entry(narrator).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(narrator));
 }
Exemplo n.º 18
0
    // Use this for initialization
    void Start()
    {
        narrator = GameObject.Find("Narrator").GetComponent<Narrator>();

        alpacaPlayed = PlayerPrefs.GetInt("SoundTrigger/alpacaPlayed") != 0;
        uniquePlayed = PlayerPrefs.GetInt("SoundTrigger/uniquePlayed") != 0;

        randomPlayed = false;
        GetComponent<Renderer>().enabled = false;
    }
Exemplo n.º 19
0
        public void AddNarrator(NarratorInputModel user)
        {
            var narrator = new Narrator
            {
                FirstName = user.FirstName,
                LastName  = user.LastName
            };

            _db.Narrators.Add(narrator);
            _db.SaveChanges();
        }
Exemplo n.º 20
0
        public ActionResult Create([Bind(Include = "Id,Narrator1")] Narrator narrator)
        {
            if (ModelState.IsValid)
            {
                db.Narrators.Add(narrator);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(narrator));
        }
Exemplo n.º 21
0
 private void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     else if (_instance != this)
     {
         Debug.LogError(string.Format("Two narrators active (keeping {0}, destroying {1})", _instance, this));
         Destroy(this);
     }
 }
Exemplo n.º 22
0
        public void Resolve(IRequest request)
        {
            Console.WriteLine("Observer: Football Listeners Problem");

            ITeam    homeTeam    = new Team("Real Madrid");
            ITeam    visitorTeam = new Team("Barcelona");
            Match    match       = new Match(homeTeam, visitorTeam);
            Narrator narrator    = new Narrator(match);

            match.AddObserver(narrator);
            match.Start();
        }
Exemplo n.º 23
0
        protected override void OnStart(string[] args)
        {
            LoadRefs(ConfigurationManager.AppSettings["RefsPath"]);

            var logger = new NotepadLogger(ConfigurationManager.AppSettings["LogPath"]);

            var bcPath = new DirectoryInfo(ConfigurationManager.AppSettings["BcDir"]);

            narrator = new Narrator(bcPath, logger);

            narrator.Start();
        }
Exemplo n.º 24
0
        private void MaybeAddPhrase(Dialog dialog, Narrator narrator)
        {
            var phrase = this.phraseRepository.Random(d => d.Narrator == narrator);

            if (phrase == null)
            {
                return;
            }

            dialog
            .AddPhrase(I18N.Instance.Get(phrase.TextKey))
            .AddSpace();
        }
 // This increases the round by 1
 public void AdvanceRound()
 {
     // We only increase the round if we are not on the final round already
     if (currentRound - 1 != rounds.Length)
     {
         // Increase the current round by 1
         currentRound += 1;
         // Tell the game how many boxes the player gets to choose
         boxesToChoose = rounds[currentRound];
         // The narrator tells the player how many boxes he gets to choose
         Narrator.GetComponent <Text>().text = "Please choose " + boxesToChoose + " boxes!";
     }
 }
Exemplo n.º 26
0
 public Logic(ISettings clientSettings, GMapControl map, Panel summary)
 {
     _clientSettings = clientSettings;
     _client         = new Client(_clientSettings, map);
     ResetCoords();
     _map             = map;
     _summary         = summary;
     _inventory       = new Inventory(_client);
     _navigation      = new Navigation(_client);
     _stats           = new Statistics();
     _narrator        = new Narrator(clientSettings.NarratorVolume, clientSettings.NarratorSpeed);
     _caughtInSession = new List <PokemonData>();
 }
Exemplo n.º 27
0
    /// <summary>
    /// Applies the singleton pattern.
    /// </summary>
    private void ApplySingleton()
    {
        //Singleton
        if (Instance == null)
        {
            Instance = this;
        }

        if (this != Instance)
        {
            Destroy(gameObject);
        }
    }
Exemplo n.º 28
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        instance = GetComponent <Narrator>();
        narrator = this.GetComponent <AudioSource>();
    }
Exemplo n.º 29
0
    void Awake()
    {
        narrator       = GameObject.Find("Scientist").GetComponent <Narrator> ();
        society        = ((GameObject)GameObject.Find("ExperimentHolder")).GetComponent <Society> ();
        joinButton     = GameObject.Find("JoinButton");
        unjoinButton   = GameObject.Find("UnjoinButton");
        continueButton = GameObject.Find("ContinueButton");
        bindings       = GameObject.Find("BindingsHelp");
        bindings.SetActive(false);
        joinButton.SetActive(true);
        unjoinButton.SetActive(false);

        finished = false;
    }
Exemplo n.º 30
0
 void Initialize()
 {
     goal             = GameObject.FindWithTag("Goal");
     rightBorder      = goal.transform.position.x;
     turnStateMachine = GetComponent <TurnStateMachine>();
     mainCamera       = Camera.main;
     narrator         = GetComponent <Narrator>();
     touchInput       = mainCamera.GetComponent <TouchInput>();
     triggers.AddRange(Object.FindObjectsOfType <Trigger>());
     foreach (var t in triggers)
     {
         t.gameObject.SetActive(true);
     }
 }
Exemplo n.º 31
0
    private void Awake()
    {
        narrator = GameObject.Find("Narrator").GetComponent <Narrator>();
        textMesh = GameObject.Find("Opened").GetComponent <Animator>();
        float y = gameObject.GetComponent <Collider2D>().bounds.size.y;

        isOn = true;
        off  = transform.position - (transform.up * y);
        on   = transform.position;
        Vector3 bounds    = door.GetComponent <Collider2D>().bounds.size;
        float   direction = (bounds.y > bounds.x ? bounds.y : bounds.x);

        destination = door.position + (door.up * direction);
    }
Exemplo n.º 32
0
    //ITEM LIST List<PickUp> pickUpList= new List<PickUp>();
    //COMBAT List<CombatZone> combatZones = new List<CombatZone>();

    // Use this for initialization
    void Start()
    {
        inventory.Start();
        currentGameState = GameState.INGAME;

        if (player == null) { player = GameObject.Find("Player").GetComponent<PlayerController>(); }
        if (narrator == null) { narrator = GameObject.Find("Narrator").GetComponent<Narrator>(); }


        newSession = PlayerPrefs.GetInt("GameManager/newSession", 1) <= 0 ? false : true;

        
        if(!newSession)
        {
            RespawnPlayer();
        }
        /**/
    }