Beispiel #1
0
    // Awake is called before the first frame update
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        levelManager   = GetComponent <LevelManager>();
        levelUIManager = GetComponent <LevelUIManager>();

        DontDestroyOnLoad(gameObject);
    }
Beispiel #2
0
    protected override void Start()
    {
        if (IsLocalChampion())
        {
            AbilityLevelUpUIManager = transform.parent.GetComponentInChildren <AbilityLevelUpUIManager>();
            AbilityTimeBarUIManager = transform.parent.GetComponentInChildren <AbilityTimeBarUIManager>();
            AbilityUIManager        = transform.parent.GetComponentInChildren <AbilityUIManager>();
            BuffUIManager[] buffUIManagers = transform.parent.GetComponentsInChildren <BuffUIManager>();
            BuffUIManager   = buffUIManagers[0];
            DebuffUIManager = buffUIManagers[1];
            BuffManager.SetUIManagers(BuffUIManager, DebuffUIManager);
            HealthBarManager = transform.parent.GetComponentInChildren <HealthBarManager>();
            LevelUIManager   = transform.parent.GetComponentInChildren <LevelUIManager>();
            LevelUIManager.SetPortraitSprite(Resources.Load <Sprite>(championPortraitPath));
            LevelUIManager.SetLevel(LevelManager.Level);
            StatsUIManager = gameObject.AddComponent <StatsUIManager>();
        }

        base.Start();
    }
Beispiel #3
0
    // Update is called once per frame
    void Update()
    {
        if (death == false)
        {
            progress.value  = (int)progressAmount;
            progressAmount += progressPerSec * Time.deltaTime;

            if (progressAmount >= 100)
            {
                LevelUIManager levelUiManager = FindObjectOfType <LevelUIManager>();
                levelUiManager.LevelComplete();
            }
        }

        //Sets Progress to 98
        if (Input.GetKey("p"))
        {
            progressAmount = 98;
        }
        //!
    }
Beispiel #4
0
    public void playerIsDeath()
    {
        if (playerLifes >= 1)
        {
            playerLifes -= 1;
            Debug.Log("Player Death");

            //remove enemies
            EnemyHealth enemy = FindObjectOfType <EnemyHealth>();
            enemy.Disable();

            if (thisScript == null)
            {
                StartCoroutine(respawn());
            }
        }
        else if (playerLifes <= 0)
        {
            progressBar.gameObject.SetActive(false);
            Debug.Log("Game Over");
            LevelUIManager levelManager = FindObjectOfType <LevelUIManager>();
            levelManager.GameOver();
        }
    }
 private void Awake() => instance = this;
Beispiel #6
0
 //Helper functions to call in SetUpScene()
 void InstantiateUI()
 {
     uiMgmt  = Instantiate(uiMgmtPrefab);
     levelUI = uiMgmt.GetComponent <LevelUIManager>();
 }
Beispiel #7
0
 /// <summary>
 /// Awake this instance.
 /// </summary>
 void Awake()
 {
     instance = this;
 }
 public LevelEventArgs(LevelUIManager l)
 {
     leveluimanager = l;
 }
 void Awake()
 {
     if(instance == null)
     {
         instance = this;
     }
     else if(instance != null)
     {
         Destroy(gameObject);
     }
 }