예제 #1
0
        void NewQuake()
        {
            lastQuakeTime = Time.time;

            // Random epicenter
            epicenter = Random.onUnitSphere * 0.5f;

            // Focus on epicenter
            hexa.FlyTo(epicenter, 1f);
        }
예제 #2
0
 /// <summary>
 /// Applies a random extrusion to all tiles
 /// </summary>
 void RandomExtrusion()
 {
     hexa.extruded          = true;
     hexa.extrudeMultiplier = 0.05f;
     for (int k = 0; k < hexa.tiles.Length; k++)
     {
         float extrusionAmount = UnityEngine.Random.value;
         if (extrusionAmount > 0.015f)
         {
             hexa.SetTileExtrudeAmount(k, extrusionAmount);
             Color landColor = new Color(0, extrusionAmount, 0);
             hexa.SetTileColor(k, landColor);
         }
         else
         {
             hexa.SetTileExtrudeAmount(k, 0f);
             hexa.SetTileColor(k, new Color(0f, 0.411f, 0.58f));
         }
     }
     animateTileIndex = Random.Range(0, hexa.tiles.Length - 1);
     hexa.FlyTo(animateTileIndex, 2f);
 }