private void Start()
    {
        player          = FlameKeeper.Get().levelController.GetPlayer();
        particleSystems = new List <ParticleSystem>(GetComponentsInChildren <ParticleSystem>());

        WhiteOutBehaviour whiteOutBehaviour = whiteOutAnimator.GetBehaviour <WhiteOutBehaviour>();

        whiteOutBehaviour.totemController = this;

        WhiteInBehaviour whiteInBehaviour = whiteOutAnimator.GetBehaviour <WhiteInBehaviour>();

        whiteInBehaviour.totemController = this;

        if (startWhite)
        {
            whiteOutAnimator.SetBool("StartWhite", true);
            whiteOutAnimator.SetBool("WhiteIn", false);
            whiteOutAnimator.SetBool("WhiteOut", true);

            player.DisableInput();

            if (!FlameKeeper.Get().levelController.CutscenesDisabled() && startingCutscene != null && startingCamera != null)
            {
                startingCamera.Priority = 100; // Start on the cutscene camera, but don't play it just yet
            }
        }

        foreach (ParticleSystem particleSystem in particleSystems)
        {
            particleSystem.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
        }
    }
Beispiel #2
0
 private void Start()
 {
     player           = FlameKeeper.Get().levelController.GetPlayer();
     targetRotation   = Quaternion.identity;
     startingPosition = this.transform.position;
     targetPosition   = this.transform.position;
 }
Beispiel #3
0
 public void PlayExample()
 {
     if (!FlameKeeper.Get().levelController.CutscenesDisabled())
     {
         StartCoroutine(ShowExample());
     }
 }
Beispiel #4
0
    private void SetPaused(bool paused)
    {
        if (isPaused == paused)
        {
            return;
        }

        isPaused       = paused;
        Time.timeScale = isPaused ? 0.0f : 1.0f;
        pauseMenu.SetActive(isPaused);
        selectedIndex = 0;
        postProcessingProfile.depthOfField.enabled = isPaused;

        for (int i = 0; i < options.Count; i++)
        {
            options[i].SetState(i == selectedIndex);
        }

        if (isPaused && FlameKeeper.Get().levelController.GetPlayer().IsInputEnabled())
        {
            didPauseStopInput = true;
            FlameKeeper.Get().levelController.GetPlayer().DisableInput();
        }
        else if (!isPaused && didPauseStopInput)
        {
            didPauseStopInput = false;
            FlameKeeper.Get().levelController.GetPlayer().EnableInput();
        }
    }
Beispiel #5
0
 void Update()
 {
     if (CheckIfFinished() && !played && !(FlameKeeper.Get().levelController.CutscenesDisabled()))
     {
         StartCoroutine(OnFinish());
         played = true;
     }
 }
Beispiel #6
0
        public float duration; //ie, how long its been playing for

        public OrbitalOutAnimation(Transform orbital, Vector3 target, Action onComplete = null)
        {
            this.orbital       = orbital;
            this.target        = target;
            this.onComplete    = onComplete;
            this.duration      = 0.0f;
            this.startToPlayer = orbital.transform.position - FlameKeeper.Get().levelController.GetPlayer().transform.position;
        }
 public void PlayTimeline()
 {
     if (!FlameKeeper.Get().levelController.CutscenesDisabled())
     {
         director.Play();
         duration = (float)timeline.duration;
         StartCoroutine(Freeze());
     }
 }
 private void OnTriggerEnter(Collider other)
 {
     FlameKeeper.Get().dataminingController.StopTrackingScene();
     if (other.CompareTag(StringConstants.Tags.Player))
     {
         player.DisableInput();
         player.MoveToPoint(endPoint.position, OnPlayerFinishMove);
     }
 }
Beispiel #9
0
 void Start()
 {
     if (FlameKeeper.Get().levelController.CutscenesDisabled())
     {
         foreach (ActivatableObject comp in objectsToPlay)
         {
             comp.enabled = true;
         }
     }
 }
    IEnumerator Freeze()
    {
        yield return(new WaitForSeconds(0.1f));

        player = FlameKeeper.Get().levelController.GetPlayer();
        player.DisableInput();
        yield return(new WaitForSeconds(duration));

        player.EnableInput();
    }
 // Start is called before the first frame update
 void Start()
 {
     director = this.gameObject.GetComponent <PlayableDirector>();
     if (!FlameKeeper.Get().levelController.CutscenesDisabled() && startOnAwake)
     {
         director.Play();
         duration = (float)timeline.duration;
         StartCoroutine(Freeze());
     }
 }
    private void Update()
    {
        PlayerControllerSimple player = FlameKeeper.Get().levelController.GetPlayer();
        float playerZ = player.transform.position.z;
        float t       = Mathf.Clamp((playerZ - startingZValue) / (endingZValue - startingZValue), 0.0f, 1.0f);
        float depth   = Mathf.Lerp(startingCameraDepth, endingCameraDepth, t);
        float height  = Mathf.Lerp(startingCameraHeight, endingCameraHeight, t);

        levelCamera.transform.localPosition = new Vector3(levelCamera.transform.localPosition.x, height, depth);
        pedestalSpotlight.intensity         = Mathf.Lerp(startingSpotlightIntensity, endingSpotlightIntensity, t);
    }
    /// <summary>
    /// Reset the player back to their last checkpoint (ie, last pedestal lit)
    /// </summary>
    public void GoToLastCheckpoint()
    {
        FlameKeeper.Get().dataminingController.OnPlayerRespawn();

        animator.SetBool(drownAnimBool, false);
        animator.SetTrigger("StopDrown");

        this.transform.position = checkpointPosition;
        this.rb.velocity        = Vector3.zero;

        lockMovementTime = 1.0f;
    }
    public void OnWhiteOutComplete()
    {
        whiteOutAnimator.SetBool("StartWhite", false);

        if (!FlameKeeper.Get().levelController.CutscenesDisabled() && startingCutscene != null && startingCamera != null)
        {
            startingCutscene.PlayTimeline();
            startingCamera.Priority = 1;
        }
        else
        {
            player.EnableInput();
        }
    }
