Exemplo n.º 1
0
    public void StartGame()
    {
        Level level = index == 0 ? Level.LEVEL1 : Level.LEVEL2;

        bool canStart = true;

        if (level == Level.LEVEL2)
        {
            LockTaskPanel panel = FindObjectOfType <LockTaskPanel>();

            canStart = !panel.Active;
        }

        if (!canStart || !canStartGame || restartTimer < .45f)
        {
            return;
        }

        levelController.SetLevel(Level.LEVEL1);

        transform.gameObject.SetActive(false);

        GameplayController.LevelIndex = index;

        menu.StartGame(level);
    }
Exemplo n.º 2
0
    public void Init()
    {
        line = GetComponent <LineRenderer>();

        line.enabled = false;

        player = PlayerController.Instance;

        endLinePosition = player.transform.position;

        startLinePosition = player.transform.position;

        hitPoint = player.transform.position;

        line.startWidth = line.endWidth = defaultLineWidth;

        objectSpawner = ObjectSpawner.Instance;

        gameplayController = GameplayController.Instance;

        line.startWidth = line.endWidth = 0;

        locktaskpanel = FindObjectOfType <LockTaskPanel>();


        isInit = true;
    }
Exemplo n.º 3
0
    void Start()
    {
        ObjectSpawner.Instance.Init();

        player = PlayerController.Instance;

        locktaskpanel = FindObjectOfType <LockTaskPanel>();
    }
Exemplo n.º 4
0
    void OnMute(bool b)
    {
        if (GameplayController.LevelIndex == 1)
        {
            LockTaskPanel p = FindObjectOfType <LockTaskPanel>();

            if (p.Active)
            {
                return;
            }
        }

        targetVol = b ? 0f : default_vol;
    }
Exemplo n.º 5
0
    public void SwitchTrack(Level l)
    {
        Track t = Track.NONE;

        float volume = 0;

        if (!playOnAwake)
        {
            return;
        }

        switch (l)
        {
        case Level.LEVEL1:
        {
            t = Track.KILL;

            volume = 1;

            break;
        }

        case Level.LEVEL2:
        {
            t = Track.BELLS;

            LockTaskPanel p = FindObjectOfType <LockTaskPanel>();

            if (p != null)
            {
                volume = !p.Active ? 1f : 0f;
            }
            else
            {
                volume = 1f;
            }
            break;
        }
        }

        volume = Mute ? 0f : volume;

        trackHandler.SwitchTrack(t, source, volume);

        SetCurrentTrack(t);
    }
Exemplo n.º 6
0
    void OnMute(bool b)
    {
        if (GameplayController.LevelIndex == 1)
        {
            LockTaskPanel p = FindObjectOfType <LockTaskPanel>();

            if (p.Active)
            {
                return;
            }
        }


        // source.volume = b ? 0 : 1;

        StopCoroutine("Lerp");
        StartCoroutine("Lerp", b ? 0 : 1);
    }
Exemplo n.º 7
0
    public string CurrentTrack()
    {
        string name = "Kill (Reborn) - Sauniks";

        switch (currentTrack)
        {
        case Track.KILL:
        {
            name = "Kill (Reborn) - Sauniks";
            break;
        }

        case Track.BELLS:
        {
            LockTaskPanel p = FindObjectOfType <LockTaskPanel>();
            name = !p.Active ?  "Carol Of The Bells - Sauniks" : "Locked";
            break;
        }
        }

        return(name);
    }