Beispiel #1
0
    private void Start()
    {
        transform.DisabledRagDoll();



        healthBar.OnDamaged = () =>
        {
            Debug.Log("Canım azaldı");
            healthımage.fillAmount = healthBar.HealthAmount;
        };
        healthBar.OnDead = () =>
        {
            Debug.Log("Öldü");
            EnemyController.instance.Happy();
            AudioWorker.PlayAudio("dead");

            anim.enabled = false;
            transform.EnabledRagDoll();
            DeathCam.instance.StartFollowing(transform);
            StartCoroutine(GameManager.instance.CreateCharackter());
            GameManager.instance.SetEnemyScore();



            transform.AllRagdollForce(Vector3.up * 1000 + (Vector3.right * new float[] { -1, 1 }[Random.Range(0, 1)]) * 500);
            agent.enabled = false;
        };
        currentball = GameManager.instance.CreateBomb(bombpoint);
    }
    private IEnumerator WaitingBomb()
    {
        yield return(new WaitForSeconds(expbombdelay));

        expbomb.ShowParticle(new Vector3(transform.position.x, transform.position.y + 1f, transform.position.z));
        AudioWorker.PlayAudio(ExpAudio);
        Camera.main.DOShakePosition(shakeduration);
        BombAttackDamage();
        Destroy(gameObject);
    }
Beispiel #3
0
    public IEnumerator CreateEnemy()
    {
        int ransdompoint = Random.Range(0, enemyspawnpoints.Count);

        portal.ShowParticle(enemyspawnpoints[ransdompoint].position);
        yield return(new WaitForSeconds(2f));

        GameObject createdenemy = Instantiate(enemyprefab, enemyspawnpoints[ransdompoint].position, Quaternion.identity);

        AudioWorker.PlayAudio("teleport");
        DeathCam.instance.StopFollowing();
    }
Beispiel #4
0
 public void Happy()
 {
     anim.SetTrigger("happy");
     AudioWorker.PlayAudio("happy");
 }