Skip to content

Instantly share code, notes, and snippets.

View Biodam's full-sized avatar
🕹️
Making games

Fábio Damian Biodam

🕹️
Making games
View GitHub Profile
@Biodam
Biodam / InstallAPK.bat
Last active June 19, 2018 16:23
Adds windows explorer custom context menu item to use adb install directly from a selected .apk file. This two files needs to be at "C:\CustomContextMenu" and adb needs to be in your PATH for them to work right away. Double click in the "add_reg.reg" to add the register info. Then you should be able to see the "adb_install" in the context menu.
adb install %1
pause
@Biodam
Biodam / Unity Merge of scenes and prefabs
Created September 6, 2018 17:28
Unity Merge configuration
Unity Doc
https://docs.unity3d.com/Manual/SmartMerge.html
Tutorial
https://www.youtube.com/watch?v=EQB-N-ClO9g
Steps:
Install meld: http://meldmerge.org/
Config SourceTree
@Biodam
Biodam / NonDrawingGraphic.cs
Created October 8, 2018 20:32
Unity NonDrawingGraphic to detect raycast in UI without extra draw call
using UnityEngine;
using UnityEngine.UI;
/// A concrete subclass of the Unity UI `Graphic` class that just skips drawing.
/// Useful for providing a raycast target without actually drawing anything.
public class NonDrawingGraphic : Graphic
{
public override void SetMaterialDirty() { return; }
public override void SetVerticesDirty() { return; }
@Biodam
Biodam / GameViewUtils.cs
Last active March 22, 2023 12:10
Bulk add game view resolutions and quick select custom resolutions with hotkeys. Download the file and add it to a Editor folder inside of your Assets.
using System;
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEngine;
using UnityEditorInternal;
/// <summary>
/// Class to manipulate the gameview sizes.
/// Based on: https://answers.unity.com/questions/956123/add-and-select-game-view-resolution.html
@Biodam
Biodam / PreBuild.cs
Last active November 20, 2018 20:37
Apply presets to scriptable objects
using UnityEngine;
using System.Collections;
using UnityEditor;
using UnityEditor.Presets;
using System;
[CreateAssetMenu(fileName = "PreBuild", menuName = "Data/CI/PreBuild")]
public class PreBuild : ScriptableObject
{
[Serializable]
This happens because the Facebook login through Facebook app on Android needs the correct hash of your Google Play Signing key.
Follow the steps from "B" on this post: https://forum.unity.com/threads/solved-problem-with-login-facebook-sdk-android.257482/#post-1709450
Copy paste here if the link goes offline:
B) The "Key Hash" generated in the Unity Engine was wrong. So, now I am generating the Key Hash through the steps:
1. Unzip .apk file and extract META-INF\CERT.RSA file
2. In the Prompt, run: keytool -printcert -file CERT.RSA
3. notice SHA1 bytes are printed like 29:37:F1:CB:06…
4. copy SHA1 bytes into HEX to BASE64 converter (http://tomeko.net/online_tools/hex_to_base64.php)
5. see your BASE64 key hash in output field