Beispiel #15
0
    protected override void OnLevelStart()
    {
        base.OnLevelStart();

        // Link references to our state behaviours for animation callbacks
        StoryStateBehaviour storyStateBehaviour = storyAnimator.GetBehaviour <StoryStateBehaviour>();

        storyStateBehaviour.mainMenuConfig = this;

        WipeOutStateBehaviour wipeOutStateBehaviour = storyAnimator.GetBehaviour <WipeOutStateBehaviour>();

        wipeOutStateBehaviour.mainMenuConfig = this;

        FlameKeeper.Get().musicController.FadeIn(MusicController.MusicTracks.MainTheme, 5.0f);
    }
Beispiel #16
0
    private void Awake()
    {
        if (_instance != null)
        {
            Debug.LogError("Trying to create multiple game manager singletons!");
            Destroy(this);
            return;
        }

        _instance = this;
        DontDestroyOnLoad(this);
        SetupControllers();

        Cursor.visible = cursorVisible;
    }
Beispiel #17
0
    /// <summary>
    /// Use this to get the universal game manager that is the parent manager to
    /// all game controllers.
    /// </summary>
    /// <returns> The benevolent game manager </returns>
    public static FlameKeeper Get()
    {
        if (_instance == null)
        {
            // Game didn't start from root or the game manager got deleted.
            // Warn that the game is in "simulator" mode and wasn't created organically
            Debug.LogError("No game manager, creating one now (Simulation Mode)");
            GameObject gob = Instantiate(Resources.Load <GameObject>(StringConstants.PrefabPaths.ManagerPath));
            DontDestroyOnLoad(gob);
            _instance = gob.GetComponent <FlameKeeper>();
            _instance.SetupControllers();
            _instance.levelController.StartSimulationMode();
        }

        return(_instance);
    }
    //private Totem levelTotem; or whatever, link this when we have the script

    protected override void OnLevelStart()
    {
        base.OnLevelStart();

        if (player == null)
        {
            Debug.LogError("No player assigned to this temple level's config!");
            return;
        }

        FlameKeeper.Get().dataminingController.StartTrackingScene(scene);

        // Set up the player according the level parameters
        player.Setup(playerStartingPosition,
                     startingLanternUses,
                     maxLanternUses);
    }
    void Start()
    {
        shouldTransitionIn = !FlameKeeper.Get().levelController.CutscenesDisabled();
        player             = FlameKeeper.Get().levelController.GetPlayer();

        TutorialFadeStateBehaviour tutorialFadeBehaviour = fadeInAnimator.GetBehaviour <TutorialFadeStateBehaviour>();

        tutorialFadeBehaviour.tutorialTransition = this;

        if (!shouldTransitionIn)
        {
            overlayImage.color = Color.clear;
            fadeInAnimator.SetBool("Skip", true);
        }
        else
        {
            overlayImage.color = Color.black;
            player.DisableInput();
            startingCamera.Priority = 100; // Start on the cutscene camera, but don't play it just yet
            fadeInAnimator.SetBool("Start", true);
        }
    }
    /// <summary>
    /// Assign gameobject references and initialize variables
    /// </summary>
    private void Start()
    {
        currentLevel    = startLevel;
        currentOrbitals = startLevel;
        pointLightController.Setup(this);
        player = FlameKeeper.Get().levelController.GetPlayer();

        // Check to see if the pedestal is set up correctly
        if (orbitalTargets.Count != maxLevel)
        {
            Debug.LogWarning("Not enough orbital targets set for " + this);
        }

        if (emitters.Count != maxLevel)
        {
            Debug.LogWarning("Not enough emitters set for " + this);
        }

        if (currentLevel > 0)
        {
            activated = true;
            ActivatePedestal();
        }

        if (emitters.Count > 0)
        {
            emissionColor = emitters[0].materials[1].color;
        }

        foreach (MeshRenderer ren in emitters)
        {
            emissionColorLerpTimes.Add(0.0f);
        }

        audioController = (GameObject)Instantiate(Resources.Load("audioController"), this.transform.position, this.transform.rotation);
        audioController.transform.SetParent(this.transform);

        flameParticleSystems = GetParticleSystems();
    }
Beispiel #21
0
    private void DoAction(PauseOptionType action)
    {
        switch (action)
        {
        case PauseOptionType.ReturnToMenu:
            SetPaused(false);
            FlameKeeper.Get().ResetGame();
            break;

        case PauseOptionType.RestartLevel:
            SetPaused(false);
            FlameKeeper.Get().RestartLevel();
            break;

        case PauseOptionType.Quit:
            FlameKeeper.Get().CloseApplication();
            break;

        default:
        case PauseOptionType.ReturnToGame:
            SetPaused(false);
            break;
        }
    }
 public void Start()
 {
     FlameKeeper.Get().musicController.FadeOut(5.0f);
 }
Beispiel #23
0
    private void Start()
    {
        player = FlameKeeper.Get().levelController.GetPlayer();

        startingRotation = this.transform.rotation;
    }
 void Start()
 {
     FlameKeeper.Get().levelController.GetPlayer().DisableRotation();
 }
Beispiel #25
0
 void Start()
 {
     played = false;
     player = FlameKeeper.Get().levelController.GetPlayer();
 }