Exemple #1
0
    void Update()
    {
        if (GameStateManager.isStartGame())
        {
            startGameObjects.SetActive(true);
            midGameObjects.SetActive(false);
        }

        if (GameStateManager.isMidGame())
        {
            mainNavigationSystem.SetTarget(Mars);
            midGameObjects.SetActive(true);
            startGameObjects.SetActive(false);
        }

        if (GameStateManager.isInGame() && !GameStateManager.isTutorial())
        {
            GameStateManager.AllowStarShipHook();
            GameStateManager.ShowPlanetNavigationSystem();
            GameStateManager.ShowFuelNavigationSystem();
            GameStateManager.ShowVestaNavigationSystem();

            if (!comunicationsWriter.HasAlreadyWritten() && !GameStateManager.isCheckpoint())
            {
                comunicationsWriter.Write(sentence0_1);
            }

            // Liftoff
            if (!gameStarted && Input.GetAxis("Vertical") > 0)
            {
                gameStarted = true;
                GameStateManager.AllowStarShipMovements();
                GameStateManager.ShowHUD();
                if (!GameStateManager.isCheckpoint())
                {
                    comunicationsWriter.Write(sentence0_2);
                }
            }

            // end extreme danger message
            if (extremeDangerAudio.isPlaying && !EnemiesManager.isExtremeDanger())
            {
                if (!extremeDangerEndWriter.HasAlreadyWritten())
                {
                    extremeDangerEndWriter.Write(sentence_extreme_danger_end);
                }
            }
        }
    }
 // Use this for initialization
 void Start()
 {
     WorldMapController.instance_.energy = 100f;
     pingAnimator_.SetTrigger("Ping");
     textWriter_.Write(textWritten_, true, false);
     startButton_.onClick.AddListener(() => StartGameAnim());
 }
Exemple #3
0
    IEnumerator StartWriting()
    {
        yield return(new WaitForSecondsRealtime(3f));

        gameOverWriter.Write(gameOverSentence);
        yield return(null);
    }
Exemple #4
0
 public void EndStep1()
 {
     step1Trigger.SetActive(false);
     step1Writer3.Write(step1Sentence3);
     tutorialTargetsNavigationSystem.Hide();
     GameStateManager.BlockStarShipMovements();
 }
Exemple #5
0
 public void EndStep3()
 {
     step3Trigger.SetActive(false);
     step3Writer3.Write(step3Sentence3);
     GameStateManager.ShowFuelNavigationSystem();
     tutorialTargetsNavigationSystem.Hide();
 }
Exemple #6
0
    IEnumerator StartEndGame()
    {
        yield return(new WaitForSeconds(1f));

        cam.SetDistance(130);
        endStoryWriter.Write(endStory_text);
    }
Exemple #7
0
 public void ShowHUD()
 {
     Starship.oxygen = 100;
     GameStateManager.ShowHUD();
     step2Writer1.Write(step2Sentence1);
     GameStateManager.AllowStarShipMovements();
 }
Exemple #8
0
 public void Step4_Planet_Landing_Message()
 {
     if (!step4Writer3.HasAlreadyWritten() && TutorialStateManager.isStep4())
     {
         step4Writer3.Write(step4Sentence3);
         GameStateManager.BlockStarShipMovements();
     }
 }
Exemple #9
0
 public void StartStep3_Hook()
 {
     TutorialStateManager.Step3();
     step3Trigger.SetActive(true);
     step3Writer1.Write(step3Sentence1);
     tutorialTargetsNavigationSystem.SetTarget(step3Trigger);
     tutorialTargetsNavigationSystem.Show();
 }
Exemple #10
0
 public void EndStep4()
 {
     TutorialStateManager.Step5();
     if (!step5Writer1.HasAlreadyWritten())
     {
         step5Writer1.Write(step5Sentence1);
     }
     GameStateManager.ShowVestaNavigationSystem();
 }
Exemple #11
0
 public void Step3_Hook_Message()
 {
     if (!step3Writer2.HasAlreadyWritten() && TutorialStateManager.isStep3())
     {
         Starship.fuel = 0;
         step3Writer2.Write(step3Sentence2);
         GameStateManager.BlockStarShipMovements();
     }
 }
Exemple #12
0
 public void Step2_Attract_Message()
 {
     if (!step2Writer2.HasAlreadyWritten() && TutorialStateManager.isStep2())
     {
         Starship.fuel = 100;
         step2Writer2.Write(step2Sentence2);
         GameStateManager.BlockStarShipMovements();
     }
 }
Exemple #13
0
 public void StartStep1_Movements()
 {
     // GameStateManager.BlockStarShipMovements();
     GameStateManager.AllowStarShipMovements();
     TutorialStateManager.Step1();
     step1Trigger.SetActive(true);
     step1Writer2.Write(step1Sentence2);
     tutorialTargetsNavigationSystem.Show();
     tutorialTargetsNavigationSystem.SetTarget(step1Trigger);
 }
