Skip to content

Instantly share code, notes, and snippets.

View drew-512's full-sized avatar

Drew O'Meara drew-512

View GitHub Profile
@dpid
dpid / how-to-notarize-unity-for-macos.md
Last active December 6, 2023 20:42
How to notarize a Unity build for MacOs 10.15 Catalina

How to notarize a Unity build for macOs 10.15 Catalina

As of January 2020, all apps running on macOs 10.15 Catalina are required to be notarized. For Unity games distributed outside the Mac App Store, such as with Steam, the notarization process is done post build using a series of Xcode command line tools.

Prerequisites

  • a Mac that is compatible with macOs 10.15 Catalina :
    • MacBook (2015 or newer)
    • MacBook Air (2012 or newer)
  • MacBook Pro (2012 or newer)
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@JohannesMP
JohannesMP / 2DLineRectIntersection.md
Last active April 18, 2024 00:53
[C#, Unity3D] An optimized solver for intersection between a Line Segment and a Rect in 2D space with spacial partitioning.

Overview

For a 2D Unity Project, I needed a really efficient way to get the intersection points between a line segment (as defined by two Vector2) and an axis-aligned Rect in 2D space, where the intersection points are returned as a parametric fraction of the length of the original line segment:

Note how when the line intersects the rect, the green line represents the portion inside the rect, and the parametric representation of the point of intersection along the line is displayed

In my use case the vast majority of lines are either completely inside or completely outside the rect, and so I needed an approach that was very efficient in cases where there is guaranteed no intersection and avoids unecessary raycasts when possible.

@luke161
luke161 / UISafeArea.cs
Last active October 11, 2021 05:41
Unity UI component that modifies a RectTransform so it fits within Screen.SafeArea. Useful for adapting Unity UI for the iPhone X. Works by setting the edge offset of the RectTransform, the RectTransform should be setup to stretch to all corners of it's parent.
/**
* UISafeArea.cs
* Author: Luke Holland (http://lukeholland.me/)
*/
namespace UnityEngine.UI
{
[RequireComponent(typeof(RectTransform))]
public class UISafeArea : MonoBehaviour
@ePirat
ePirat / spec.md
Last active April 22, 2024 06:44
Icecast Protocol specification

Icecast protocol specification

What is the Icecast protocol?

When speaking of the Icecast protocol here, actually it's just the HTTP protocol, and this document will explain further how source clients need to send data to Icecast.

HTTP PUT based protocol

Since Icecast version 2.4.0 there is support for the standard HTTP PUT method. The mountpoint to which to send the data is specified by the URL path.