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
open( "./text.txt" ) {|f| | |
f.each {|s| | |
puts s | |
} | |
} |
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 UnityEngine.UI; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
public static class GameObjectExtensions | |
{ | |
// 直下の子供のみからコンポネント含むObjectのリストを取得 | |
public static T[] GetComponentsInChildrenBeneath<T>(this GameObject self) where T : Component |
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; | |
public static class TransformExtensions | |
{ | |
// 直下の子供全削除 | |
public static void DestroyAllChildren(this Transform self) | |
{ | |
foreach (Transform trans in self) { | |
Object.Destroy(trans.gameObject); | |
} |
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
if (Physics.Raycast(ray, out hit) && !UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject()){} |
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
iTween.MoveTo(gameObject,iTween.Hash("path",iTweenPath.GetPath("New Path 2"),"time",10f, "orienttopath", true)); |
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 DG.Tweening; | |
public static class TransformExtensions | |
{ | |
public static void SmoothLookAt(this Transform self, Vector3 pos, float time) | |
{ | |
self.DORotate (Quaternion.LookRotation (pos).eulerAngles, time); | |
} | |
} |
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; | |
// http://twiik.net/articles/realtime-reflections-in-unity-5 | |
public class OrbitCamera : MonoBehaviour { | |
public Transform target; | |
public float rotateSpeed = 3.0f; |
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 Utility/SmoothFollow.cs |
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; | |
public class PinchInCamera : MonoBehaviour { | |
public float minHeight = 1.0f; | |
public float maxHeight = 10.0f; | |
private float touchDistance = 0.0f; | |
private float scaleSpeed = 0.1f; |
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
Shader "Custom/ColorBathRed" { | |
Properties { | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_Threshold( "Threshold", Range(0.0, 1.0) ) = 0.5 // added | |
} | |
SubShader { | |
Tags { "RenderType"="Opaque" } | |
LOD 200 | |
Pass { | |
CGPROGRAM |
OlderNewer