Skip to content

Instantly share code, notes, and snippets.

View Scub3d's full-sized avatar
💭
Feeling Clean

Spenser Solys Scub3d

💭
Feeling Clean
View GitHub Profile
@PopupAsylumUK
PopupAsylumUK / HexGridLayout.cs
Last active May 3, 2024 02:04
A Layout group for arranging children in a hexagon grid, and a Hexagon graphic
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 }
@moyashipan
moyashipan / FollowGround.js
Last active March 15, 2019 20:36
Unity3D: Function to following the ground
// 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() {