Exemple #1
0
    void Awake()
    {
        //DontDestroyOnLoad(this);

        GameObject[] objectivesArray = GameObject.FindGameObjectsWithTag("Objective");
        for (int i = 0; i < objectivesArray.Length; i++)
        {
            objectives.Add(objectivesArray[i]);
        }
        _objectives    = objectives;
        itemsRemaining = (objectives.Count - 1);

        if (gameStateManager == null)
        {
            gameStateManager = GameObject.Find("Game State Manager");
        }
        if (levelData == null)
        {
            levelData = GameObject.Find("Level Data");
        }
        timer = levelData.GetComponent <LevelData>().levelTime;
        timeBar.SetMaxTime(timer);
        GameObject.Find("TotalItem").GetComponent <TextMeshProUGUI>().text = "\n" + "Remaining Items: " + itemsRemaining;
        currentScene = SceneManager.GetActiveScene().buildIndex; //Grabs current scene's index
    }
Exemple #2
0
 private void Start()
 {
     currSize = vcam.m_Lens.OrthographicSize;
     maxSize  = currSize;
     currTime = maxTime;
     timeBar.SetMaxTime(maxTime);
     // colorGrading = postProcessProfile.GetSetting<ColorGrading>();
 }
Exemple #3
0
    // 타임 바 기본 설정
    private void BaseTimeBarScript()
    {
        // 타임바 패널을 생성합니다.
        timeBar.CreateTimeBarPanel();

        // 타임바 시간을 조절합니다.
        timeBar.SetNowTime(0);
        timeBar.SetMaxTime(findObject.GetObjectState().InteractiveTime);

        // 타임바 카운트를 시작합니다.
        timeBar.SetisCount(true);
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("Enemy") || collision.CompareTag("Tube"))
        {
            TakeDamage(1);
            invencible = false;
            animator.SetFloat("Powerup", -1.0f);
        }
        if (collision.CompareTag("Powerup"))
        {
            Destroy(collision.gameObject);
            animator.SetFloat("Powerup", 1.0f);
            invencible = true;
            gm.pontos += 5;
        }
        if (collision.CompareTag("PowerupTiro"))
        {
            Destroy(collision.gameObject);
            maxGun = true;

            currentTime = maxTimer;
            timeBar.SetMaxTime(maxTimer);

            timeBar.gameObject.SetActive(true);
            gm.pontos += 5;
        }
        if (collision.CompareTag("Poop"))
        {
            Destroy(collision.gameObject);
            TakeDamage(1);
            if (!invencible)
            {
                gm.pontos -= 100;
            }
        }
    }
Exemple #5
0
 // Start is called before the first frame update
 void Start()
 {
     currentTime = maxTime;
     timeBar.SetMaxTime(maxTime);
 }
Exemple #6
0
 void Start()
 {
     _canTakeDamage = true;
     _healthTimer   = maxTime;
     _timeBar.SetMaxTime(maxTime);
 }
Exemple #7
0
 void Start()
 {
     timeBar.SetMaxTime(1);
 }