Skip to content

Instantly share code, notes, and snippets.

View igrir's full-sized avatar
🕌
puasa

Giri Prahasta Putra igrir

🕌
puasa
View GitHub Profile
extends StaticBody2D
class_name JigPiece
@onready var piece_image:Sprite2D = $"piece_image"
@onready var piz_top_in:Texture2D = preload("res://Assets/Masks/piz_top_in.png")
@onready var piz_top_out:Texture2D = preload("res://Assets/Masks/piz_top_out.png")
@onready var piz_top_plain:Texture2D = preload("res://Assets/Masks/piz_top_plain.png")
@onready var piz_right_in:Texture2D = preload("res://Assets/Masks/piz_right_in.png")
extends Node2D
class_name ImageSplicer
@export var sourceImage:AtlasTexture
@onready var piece:JigPiece = get_node("%piece")
@onready var container:Node2D = get_node("container")
var splices = Vector2(9,8)
var pieceUnit:float = 64.0
@igrir
igrir / JigMask.tres
Created May 6, 2023 03:26
Godot jigsaw mask
[gd_resource type="VisualShader" load_steps=49 format=3 uid="uid://c7s3j3j3mbys0"]
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_4iq7d"]
load_path = "res://.godot/imported/p1.png-e3443a103059cf2931cbb830de0aa8c1.s3tc.ctex"
[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_02v3y"]
output_port_for_preview = 0
expanded_output_ports = [0]
source = 5
texture = SubResource("CompressedTexture2D_4iq7d")
@igrir
igrir / CorgiProCamHandler.cs
Last active October 10, 2023 11:14
Camera target assigner from Corgi Engine to ProCamera2D
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using CameraEvents;
using Com.LuisPedroFonseca.ProCamera2D;
using MoreMountains.CorgiEngine;
using MoreMountains.Tools;
using UnityEngine;
require "Assemblr"
chairSize = {}
chairSize.x = 2
chairSize.y = 2
metadata = {}
chairs = {}
gameWidth = 5
gameHeight = 7
@igrir
igrir / ObjectsEnDisabler.cs
Created June 17, 2020 03:01
Disable object with <INACTIVE> string in its name
using System;
using System.Collections;
using UnityEditor;
using UnityEngine;
public class ObjectsEnDisabler {
[MenuItem("Window/ObjectEnDisabler #&d")]
private static void ObjectEnDisabler() {
GameObject[] gameObjects = UnityEngine.SceneManagement.SceneManager.GetActiveScene().GetRootGameObjects();
@igrir
igrir / BoxGizmo.cs
Created May 20, 2020 06:13
Si script gerakan relatif kubus
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.UI;
public class BoxGizmo : MonoBehaviour
{
public Vector3 rightPlaneWeight = new Vector3();
public Vector3 upPlaneWeight = new Vector3();
@igrir
igrir / CameraOrbit.cs
Created May 19, 2020 19:03
A simple camera orbit for mouse input.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraOrbit : MonoBehaviour
{
private Vector3 startMMBMousePos;
private Vector3 startMMBTransformPos;
@igrir
igrir / how-to-notarize-unity-for-macos.md
Created April 27, 2020 01:58 — forked from dpid/how-to-notarize-unity-for-macos.md
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)
@igrir
igrir / MaskingShader.shader
Created March 26, 2019 10:34
Simple masking radial shader
Shader "Hidden/NewImageEffectShader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_MaskTex ("Mask", 2D) = "white" {}
_MaskValue ("Mask Value", range(0,1)) = 0.0
}
SubShader
{