void HealthCreate() { int possibility = Random.Range(0, 100); if (possibility <= 10 && sharkCreate.getSelectHealth() * 0.75f >= sharkSwim.getHealth()) { Instantiate(health, new Vector3(RandomPositionXGenarator(), 0.3f, advantageHealthPositionZ), Quaternion.identity); } }
void HealthColliderControl(Collider collider) { if (collider.transform.gameObject.name.Contains(sea.health.gameObject.name)) { Instantiate(healthParticle, collider.transform.position, Quaternion.identity); if (health + 25 > sharkCreate.getSelectHealth()) { health = sharkCreate.getSelectHealth(); } if (health + 25 <= sharkCreate.getSelectHealth()) { health += 25; } if (collider.transform.childCount > 0) { Destroy(collider.transform.GetChild(0).gameObject); } } }
void Start() { IronSourceScript_.Instante.LoadInterstitial();//BU kod reklamı yükler bekletir audioSrcShark = GetComponent <AudioSource>(); anim = GetComponent <Animation>(); sharkCreate = FindObjectOfType <SharkCreate>(); menuControl = FindObjectOfType <MenuControl>(); health = sharkCreate.getSelectHealth(); speed = sharkCreate.getSelectSpeed(); mana = 0; PrefsReset(); speedModifier = 0.01f; // 0.005f degeri ideal deger seaPositionZ = 5f; powerTime = 0; barrelTime = 0; fishCounter = 0; barrelPower = false; powerUp = false; StartedSea(); RespawnParticle(); }