예제 #1
0
        /// <summary>
        /// 図解: http://qiita.com/muzudho1/items/7de6e450e1762b993a63
        /// </summary>
        /// <returns></returns>
        public static bool IsStarting_ByWinningStairs(int x, int y, ColorBoxCondition boxSettings, Texture2D texture2D, StringBuilder info_message)
        {
            Color color = texture2D.GetPixel(
                x + boxSettings.GetWinnerStairsDistance()
                , y - boxSettings.GetWinnerStairsDistance()
                );

            if (info_message.Length < 10000)
            {
                info_message.AppendLine("IsStarting_ByWinningStairs: x=[" + (x + boxSettings.GetWinnerStairsDistance()) + "] y=[" + (y - boxSettings.GetWinnerStairsDistance()) + "] color.r,g,b=[" + color.r + "][" + color.g + "][" + color.b + "]");
            }
            return(boxSettings.expectedR == color.r && boxSettings.expectedG == color.g && boxSettings.expectedB == color.b);
        }
예제 #2
0
        /// <summary>
        /// 図解: http://qiita.com/muzudho1/items/7de6e450e1762b993a63
        /// </summary>
        /// <returns></returns>
        public static bool HasColor_Vertical_WinningStairs(int x, int y, ColorBoxCondition boxSettings, Texture2D texture2D)
        {
            // 画像の外か判定
            if (texture2D.width <= x || y < 0)
            {
                return(true);
            }

            // 切断形か判定
            Color color = texture2D.GetPixel(
                x + boxSettings.GetWinnerStairsDistance()
                , y + DELETE_SPACE - boxSettings.GetWinnerStairsDistance() - DataGenerator.GRID_HEIGHT / 2
                );

            return(boxSettings.expectedR == color.r && boxSettings.expectedG == color.g && boxSettings.expectedB == color.b);
        }
예제 #3
0
        /// <summary>
        /// 図解: http://qiita.com/muzudho1/items/7de6e450e1762b993a63
        /// </summary>
        /// <returns></returns>
        public static bool HasColor_Horizontal_ByWinningStairs(int x, int y, ColorBoxCondition boxSettings, Texture2D texture2D)
        {
            // 画像の外か判定
            if (texture2D.width <= x || y < 0)
            {
                return(true);
            }

            // 切断形か判定
            Color color = texture2D.GetPixel(x - DELETE_SPACE + boxSettings.GetWinnerStairsDistance() + DataGenerator.GRID_WIDTH / 2, y - boxSettings.GetWinnerStairsDistance());

            return(boxSettings.expectedR == color.r && boxSettings.expectedG == color.g && boxSettings.expectedB == color.b);
        }