public static void AddTowerInvoker(TimerCountdown script) { invokerTower = script; if (listenerTower != null) { invokerTower.AddTowerListener(listenerTower); } }
public static void AddReactorInvoker(TimerCountdown script) { invokerReactor = script; if (listenerReactor != null) { invokerReactor.AddReactorListener(listenerReactor); } }
public static void AddResearchInvoker(TimerCountdown script) { invokerResearch = script; if (listenerResearch != null) { invokerResearch.AddReserachListener(listenerResearch); } }
public static void AddMineInvoker (TimerCountdown script) { invokerMine = script; if (listenerMine != null) { invokerMine.AddMineListener(listenerMine); } }
/// <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(); }
/// <summary> /// Awake for Config some setting before starting anything /// </summary> void Awake() { instance = this; hasMineClickBuildYet = false; hasResearchClickBuildYet = false; hasTowerClickBuildYet = false; hasReactorClickBuildYet = false; MineCountTimer = 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>(); }
/**--------------------------------------------------------------------------------- * */ 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); } }
/// <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; }
private void OnTriggerEnter2D(Collider2D collider) { if (collider.gameObject.layer == LayerMask.NameToLayer("Player")) { TimerCountdown.stopTimer = true; if (AchievementManager.Instance && TimerCountdown.IsLessThan3Minutes()) { AchievementManager.Instance.CollectAchievement("Speedrun"); } } }
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); }
/// <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); }
/// <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); }
/**--------------------------------------------------------------------------------- * 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; }
void Awake() { resetText = tmproDisplay.GetComponent <TextMeshPro>(); gameTimerScript = gameTimer.GetComponentInChildren <TimerCountdown>(); //netsV1Script = GetComponent<NETSv1>(); }
public void Awake() { Instance = this; }
void Awake() { _player = FindObjectOfType <Player>(); _boss = FindObjectOfType <EnemyBoss>(); _timer = FindObjectOfType <TimerCountdown>(); }