コード例 #1
0
 public override void ResetEntity()
 {
     base.ResetEntity();
     rocketController.SetActive(true);
     StopCoroutine("Countdown");
     if (gameObject.activeSelf)
     {
         StartCoroutine("Countdown");
     }
 }
コード例 #2
0
 public override void Disable()
 {
     StopCoroutine("FreezeFrame");
     Time.timeScale = 1;
     rocketController.SetActive(false);
     GameController.instance.GameOver();
 }
コード例 #3
0
    public override void Disable()
    {
        AudioSource explosionSound = ObjectPooler.PoolObject("Sounds", "RocketHitSound").GetComponent <AudioSource>();

        explosionSound.transform.position = transform.position;
        explosionSound.Play();
        explosionParticles.Play();
        boxCollider.enabled = false;
        rocketController.SetActive(false);
    }
コード例 #4
0
    public void GameStart()
    {
        RocketController player = ObjectPooler.PoolObject("Player").GetComponent <RocketController>();

        playerController = player.GetComponent <PlayerController>();
        player.gameObject.SetActive(true);
        player.transform.position = spawnpoint;
        player.SetActive(true);
        music.gameObject.SetActive(true);
        music.Play();
        StartSpawnEvent();
        gameStartTime = Time.time;
        CameraFollow.instance.SetTarget(player.transform);
        CameraFollow.instance.SetActive(true);
    }
コード例 #5
0
    private void SpawnObjects()
    {
        if (Random.value > spawnChance)
        {
            return;
        }
        Vector3 randomSpawn = Random.insideUnitCircle.normalized * spawnDistanceFromPlayer;
        int     times       = Random.Range(minSpawn, maxSpawn);

        for (int i = 0; i < times; i++)
        {
            GameObject newObject = ObjectPooler.PoolObject(spawnObject);
            if (newObject == null)
            {
                continue;
            }
            if (minSize != maxSize)
            {
                newObject.transform.localScale = Vector3.one * Random.Range(minSize, maxSize);
            }
            Vector3 privateSpawn = randomSpawn + (Random.insideUnitSphere * spawnRange);
            if (privateSpawn.x > 0)
            {
                privateSpawn.x += 25;
            }
            else
            {
                privateSpawn.x -= 25;
            }
            privateSpawn.z = 0;
            newObject.transform.position = PlayerController.instance.transform.position + privateSpawn;
            RocketController newRocketController = newObject.GetComponent <RocketController>();
            if (newRocketController != null)
            {
                newRocketController.SetActive(true);
            }
            Entity newEntity = newObject.GetComponent <Entity>();
            if (newEntity != null)
            {
                newEntity.ResetEntity();
            }
        }
    }
コード例 #6
0
 public override void Disable()
 {
     StopCoroutine("SlowUpdateRoutine");
     rocketController.DisableEffects();
     rocketController.SetActive(false); //disables collider, so this method can only be called once
 }
コード例 #7
0
 public override void Disable()
 {
     rocketController.DisableEffects();
     rocketController.SetActive(false); //disables collider, so this method can only be called once
 }