Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Mar 07, 2020 at 08:23 PM by tormentoarmagedoom for the following reason:

Too subjective and argumentative

avatar image
0
Question by arashsh · Mar 07, 2020 at 07:57 PM · timespawningpoolingincreasedecrease

How Increase And Decrease And Reset Spawn Rate Over

Hi How I Can Increase And Decrease Spawn Rate Every Time I Want? My Code Work Just For Increase Not Decrease Or Reset!

public float nextDrop = 0f; public float dropInterval = 2f; public float changeInterval = 5f; float delay = 3f; int minX = -6; int maxX = 6; int direction; int indexx; public Vector3 spawnvalue; public Transform fireworkY; public GameObject explosion; public GameObject speedparticla; public GameObject yourloseTable; public GameObject TestEffect; public GameObject[] targets; public Canvas touch; bool gameOver = false; public static bool SpawnGo; public Text theyarecoming; public Text theyarecoming2; public Text ScoreText; public ScoreManager thescore; public AudioClip deathsound; public AudioClip EndGame; public AudioClip FireWorks;

 void Start()
 {
     

     ScoreText.enabled = true;
     SpawnGo = true;
     WaterMove.OceanMove = true;
     yourloseTable.SetActive(false);
     touch.gameObject.SetActive(true);
     nextDrop = Time.time + delay;
     Pool.index = 0;
     Invoke ("Coin", (Random.Range(10f, 50f)));
 }
 
 void Update()

{ if(PlayerSelectionGame.index == 0) indexx = 0;

     if(PlayerSelectionGame.index == 1)
     indexx = 1;

     if(PlayerSelectionGame.index == 2)
     indexx = 2;

 if(SpawnGo)
 {

     if(Time.time >= nextDrop)
     {
           Spawn();

           nextDrop += dropInterval;
           if(Time.timeSinceLevelLoad >= changeInterval) 
          {
            if(dropInterval > 0.3f)
            {
              dropInterval *= 0.92f;
            }
          
          }
           if(Time.timeSinceLevelLoad >= 50f)
          {
            if(dropInterval < 0.3f)
            {
              dropInterval = 2f; 
            }
          }
           if(Time.timeSinceLevelLoad >= 60f)
          {
            if(dropInterval > 0.3f)
            {
              dropInterval *= 0.92f;
            }
           
          }
           if(Time.timeSinceLevelLoad >= 100f) 
          {
            Pool.index = 1;
            ShowTextAnimation();
            Debug.Log("startwave");
          }
           if(Time.timeSinceLevelLoad >= 120)
          {
            Pool.index = 2;
            Debug.Log("stoptwave");
          }
           if(Time.timeSinceLevelLoad >= 160)
          {
            ShowTextAnimation2();
          }
     }
 }

}

 void Spawn()
 {
     GameObject spawn = Pool.Instance.GetPool();
     spawn.transform.position = new Vector3 (Random.Range (minX, maxX), spawnvalue.y, targets[indexx].transform.position.z + 50 );
     spawn.SetActive(true);
 }
Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tormentoarmagedoom · Mar 07, 2020 at 08:23 PM 0
Share

What are the guidelines for writing good questions?

We want Unity Answers to become a comprehensive database of questions and answers related to Unity. When you ask your questions, it can be helpful to keep a few things in $$anonymous$$d:

Don't write things that will be irrelevant in a few days. Writing that "This is urgent!" will probably not get you faster answers, but it may make people frown at your question.

Some reasons for getting a post rejected:

There exists duplicate questions with answers if you were to do a search, either on Answers or on the Forum or on Unity's tutorials

Your question isn't specific enough: asking for a script, asking multiple questions in one post or asking a question that could be either subjective or require extensive discussion

avatar image arashsh tormentoarmagedoom · Mar 07, 2020 at 09:14 PM 0
Share

this was bad question?! intresting

avatar image tormentoarmagedoom arashsh · Mar 07, 2020 at 10:31 PM 0
Share

Remake it,

First, posting all the code in correct format

Second, explain, dont only write a sentence and wait to someone to do the work for you

Third, post only relevant code.

Show more comments

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

126 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Increase/Decrease Over Time, Not Frames 1 Answer

How increase and decrease and reset spawn rate over time? 1 Answer

Increase time for rigidbody game objects? 1 Answer

Mathf.lerp to increase intensity and range of pointlight 1 Answer

Decrease and Increase source 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges