private void Start() { slowKeeper = GetComponent <SlowKeeper>(); if (slowKeeper == null) { slowKeeper = gameObject.AddComponent <SlowKeeper>(); } }
void Start() { owner = transform; oc = GetComponent <CircleCollider2D>(); slow = GetComponent <SlowKeeper>(); creator = FindObjectOfType <Creator>(); GameObject timerHolder = new GameObject("TimerHolder"); timerHolder.transform.parent = this.transform; timer = timerHolder.AddComponent <Timer>(); timer.StartTimer(0); }
void Awake() { this.rb = GetComponent <Rigidbody2D>(); this.gun = GetComponent <GunInterface>(); this.player = FindObjectOfType <PlayerMover>().gameObject; health = new Health(maxHealth, this); this.slowKeeper = FindObjectOfType <SlowKeeper>(); if (slowKeeper == null) { slowKeeper = gameObject.AddComponent <SlowKeeper>(); } spriteRenderer = GetComponent <SpriteRenderer>(); damageColorVector = VectorColor.ColorToVector(damageColor); colorVector = VectorColor.ColorToVector(spriteRenderer.color); lastHit = Mathf.NegativeInfinity; DoOnAwake(); }