Skip to content

Instantly share code, notes, and snippets.

View ardazeytin's full-sized avatar

Arda Zeytin ardazeytin

View GitHub Profile
@marcospgp
marcospgp / SafeTask.cs
Last active January 13, 2024 22:58
Cancel async tasks in Unity upon exiting play mode
using System;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
namespace UnityUtilities
{
/// <summary>
/// A replacement for `Task.Run()` that cancels tasks when entering or
/// exiting play mode in the Unity editor (which doesn't happen by default).
using UnityEngine;
public class MeshBlit : MonoBehaviour
{
public RenderTexture rt;
public Mesh mesh;
public Material material;
public Vector3 meshPosition = new Vector3(0.5f, 0.5f, -1);
@extrawurst
extrawurst / RunTestsBeforeBuild.cs
Created October 30, 2019 09:43
Unity TestRunnerApi to run UnitTests before each build
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
using UnityEditor.TestTools.TestRunner.Api;
public class ResultCollector : ICallbacks
{
public ITestResultAdaptor Result { get; private set; }
public void RunFinished(ITestResultAdaptor result)
@unitycoder
unitycoder / AndroidManifest.xml
Last active March 30, 2024 19:39
Oculus Quest Android Manifest (with READ_EXTERNAL_STORAGE, LAUNCHER and SkipPermissionsDialog)
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto">
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" /><!-- Request the headset DoF mode -->
<application
android:label="@string/app_name"
android:icon="@mipmap/app_icon">
<activity
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
@lopspower
lopspower / README.md
Last active April 27, 2024 14:22
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@pazdera
pazdera / adapter.cpp
Created August 15, 2011 07:37
Example of `adapter' design pattern in C++
/*
* Example of `adapter' design pattern
* Copyright (C) 2011 Radek Pazdera
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,