public void AddNewSpeciesToDeck(AnimalDef currentAnimal) { // evolve from current animal AnimalDef ad = currentAnimal.Evolved(); //m_animalDeck.Insert(0,ad); m_animalQueue[QUEUE_LENGTH - 1] = ad; }
IEnumerator SetCompleteSequenceMatchingSet() { const float MOVE_TOGETHER_TIME = 0.5f; const float SCALE_UP_TIME = 0.2f; const float SCALE_FACTOR = 2.5f; const float WOBBLE_TIME = 0.2f; const float WOBBLE_COUNT = 2; const float WOBBLE_FACTOR = 0.15f; const float MOVE_TO_QUEUE_TIME = 0.2f; ScaleAll(0.1f, MOVE_TOGETHER_TIME, true); MoveTogether(MOVE_TOGETHER_TIME, false); yield return(new WaitForSeconds(MOVE_TOGETHER_TIME - 0.1f)); AnimalDef evolvedAnimal = m_lastPiecePlaced.Evolved(); GameObject evolvedAnimalSprite = ShowEvolvedAnimal(evolvedAnimal); Scaler scaler = evolvedAnimalSprite.GetComponent <Scaler>(); scaler.ScaleBy(new Vector3(SCALE_FACTOR, SCALE_FACTOR, 0f), SCALE_UP_TIME); for (int i = 0; i < WOBBLE_COUNT; i++) { yield return(new WaitForSeconds(WOBBLE_TIME)); scaler.ScaleBy(new Vector3(-WOBBLE_FACTOR, -WOBBLE_FACTOR, 0f), WOBBLE_TIME); yield return(new WaitForSeconds(WOBBLE_TIME)); scaler.ScaleBy(new Vector3(WOBBLE_FACTOR, WOBBLE_FACTOR, 0f), WOBBLE_TIME); } yield return(new WaitForSeconds(1.0f)); Mover mov = evolvedAnimalSprite.GetComponent <Mover>(); mov.MoveTo(GameController.Instance.m_animalQueueLocations[2].position, MOVE_TO_QUEUE_TIME); scaler.ScaleTo(new Vector3(1f, 1f), MOVE_TO_QUEUE_TIME); yield return(new WaitForSeconds(0.5f)); Destroy(evolvedAnimalSprite); ClearSet(); }