DaytimeManager.cs 1.79 KB
Newer Older
1
2
3
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
4
using UnityEngine.SceneManagement;
5
using UnityEngine.UI;
6
7
8
9
10

public class DaytimeManager : MonoBehaviour {

    public static float groundLevel = -4;

11
    private bool pauseMenuActive = false;
12
    public GameObject Ahava;
13

14
15
    public static bool enteringName;

16
    void Start() {
mmaluschnig's avatar
mmaluschnig committed
17
18
19
        if (Ahava!= null && Ahava.activeSelf)
        {
            float newLevel = 1
20
21
                + ((GameManager.JohnLevel-1) * 0.5f)
                + ((GameManager.SilasLevel-1) * 0.5f)
mmaluschnig's avatar
mmaluschnig committed
22
23
24
                + ((GameManager.SimonLevel-1)*0.5f);
            if (newLevel > 4) newLevel = 4;

mmaluschnig's avatar
mmaluschnig committed
25
26
27
28
            float diffinLevels = newLevel - GameManager.AhavaLevel;
            print("diff" + diffinLevels);
            print("start" + GameManager.AhavaLevel % 1);
            if ((GameManager.AhavaLevel % 1) + diffinLevels > 1)
mmaluschnig's avatar
mmaluschnig committed
29
30
            {
                print("Level Up Ahava");
mmaluschnig's avatar
mmaluschnig committed
31
32
33
34
35
36
                GameManager.AhavaLevelUp = true;
            }
            GameManager.AhavaLevel = newLevel;

            GameManager.ConversationStage = (int)GameManager.AhavaLevel;
            print("ahava Lvl" + GameManager.AhavaLevel);
37
        }
38

mmaluschnig's avatar
mmaluschnig committed
39

40
41
42
43
44
    }

    void Update() {
    }

45
   public static void beginPerformance() {
46
47
        SceneManager.LoadScene("NightMenu");
    }
48
49

    public void changePlayerName(GameObject name) {
50
51
52
53
54
55
56
57
58
        string newName = name.GetComponent<InputField>().text;
        if (newName == "")
        {
            GameManager.playerName = "Lech";
        }
        else
        {
            GameManager.playerName = newName;
        }
59
60
61
        print(GameManager.playerName);
        name.SetActive(false);
        enteringName = false;
62
        Ahava.GetComponent<CharacterInteractions>().ProgressConversation();
63
    }
64
}