Пример #1
0
 // Use this for initialization
 void Start()
 {
     //JSONNode node = JSONNode.LoadFromFile("./Assets/Resources/Text/behaviortree.json");
     tree = new StoryTree(this.gameObject);
     tree.growTree();
     curGameStatus = StoryStatus.STATUS_None;
 }
Пример #2
0
    void Start()
    {
        this.paused = false;

        dialogueHandler = new DialogueHandler();

        debrisGenerator = new GameObject("DebrisGenerator");
        debrisGenerator.transform.parent = this.transform;
        debrisGenerator.AddComponent<DebrisGeneratorScript>();

        soundManager = new GameObject("SoundManager"); //Instantiate object that carries and plays all sounds
        soundManager.transform.parent = this.transform;
        soundManager.AddComponent<SoundManager>();

        subtitleHandler = new GameObject("SubtitleHandler");
        subtitleHandler.transform.parent = this.transform;
        subtitleHandler.AddComponent<DialogueHandler>();

        dialogueManager = new GameObject("DialogueManager"); //Instantiate object that shows dialogue on screen
        dialogueManager.transform.parent = this.transform;
        dialogueManager.AddComponent<DialogueManagerScript>();

        postProcessManager = new GameObject("PostProcessManager");
        postProcessManager.transform.parent = this.transform;
        postProcessManager.AddComponent<PostProcessManagerScript>();

        storyConditionManager = new GameObject("StoryConditionManager");
        storyConditionManager.transform.parent = this.transform;
        storyConditionManager.AddComponent<StoryConditionManager>();

        oxygenBars = GameObject.Find("OxygenBars");
        oxygenBars.transform.parent = this.transform;
        oxygenBars.AddComponent<OxygenBarScript>();

        screenFader = new GameObject("ScreenFader");
        screenFader.transform.parent = this.transform;
        screenFader.AddComponent<ScreenFadeScript>();

        endStatistics = GameObject.Find("EndStatistics");
        endStatistics.transform.SetParent(this.transform);
        endStatistics.AddComponent<EndStatisticsScript>();

        initialScene = new GameObject("InitialScene");
        initialScene.transform.parent = this.transform;
        initialScene.AddComponent<InitialScene>();

        objectiveIndicator = new GameObject("ObjectiveIndicator");
        objectiveIndicator.AddComponent<ObjectiveIndicatorScript>();

        character = new GameObject("CustomCharacterController");
        // character.transform.parent = this.transform;
        character.AddComponent<CustomCharacterController>();

        drifter = GameObject.Find("Drifter");
        drifter.transform.parent = this.transform;
        drifter.AddComponent<DrifterScript>();
        drifter.transform.position = Camera.main.transform.position + drifterOffset;

        tree = new StoryTree(this.gameObject);
        tree.growTree();
        curGameStatus = StoryStatus.STATUS_None;

        GameObject.Find("StoryConditionManager").GetComponent<StoryConditionManager>().addCondition(StoryConditionValues.PlayerDead);
        GameObject.Find("StoryConditionManager").GetComponent<StoryConditionManager>().addCondition(StoryConditionValues.DrifterDead);

        dialogueHandler.hideSubtitle();

        Pause();

        //WWW gameAnalytics = this.getAnalytics();
        //WWW updateGameAnalytics = this.updateAnalytics(GAME_ANALYTICS_DID_NOT_SAVE);
    }