This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
public class HexGridLayout : LayoutGroup { | |
const float SQUARE_ROOT_OF_3 = 1.73205f; | |
public enum Axis { Horizontal = 0, Vertical = 1 } | |
public enum Constraint { Flexible = 0, FixedColumnCount = 1, FixedRowCount = 2 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You should change the center of this gameObject's mesh from default value (0,0,0). | |
// Because this script put its point to the contact point with the ground. | |
// And "use gravity" must be FALSE. | |
// Call HitTestWithRoad() from Update() | |
public var distance:float = 2.0; | |
public var smoothRatio:float = 0.2; | |
function HitTestWithRoad() { |