Пример #1
0
    void Awake()
    {
        overlay.GetComponent <Canvas>().renderMode = RenderMode.WorldSpace;
        characterIntroductionInterface.GetComponent <Canvas>().renderMode = RenderMode.WorldSpace;
        actionInterface.GetComponent <Canvas>().renderMode = RenderMode.WorldSpace;

        musicScript = musicManager.GetComponent <MusicScript>();
        musicScript.Init();
        musicScript.PlayMusicForLevel(riskAmount);

        story = new Story();

        string filePath   = Path.Combine(Application.streamingAssetsPath, "story.json");
        string dataAsJson = File.ReadAllText(filePath);

        story = JsonUtility.FromJson <Story>(dataAsJson);

        actionImageComponent = actionImage.GetComponent <Image>();
        actionImage.SetActive(false);

        audioSourceComponent = gameObject.GetComponent <AudioSource>();

        timerBar.maxValue = MAX_TIMER_VALUE;
        timerBar.value    = timerBar.maxValue;

        playerScript = player.GetComponent <PlayerScript>();
        playerScript.InitialPlayer();

        ChangeToIntroductionState();
    }