This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
namespace UnityEngineExtra | |
{ | |
public class DontDestroyParent : MonoBehaviour | |
{ | |
#region UNITY_EVENT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; // 描画優先度のレイヤー |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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: | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using UnityEditor; | |
using UnityEngine; | |
public static class ExampleClass | |
{ | |
private static readonly Color mDisabledColor = new Color( 1, 1, 1, 0.5f ); | |
private const int WIDTH = 16; | |
private const int HEIGHT = 16; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ByteBufferに読み込み | |
ByteBuffer buffer = ByteBuffer.allocateDirect(width * height * 4); | |
gl10.glReadPixels(0, 0, width, height, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, buffer); | |
// 上下逆なので、上下反転 | |
byte[] tmp1 = new byte[width * 4]; | |
byte[] tmp2 = new byte[width * 4]; | |
int h = (int) height / 2; | |
for (int y = 0; y < h; y++) { | |
buffer.position(y * width * 4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface UIColor (AppleCrayons) | |
+ (UIColor *)cantaloupeColor; | |
+ (UIColor *)honeydewColor; | |
+ (UIColor *)spindriftColor; | |
+ (UIColor *)skyColor; | |
+ (UIColor *)lavenderColor; | |
+ (UIColor *)carnationColor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This code is originally from here: | |
* http://stackoverflow.com/questions/7203047/code-for-download-video-from-youtube-on-java-android | |
* | |
* And some code about HTTP header is from here: | |
* http://xissy.github.com/dev/2012/09/28/get-a-youtube-mp4-file-link-which-can-be-played-iphone/ | |
*/ | |
package com.example.zzz; | |
import java.io.IOException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double photoSize = 640; | |
// フィルターの設定 | |
//// まずフィルターグループを作る。フィルターを一つにまとめることで、あとで画像をつくるときに全部のフィルターがかかった画像が得られる | |
self.filterGroup = [[GPUImageFilterGroup alloc] init]; | |
//// 最初のフィルター便宜的に | |
GPUImageFilter *firstFilter = [[GPUImageCropFilter alloc] initWithCropRegion:CGRectMake(0, 0.125f, 1.0f, 0.75f)]; | |
[self.filterGroup addFilter:firstFilter]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void addValue(String val, String key, OutputStream strm, String boundary) throws UnsupportedEncodingException, IOException { | |
strm.write(boundary.getBytes("UTF-8")); | |
strm.write("\r\n".getBytes("UTF-8")); | |
strm.write("Content-Disposition: form-data; name=\"".getBytes("UTF-8")); | |
strm.write(key.getBytes("UTF-8")); | |
strm.write("\"\r\n\r\n".getBytes("UTF-8")); | |
strm.write(val.getBytes("UTF-8")); | |
strm.write("\r\n".getBytes("UTF-8")); | |
} | |
OlderNewer