예제 #1
0
        /// <summary>
        /// Resets the color of the tiles in a given position within the selected layers to White.
        /// The TintBrushSmooth overrides this to set the color of the Grid position to White.
        /// </summary>
        /// <param name="grid">Grid used for layout.</param>
        /// <param name="brushTarget">Target of the erase operation. By default the currently selected GameObject.</param>
        /// <param name="position">The coordinates of the cell to erase data from.</param>
        public override void Erase(GridLayout grid, GameObject brushTarget, Vector3Int position)
        {
            TintTextureGenerator generator = GetGenerator(grid);

            if (generator != null)
            {
                generator.SetColor(grid as Grid, position, Color.white);
            }
        }
예제 #2
0
        /// <summary>
        /// Tints tiles into a given position within the selected layers.
        /// The TintBrushSmooth overrides this to set the color of the Grid position to tint it.
        /// </summary>
        /// <param name="grid">Grid used for layout.</param>
        /// <param name="brushTarget">Target of the paint operation. By default the currently selected GameObject.</param>
        /// <param name="position">The coordinates of the cell to paint data to.</param>
        public override void Paint(GridLayout grid, GameObject brushTarget, Vector3Int position)
        {
            TintTextureGenerator generator = GetGenerator(grid);

            if (generator != null)
            {
                var oldColor   = generator.GetColor(grid as Grid, position);
                var blendColor = oldColor * (1 - m_Blend) + m_Color * m_Blend;
                generator.SetColor(grid as Grid, position, blendColor);
            }
        }
예제 #3
0
		public override void Erase(GridLayout grid, GameObject brushTarget, Vector3Int position)
		{
			// Do not allow editing palettes
			if (brushTarget.layer == 31)
				return;

			TintTextureGenerator generator = GetGenerator(grid);
			if (generator != null)
			{
				generator.SetColor(grid as Grid, position, Color.white);
			}
		}
예제 #4
0
        public override void Paint(GridLayout grid, UnityEngine.GameObject brushTarget, Vector3Int position)
        {
            // Do not allow editing palettes
            if (brushTarget.layer == 31)
            {
                return;
            }

            TintTextureGenerator generator = GetGenerator(grid);

            if (generator != null)
            {
                generator.SetColor(grid as Grid, position, m_Color);
            }
        }
예제 #5
0
        /// <summary>
        /// Tints tiles into a given position within the selected layers.
        /// The TintBrushSmooth overrides this to set the color of the Grid position to tint it.
        /// </summary>
        /// <param name="gridLayout">Grid used for layout.</param>
        /// <param name="brushTarget">Target of the paint operation. By default the currently selected GameObject.</param>
        /// <param name="position">The coordinates of the cell to paint data to.</param>
        public override void Paint(GridLayout grid, GameObject brushTarget, Vector3Int position)
        {
            // Do not allow editing palettes
            if (brushTarget.layer == 31)
            {
                return;
            }

            TintTextureGenerator generator = GetGenerator(grid);

            if (generator != null)
            {
                var oldColor   = generator.GetColor(grid as Grid, position);
                var blendColor = oldColor * (1 - m_Blend) + m_Color * m_Blend;
                generator.SetColor(grid as Grid, position, blendColor);
            }
        }