void Start() { player = GameObject.FindGameObjectWithTag("Player"); pbc = player.GetComponentInChildren <PlayerBuffsController>(); stats = player.GetComponent <PlayerStats>(); anim = GetComponent <Animator>(); ps = GetComponentInChildren <ParticleSystem>(); rb = GetComponent <Rigidbody2D>(); for (int i = 0; i < 4; i++) { targets.Add(pbc.transform.GetChild(i).gameObject); } switch (dt) { case DamageType.fire: stats.fireDamage += buffAmount; break; case DamageType.ice: stats.iceDamage += buffAmount; break; case DamageType.lightning: stats.lightningDamage += buffAmount; break; case DamageType.strength: stats.strength += buffAmount; break; } StartCoroutine(Timer()); FindTarget(); }
private void Start() { rb = GetComponent <Rigidbody2D>(); anim = GetComponentInChildren <Animator>(); orbtransform = GetComponent <Transform>(); player = GameObject.FindGameObjectWithTag("Player"); pbc = player.GetComponentInChildren <PlayerBuffsController>(); calculatedSpeed = speed * 100f; cc = GetComponentInChildren <CircleCollider2D>(); StartCoroutine("SpawnDelay"); //rb.velocity = transform.up * speed; var buffs = GameObject.FindGameObjectWithTag("Load").GetComponent <LoadedPrefabs>().orbiterBuffs; switch (dt) { case DamageType.fire: buffPrefab = buffs[0]; break; case DamageType.ice: buffPrefab = buffs[1]; break; case DamageType.lightning: buffPrefab = buffs[2]; break; case DamageType.strength: buffPrefab = buffs[3]; break; } }