Example #1
0
 public static void AddTowerInvoker(TimerCountdown script)
 {
     invokerTower = script;
     if (listenerTower != null)
     {
         invokerTower.AddTowerListener(listenerTower);
     }
 }
Example #2
0
 public static void AddReactorInvoker(TimerCountdown script)
 {
     invokerReactor = script;
     if (listenerReactor != null)
     {
         invokerReactor.AddReactorListener(listenerReactor);
     }
 }
Example #3
0
 public static void AddResearchInvoker(TimerCountdown script)
 {
     invokerResearch = script;
     if (listenerResearch != null)
     {
         invokerResearch.AddReserachListener(listenerResearch);
     }
 }
Example #4
0
 public static void AddMineInvoker (TimerCountdown script)
 {
     invokerMine = script;
     if (listenerMine != null)
     {
         invokerMine.AddMineListener(listenerMine);
     }
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Skill{T}"/> class.
 /// </summary>
 /// <param name="data">The data.</param>
 /// <exception cref="ArgumentNullException">data</exception>
 public Skill(T data)
 {
     this.data       = data ?? throw new ArgumentNullException(nameof(data));
     Level           = STARTING_LEVEL;
     Timer           = new TimerCountdown(this, $"{Name} will be recharged after");
     Timer.OnFinish += OnTimerFinishHandler;
     ResetRecharging();
 }
Example #6
0
 /// <summary>
 /// Awake for Config some setting before starting anything
 /// </summary>
 void Awake()
 {
     instance                 = this;
     hasMineClickBuildYet     = false;
     hasResearchClickBuildYet = false;
     hasTowerClickBuildYet    = false;
     hasReactorClickBuildYet  = false;
     MineCountTimer           = 0;
 }
Example #7
0
 private void Start()
 {
     fan                = GameObject.FindGameObjectWithTag("Fan").GetComponent <Fan>();;
     holster            = GameObject.FindGameObjectWithTag("Holster").GetComponent <Holster>();
     menu               = GameObject.FindGameObjectWithTag("MainMenu");
     gameStartCountdown = GameObject.FindGameObjectWithTag("GameStartCountdown").GetComponent <GameCountdown>();
     timerCountdown     = GameObject.FindGameObjectWithTag("TimerCountdown").GetComponent <TimerCountdown>();
     highScoreUI        = GameObject.FindGameObjectWithTag("HighScoreUI");
     scoreboard         = GameObject.FindGameObjectWithTag("Scoreboard").GetComponent <ScoreCounter>();
 }
Example #8
0
 /**---------------------------------------------------------------------------------
  *
  */
 void Start()
 {
     height = 0.8f;
     heightDamping = 5.0f;
     rotationDamping = 5.0f;
     distanceDamping = 3.0f;
     target = GameObject.Find("Player(Clone)");
     timer = GameObject.Find("ctdTimer");
     timerObj = timer.GetComponent<TimerCountdown>();
     tilt = 0.3f;
 }
    // Use this for initialization

    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }
Example #10
0
        /// <summary>
        /// Setups the specified countdown timer.
        /// </summary>
        /// <param name="timer">The countdown timer.</param>
        /// <exception cref="ArgumentNullException">timer</exception>
        public void Setup(TimerCountdown timer)
        {
            if (timer == null)
            {
                throw new ArgumentNullException(nameof(timer));
            }

            timer.OnTick   += OnTickHandler;
            timer.OnFinish += OnFinishHandler;

            textDescription.text = timer.Description;
        }
Example #11
0
    private void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.gameObject.layer == LayerMask.NameToLayer("Player"))
        {
            TimerCountdown.stopTimer = true;

            if (AchievementManager.Instance && TimerCountdown.IsLessThan3Minutes())
            {
                AchievementManager.Instance.CollectAchievement("Speedrun");
            }
        }
    }
Example #12
0
    void Awake()
    {
        UpdateUITextFromSeconds();

        // TimerCountdown converted to singleton because we need the same instance also in the Level2
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }
        DontDestroyOnLoad(gameObject);
    }
Example #13
0
        /// <summary>
        /// Heroes the died handler. Starts a hero resurrection timer.
        /// </summary>
        /// <param name="diedHero">The died hero.</param>
        /// <exception cref="ArgumentNullException">diedHero</exception>
        private void HeroDiedHandler(IDying diedHero)
        {
            if (diedHero.IsNullOrMissing())
            {
                throw new ArgumentNullException(nameof(diedHero));
            }

            if (!(diedHero is Hero hero))
            {
                return;
            }

            var timer = new TimerCountdown(hero, $"{hero.UnitName} will reborn after", hero.RebornDelay);

            reviveTimers.Add(timer);
            timer.OnFinish += ReviveHero;
            OnHeroReviveTimerStart?.Invoke(timer);
        }
Example #14
0
        /// <summary>
        /// Called when the hero revive timer has started.
        /// </summary>
        /// <param name="timer">The countdown timer.</param>
        /// <exception cref="ArgumentNullException">timer</exception>
        public void OnHeroReviveTimerStartHandler(TimerCountdown timer)
        {
            if (timerBoardPrefab == null)
            {
                return;
            }

            if (timer == null)
            {
                throw new ArgumentNullException(nameof(timer));
            }

            var timerBoard = ObjectsPool.GetOrCreate(timerBoardPrefab);

            timerBoard.transform.SetParent(transform);
            timerBoard.transform.localScale = Vector3.one;
            timerBoard.Setup(timer);
        }
Example #15
0
 /**---------------------------------------------------------------------------------
  * Sets up the countdown timer.
  */
 public void SetupCtdTimer()
 {
     ctdTimerGameObj = GameObject.Find("ctdTimer");
     ctdTimerObj = ctdTimerGameObj.GetComponent<TimerCountdown>();
     ctdTimerObj.f_time = 2;
     ctdTimerObj.i_time = 2;
     ctdTimerObj.TimerFirstRunning = true;
     ctdTimerObj.TimerSecondRunning = true;
     ctdTimerObj.countDownText.enabled = true;
 }
Example #16
0
 void Awake()
 {
     resetText       = tmproDisplay.GetComponent <TextMeshPro>();
     gameTimerScript = gameTimer.GetComponentInChildren <TimerCountdown>();
     //netsV1Script = GetComponent<NETSv1>();
 }
Example #17
0
 public void Awake()
 {
     Instance = this;
 }
 void Awake()
 {
     _player = FindObjectOfType <Player>();
     _boss   = FindObjectOfType <EnemyBoss>();
     _timer  = FindObjectOfType <TimerCountdown>();
 }