Skip to content

Instantly share code, notes, and snippets.

View anzfactory's full-sized avatar
:octocat:
Working from home

anz anzfactory

:octocat:
Working from home
View GitHub Profile
// Copyright (c) 2011 Bob Berkebile (pixelplacment)
// Please direct any bugs/comments/suggestions to http://pixelplacement.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@tsubaki
tsubaki / SortingLayer.cs
Last active May 20, 2016 06:38
SortingLayerを設定する。ShaderにTransparentとかParticle使っている場合はコレで描画順が制御出来る
/// Set Sorting Layer
/// Copyright (c) 2014 Tatsuhiko Yamamura
/// Released under the MIT license
// / http://opensource.org/licenses/mit-license.php
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
#if UNITY_EDITOR
@tsubaki
tsubaki / Main.cs
Last active August 29, 2015 14:12
ピクセルアート的なのをスクリプトベースで
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Linq;
using System;
[RequireComponent(typeof(Canvas), typeof(CanvasScaler), typeof(RectTransform))]
public class Main : MonoBehaviour {
RectTransform[] layers; // 描画優先度のレイヤー
@kankikuchi
kankikuchi / AudioManager.cs
Last active August 6, 2020 14:33
Unity、オーディオ管理を管理するやつ2
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// BGMとSEの管理をするマネージャ。シングルトン。
/// </summary>
public class AudioManager : SingletonMonoBehaviour<AudioManager>
{
//オーディオファイルのパス
@paulduran
paulduran / select2-editor.js
Created November 18, 2014 06:13
Update of select2 editor for handsontable (compatible with 0.11.4). Original source at https://github.com/trebuchetty/Handsontable-select2-editor
/// select2 plugin
(function (Handsontable) {
"use strict";
var Select2Editor = Handsontable.editors.TextEditor.prototype.extend();
Select2Editor.prototype.prepare = function (td, row, col, prop, value, cellProperties) {
Handsontable.editors.TextEditor.prototype.prepare.apply(this, arguments);
@kibotu
kibotu / UnityGetNativeAndroidVersion
Last active September 6, 2023 16:27
Get versionCode and versionName with unity.
//int vesioncode = context().getPackageManager().getPackageInfo(context().getPackageName(), 0).versionCode;
public static int GetVersionCode() {
AndroidJavaClass contextCls = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject context = contextCls.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject packageMngr = context.Call<AndroidJavaObject>("getPackageManager");
string packageName = context.Call<string>("getPackageName");
AndroidJavaObject packageInfo = packageMngr.Call<AndroidJavaObject>("getPackageInfo", packageName, 0);
return packageInfo.Get<int>("versionCode");
}
@chuganzy
chuganzy / gist:6cd5b915b759e60de389
Last active January 17, 2019 19:47
モーダルで開いたUIViewControllerを一気に閉じる http://blog.ganzy.jp/objective-c/133
/* とにかくモーダルを全部閉じる */
// どこからでもOK
[[UIApplication sharedApplication].keyWindow.rootViewController dismissViewControllerAnimated:YES completion:nil];
// もしくはこちら
[[UIApplication sharedApplication].delegate.window.rootViewController dismissViewControllerAnimated:YES completion:nil];
/* ある階層までのモーダルを閉じる */
@tsubaki
tsubaki / DontDestroyParent.cs
Last active August 29, 2015 14:01
次のシーンまで破棄されないオブジェクトを登録する
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace UnityEngineExtra
{
public class DontDestroyParent : MonoBehaviour
{
#region UNITY_EVENT
@alex-zige
alex-zige / gist:8177726
Created December 30, 2013 04:16
custom background image for IOS UIRefreshControl
-(void)preparePulltoRefresh{
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
refreshControl.tintColor = [UIColor whiteColor];
[refreshControl addTarget:self action:@selector(reloadMeetings) forControlEvents:UIControlEventValueChanged];
//creating view for extending background color
CGRect frame = self.tableView.bounds;
frame.origin.y = -frame.size.height;
UIView *refreshBackgroundView = [[UIView alloc]initWithFrame:frame];
refreshBackgroundView.backgroundColor = UIColorFromRGB(0xXXXXXX);
{
"status": "success",
"search_nag": {},
"code": 0,
"bookmark": "b28xMDB8MDQ0NWZiOTBjNzNiODlkOTQ1ZTk3ZjY0ZTBhYjU0YjM0ZDYyNDg3NjU3ZWQ3OGJmZjI4ZTliZGRmODBlMzJlNQ==",
"debug_data": {
"query_data": {}
},
"message": "ok",
"data": [