Skip to content

Instantly share code, notes, and snippets.

View Goropocha's full-sized avatar
🤓

Goropocha Goropocha

🤓
View GitHub Profile
@Goropocha
Goropocha / SaltedInt.cs
Created September 19, 2023 03:17
Salt付きint
using UnityEngine;
/// <summary>
/// Salt付きint
/// </summary>
public class SaltedInt
{
/// <summary>現在のSalt</summary>
public static int Salt { get; private set; }
@Goropocha
Goropocha / UniTaskExtensions.cs
Created February 2, 2023 02:06
UniTask関連拡張クラス
/// <summary>
/// UniTask関連拡張
/// </summary>
public static class UniTaskExtensions
{
/// <summary>
/// すべてのタスクが完了したときに完了するタスクを作成する
/// </summary>
public static UniTask WhenAll(this IEnumerable<UniTask> tasks) => UniTask.WhenAll(tasks);
using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
// Bookデータの等値比較判定用クラス
private class BookComparer : IEqualityComparer<(int[] ReferenceIds, int CityId)>
{
public bool Equals((int[] ReferenceIds, int CityId) x, (int[] ReferenceIds, int CityId) y)
@Goropocha
Goropocha / SignInWithApplePostprocessor.cs
Created March 27, 2021 08:13
Sign in with Apple Unity Plugin の Xcode 設定自動化
#if UNITY_IOS
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor.iOS.Xcode;
using AppleAuth.Editor;
/// <summary>
/// Xcode 設定自動化
/// </summary>
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// Eメールのローカル部を隠す
/// </summary>
/// <param name="email">Eメール</param>
/// <param name="maxShowFrontNum">表示できる先頭最大文字数</param>
/// <param name="maxShowBackNum">表示できる末端最大文字数</param>
@Goropocha
Goropocha / EnumIndexAttribute.cs
Last active November 1, 2022 20:15
Showing an array with Enum as keys in the property inspector. (Supported children)
using System;
using System.Linq;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
/// <summary>
/// Showing an array with Enum as keys in the property inspector. (Supported children)
/// </summary>
@Goropocha
Goropocha / ADMExampleAndroidManifest.xml
Created August 5, 2020 05:51
AndroidManifest Example For ADM
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:amazon="http://schemas.amazon.com/apk/res/android"
package="com.your.packagename"
android:versionCode="1" android:versionName="1.0.0" >
<!-- このパーミッションにより、ADMメッセージがほかのアプリにインターセプトされることがなくなります。 -->
<permission
android:name="com.your.packagename.permission.RECEIVE_ADM_MESSAGE"
package com.your.packagename;
import com.amazon.device.messaging.ADMMessageReceiver;
/**
* ADM レシーバー
*/
public class MyADMReceiver extends ADMMessageReceiver {
private static Boolean ADMLatestAvailable;
@Goropocha
Goropocha / MyADMMessageHandler.java
Created August 5, 2020 03:48
ADM MessageHandler
package com.your.packagename;
import android.content.Context;
import android.content.Intent;
import com.amazon.device.messaging.ADMMessageHandlerJobBase;
/**
* ADMメッセージハンドラ
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnumDictTest : MonoBehaviour {
private const int RepeatNum = 10000000;
private enum TestEnum {
ID1,
ID2,
ID3,