Exemple #14
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Starship")
     {
         if (write)
         {
             if (writeOnlyOnce)
             {
                 write = false;
             }
             typeWriter.Write(sentences);
         }
     }
 }
Exemple #15
0
    void Update()
    {
        if (GameStateManager.isIntro())
        {
            introAnimation.SetBool("showIntro", true);

            if (!writing)
            {
                Debug.Log("Initial Story");
                plotWriter.Write(initialPlot);
                writing = true;
            }
        }
        else
        {
            introAnimation.SetBool("showIntro", false);
        }
    }
Exemple #16
0
    void Update()
    {
        // Starts tutorial
        if (GameStateManager.isTutorial())
        {
            tutorialTargetsNavigationSystem.gameObject.SetActive(true);

            if (TutorialStateManager.isTutorialWaiting())
            {
                if (!tutorialAudio.isPlaying)
                {
                    tutorialAudio.Play();
                }
                tutorialSnapshot.TransitionTo(0.1f);
                GameStateManager.BlockStarShipMovements();
                TutorialStateManager.StartTutorial();
                tutorialObjects.SetActive(true);
                step1Writer1.Write(step1Sentence1);
            }

            if (TutorialStateManager.isTutorialEnded())
            {
                // firstPersonWriter.Write(fpSentence1);
                Debug.Log("Step ended");
                hideTutorialObjects();
            }


            if (!GameStateManager.isPaused() && Input.GetButtonDown("Back"))
            {
                // TutorialStateManager.EndTutorial();
                // TODO: Implement Skip tutorial
                Debug.Log("Skip tutorial");
                EndTutorial();
            }
        }
        else
        {
            tutorialTargetsNavigationSystem.gameObject.SetActive(false);
        }
    }
Exemple #17
0
 public void StartCredits()
 {
     GameStateManager.StartCredits();
     credits.Write(credits_text);
 }
Exemple #18
0
 public void StartStep4_Planets()
 {
     TutorialStateManager.Step4();
     step4Writer1.Write(step4Sentence1);
     Starship.oxygen = 100;
 }
Exemple #19
0
 public void EndStep2()
 {
     step2Trigger.SetActive(false);
     step2Writer3.Write(step2Sentence3);
     tutorialTargetsNavigationSystem.Hide();
 }
Exemple #20
0
        public async Task Invoke(HttpContext context)
        {
            var response = context.Response;
            var request  = context.Request;

            if (!request.Path.StartsWithSegments("/_types") || request.Method != "GET")
            {
                await _next(context);

                return;
            }

            var requestPath = request.Path.ToString().ToLower();

            if (requestPath.EndsWith("/"))
            {
                requestPath = requestPath.Substring(0, requestPath.Length - 1);
            }

            if (Cache.ContainsKey(requestPath))
            {
                await WriteResponse(response, Cache[requestPath]);

                return;
            }

            var pathSegments = requestPath.Split('/');

            if (pathSegments.Length != 3)
            {
                response.StatusCode = 404;
                return;
            }

            var controllerName = pathSegments[2];

            var controllerType = Assembly.GetEntryAssembly()?
                                 .GetExportedTypes()
                                 .Where(t => t.BaseType?.Equals(typeof(ControllerBase)) ?? false)
                                 .SingleOrDefault(t => t.Name.Equals($"{controllerName}Controller", StringComparison.OrdinalIgnoreCase));

            if (controllerType == null)
            {
                response.StatusCode = 404;
                return;
            }

            var methodTypes = controllerType
                              .GetMethods(BindingFlags.Public | BindingFlags.Instance)
                              .Where(m => m.GetCustomAttribute <HttpGetAttribute>() != null)
                              .Where(m => m.ReturnType != typeof(IActionResult) && m.ReturnType != typeof(ActionResult))
                              .Select(m => m.ReturnType)
                              .ToArray();

            var producedTypes = controllerType
                                .GetMethods()
                                .Select(m => m.GetCustomAttribute <ProducesResponseTypeAttribute>())
                                .Where(x => x != null && x.StatusCode == 200)
                                .Select(x => x.Type)
                                .ToArray();

            using (var writer = new StringWriter())
            {
                var typeWriter = new TypeWriter();

                typeWriter.Write(producedTypes, writer);
                typeWriter.Write(methodTypes, writer);

                var content = writer.ToString();

                await WriteResponse(response, content);

                Cache.Add(requestPath, content);
            }
        }
Exemple #21
0
 public void Step4_Activate_Planets_Navigation_System()
 {
     step4Writer2.Write(step4Sentence2);
     GameStateManager.ShowPlanetNavigationSystem();
 }
Exemple #22
0
 public void showMapMessage()
 {
     mapMessageWriter.Write(mapMessageText);
 }
Exemple #23
0
 public void showMap()
 {
     Debug.Log("Map");
     mapWriter.Write(mapText);
     mapAnimator.SetBool("showMap", true);
 }
Exemple #24
0
 public void showSecondPart()
 {
     mapAnimator.SetBool("showMap", false);
     plotWriter2.Write(initialPlot2);
     Debug.Log("Second part initial story");
 }