public void Attack(bool isEnemy) { if (CanAttack) { shootCooldown = shootingRate; soloPlayer shotType = GetComponent <soloPlayer>(); if (shotType.timer >= shotType.startTime) { var shotTransform = Instantiate(shotPrefab2) as Transform; AttackType(shotTransform); Shot shot = shotTransform.gameObject.GetComponent <Shot>(); if (shot != null) { shot.isEnemyShot = isEnemy; } } else { var shotTransform1 = Instantiate(shotPrefab) as Transform; AttackType(shotTransform1); Shot shot = shotTransform1.gameObject.GetComponent <Shot>(); if (shot != null) { shot.isEnemyShot = isEnemy; } } } }
void Start() { Physics2D.IgnoreLayerCollision(8, 9); player = GameObject.FindGameObjectWithTag("player").GetComponent <soloPlayer>(); switch (perso) { case "Boss": break; default: health += PersistantManagerScript.Instance.HeroModif[0]; break; } maxhealth = health; }