コード例 #1
0
    public void Apply()
    {
        if (UserData.Instance == null)
        {
            return;
        }

        if (UserData.Instance.GetUserData.Cost < cost)
        {
            return;
        }


        cylinder.Reset();
        for (int i = 0; i < width; i++)
        {
            for (int j = 0; j < height; j++)
            {
                if (colors[i, j] == Color.clear)
                {
                    continue;
                }

                Point pos;
                pos.x = i;
                pos.y = j;
                cylinder.Creat_Col(pos, colors[i, j]);
            }
        }

        Init();
    }
コード例 #2
0
 void Diffusion()
 {
     if (Trunk_Count >= 3)            // Trunk가 3이상인가
     {
         if (Try_Diffusion_Count > 0) // 확산을 시도할 수 있는가?
         {
             time += Time.deltaTime;
             if (time >= Diffusion_Time) //확산 가능한 시간인가?
             {
                 for (int i = 0; i < Diffusion_Count; i++)
                 {
                     Rand_Pos();
                     if (!cylinder.Search(Search_pos))
                     {
                         cylinder.Creat_Col(Search_pos);
                         time = 0;
                     }
                 }
             }
         }
     }
 }