Exemplo n.º 1
0
    public static void MakeCloud(RainColor rainColor, float[,] area, int xOffset, int yOffset)
    {
        Cloud cloud = Instantiate(t.cloudPrefab);

        cloud.CloudStartup(rainColor, area, xOffset, yOffset, CloudDuration + Random.Range(0, CloudDurationVariation));
        t.clouds.Add(cloud);
    }
Exemplo n.º 2
0
 public static RainColor MixColors(RainColor a, RainColor b)
 {
     Debug.Log("Mixing : " + a + " & " + b);
     if (a == b)
     {
         return(a);
     }
     return(t.MixedColors[(1 << (int)a) + (1 << (int)b)]);
 }
Exemplo n.º 3
0
    void MakeFruit()
    {
        RainColor color;

        color = rainAmount.Aggregate((biggest, current) => biggest.Value > current.Value ? biggest : current).Key;
        RainColor fruitColor = ColorManager.MixColors(color, colorBase);

        isGrown = true;
        Debug.Log("Fruit color: " + fruitColor);
    }
Exemplo n.º 4
0
 public void CloudStartup(RainColor _rainColor, float[,] _area, int _xOffset, int _yOffset, float duration)
 {
     area      = _area;
     rainColor = _rainColor;
     timeLeft  = duration;
     xOffset   = _xOffset;
     yOffset   = _yOffset;
     plants    = PlantManager.GetPlantsInArea(area, xOffset, yOffset);
     plants.ForEach((plant) => plant.AddRain(rainColor));
 }
Exemplo n.º 5
0
    void PaintCloud(RainColor color)
    {
        Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        float[,] paint = new float[paintSize, paintSize];
        for (int x = 0; x < paintSize; x++)
        {
            for (int y = 0; y < paintSize; y++)
            {
                paint[x, y] = 1;
            }
        }
        if (Physics.Raycast(ray, out hit))
        {
            int[] xy = TerrainManager.HitPointToXY(hit.point);
            CloudManager.MakeCloud(color, paint, xy[0] - paintSize / 2, xy[1] - paintSize / 2);
        }
    }
Exemplo n.º 6
0
 public static ColorTerrainPlant GetValuesForRain(RainColor rain)
 {
     return(t.RainDict.GetValueOrDefault(rain));
 }
Exemplo n.º 7
0
 public void RemoveRain(RainColor rain)
 {
     Debug.Log("Removing rain");
     rains.Remove(rain);
 }
Exemplo n.º 8
0
 public void AddRain(RainColor rain)
 {
     Debug.Log("Getting rained on by: " + rain + " rain");
     rains.Add(rain);
 }
Exemplo n.º 9
0
 public void SetBaseColor(RainColor color)
 {
     colorBase = color;
 }
Exemplo n.º 10
0
 public static void CloudRemoved(float[,] area, int xOffset, int yOffset, RainColor color)
 {
 }
Exemplo n.º 11
0
 public static void RemoveCloud(RainColor rainColor, float[,] area, int xOffset, int yOffset)
 {
 }