Пример #1
0
 void OnTriggerEnter(Collider col)
 {
     if (col.tag == "Player")
     {
         Game_Manager.Instance().getPlayer().GetComponent <Character_Ctrl>().RemoveHealth(100);
     }
 }
Пример #2
0
 void OnTriggerEnter(Collider col)
 {
     if (Game_Manager.Instance().getGreenActive() == true)
     {
         Game_Manager.Instance().getPlayer().GetComponent <Character_Ctrl>().RemoveHealth(damage);
     }
 }
Пример #3
0
    // Update is called once per frame
    void Update()
    {
        currentscore      = Game_Manager.Instance().getPlayer().GetComponent <Character_Ctrl>().GetDiceAmount();
        _currentText.text = "X" + currentscore;
        _HealthBar.value  = Game_Manager.Instance().getPlayer().GetComponent <Character_Ctrl>().GetHealth();
        if (Input.GetKeyDown(KeyCode.P) || Input.GetKeyDown("joystick button 7"))
        {
            _Paused = !_Paused;
        }
        if (_Paused)
        {
            Time.timeScale = 0;
            _PauseMenu.SetActive(true);
        }
        else
        {
            _PauseMenu.SetActive(false);
            Time.timeScale = 1;
        }


        _NoRedGem.SetActive(Game_Manager.Instance().getRedActive());
        _NoBlueGem.SetActive(Game_Manager.Instance().getBlueActive());
        _NoGreenGem.SetActive(Game_Manager.Instance().getGreenActive());
        _NoPurpleGem.SetActive(Game_Manager.Instance().getPurpleActive());
    }
Пример #4
0
    // Update is called once per frame
    void Update()
    {
        if (Game_Manager.Instance().GetTreasurebool() == true)
        {
            _gateUp = true;
        }
        if (_gateUp == false)
        {
            Timer = 0;
            if (_Gate.transform.localPosition.z > startPos.z)
            {
                _Gate.transform.Translate(new Vector3(0, 0, -Time.deltaTime * MovSpeed));
            }
        }
        else
        {
            if (Game_Manager.Instance().GetTreasurebool() == false)
            {
                Timer += Time.deltaTime;
            }



            if (_Gate.transform.localPosition.z <= EndPos.localPosition.z)
            {
                _Gate.transform.Translate(new Vector3(0, 0, Time.deltaTime * MovSpeed));
            }
            if (Timer >= 10)
            {
                _gateUp = false;
            }
        }
    }
 void OnTriggerEnter(Collider col)
 {
     if (Game_Manager.Instance().getBlueActive() == true)
     {
         Instantiate(_projectile, _SpawnPos.position, _SpawnPos.rotation);
     }
 }
Пример #6
0
 void OnTriggerEnter(Collider col)
 {
     if (col.tag == "Player" && Game_Manager.Instance().getPlayer().GetComponent <Character_Ctrl>().GetPowerGemTotal() >= 4)
     {
         _gateUp = true;
         Game_Manager.Instance().getPlayer().GetComponent <Character_Ctrl>().RemovePowerGem(4);
     }
 }
Пример #7
0
    void Start()
    {
        _player       = Game_Manager.Instance().getPlayer().transform;
        camoffset     = _rotationCenter.position - transform.position;
        initcamoffset = camoffset;
        lerpVector    = camoffset;

        _rotationCenter.Rotate(0, _startAngle, 0);
        float      desiredYAngle = _rotationCenter.eulerAngles.y;
        Quaternion rotation      = Quaternion.Euler(0, desiredYAngle, 0);

        transform.position = _rotationCenter.position - (rotation * camoffset);
        transform.LookAt(_rotationCenter);
    }
Пример #8
0
    // Update is called once per frame
    void Update()
    {
        _IsTreasureTaken = Game_Manager.Instance().GetTreasurebool();

        if (_IsTreasureTaken == true && _CurrentWayP < arrWayPoints.Length - 1)
        {
            _Stone.transform.Rotate(new Vector3(Time.deltaTime * _speed * 80, 0, 0));
            if (transSelf.position == arrWayPoints[_CurrentWayP].position)
            {
                NextWayPoint();
            }
            transSelf.position = Vector3.MoveTowards(transSelf.position, arrWayPoints[_CurrentWayP].position, _speed * Time.deltaTime);
            Vector3 lookat = Vector3.Lerp(transSelf.position + transSelf.forward, arrWayPoints[_CurrentWayP].position, Time.deltaTime * 2.0f);
            transSelf.LookAt(lookat);
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (once == true)
        {
            _timer += Time.deltaTime;
            if (_timer >= 3)
            {
                once = false;
            }
        }

        RedActive    = Game_Manager.Instance().getRedActive();
        BlueActive   = Game_Manager.Instance().getBlueActive();
        GreenActive  = Game_Manager.Instance().getGreenActive();
        PurpleActive = Game_Manager.Instance().getPurpleActive();
    }
Пример #10
0
    // Update is called once per frame
    void Update()
    {
        if (Game_Manager.Instance().getRedActive() == true)
        {
            _Timer += Time.deltaTime;

            if (_Timer > 0)
            {
                if (_spikesUp == true)
                {
                    if (transSpikes.localPosition.y <= destination.localPosition.y)
                    {
                        transSpikes.Translate(0, 0, Time.deltaTime * _Speed);
                    }
                    else
                    {
                        _stopTimer += Time.deltaTime;
                    }
                }
                else
                {
                    if (transSpikes.localPosition.y >= startPos.y)
                    {
                        transSpikes.Translate(0, 0, -(Time.deltaTime * _Speed));
                    }
                    else
                    {
                        _stopTimer += Time.deltaTime;
                    }
                }
            }
        }
        else
        {
            if (transSpikes.localPosition.y <= startPos.y)
            {
                transSpikes.Translate(0, 0, 0);
            }
            _Timer = 0;
        }

        if (_stopTimer > _StopTime)
        {
            _spikesUp  = !_spikesUp;
            _stopTimer = 0;
        }
    }
Пример #11
0
    // Update is called once per frame
    void Update()
    {
        if (Game_Manager.Instance().getPurpleActive() == true)
        {
            Slowspell.SetActive(true);
            Magic_Ring.SetActive(true);

            Real_Floor.SetActive(true);
            Fake_Floor.SetActive(true);
            Final_Floor.SetActive(false);
        }
        else
        {
            Slowspell.SetActive(false);
            Magic_Ring.SetActive(false);

            Real_Floor.SetActive(false);
            Fake_Floor.SetActive(false);
            Final_Floor.SetActive(true);
        }
    }
Пример #12
0
    // Update is called once per frame
    void Update()
    {
        if (Game_Manager.Instance().getGreenActive() == true)
        {
            _rot = _axeBlade.rotation.z * Mathf.Rad2Deg * Mathf.PI;

            if (_switch == true)
            {
                _axeBlade.Rotate(0, 0, _speed * Time.deltaTime);
            }
            else
            {
                _axeBlade.Rotate(0, 0, -_speed * Time.deltaTime);
            }
            if (_rot >= _max_rot)
            {
                _switch = false;
            }
            else if (_rot <= -_max_rot)
            {
                _switch = true;
            }
        }
    }
Пример #13
0
 void Start()
 {
     player = Game_Manager.Instance().getPlayer().GetComponent <Character_Ctrl>();
 }
Пример #14
0
 void Start()
 {
     _player   = Game_Manager.Instance().getPlayer();
     _newSpeed = _player.GetComponent <Character_Ctrl>().GetSpeed();
 }
Пример #15
0
 public void OnClickUse()
 {
     Game_Manager.Instance().OnClickRune(gameObject);
 }