Skip to content

Instantly share code, notes, and snippets.

@TORISOUP
TORISOUP / ICharacterInput.cs
Created December 6, 2014 04:47
UnitychanGhostMansion
using UnityEngine;
public interface ICharacterInput
{
/// <summary>
/// カメラの現在のForward
/// </summary>
/// <param name="cameraDirection">Camera direction.</param>
void SetCameraDirection(Vector3 cameraDirection);
@TORISOUP
TORISOUP / gist:6262312e9727acb5976b
Created January 11, 2015 16:16
CharacterControllerとMoveの例
using UnityEngine;
using System.Collections;
public class PlayerMoveUseMove : MonoBehaviour
{
private CharacterController characterController;
public float speed = 3.0f;
void Start()
{
using UnityEngine;
using System.Collections;
using UniRx;
using System.Linq;
public class Command : MonoBehaviour
{
enum InputStatus
{
@TORISOUP
TORISOUP / gist:d1ece16bf01c0a4c61c3
Last active August 29, 2015 14:15
Move and AnimationChange
private CharacterController characterController;
bool IsJumpable
{
get
{
if (!characterController.isGrounded)
{
return false;
}
@TORISOUP
TORISOUP / gist:7f0ae5b98fd4ea8769b3
Last active August 29, 2015 14:15
UniRx & HttpWebRequest
Observable.Start(() =>
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://google.com");
return (HttpWebResponse)webRequest.GetResponse();
})
.CatchIgnore((WebException e) =>
{
//WebException発生時の処理
Debug.LogError(e.Status);
})
@TORISOUP
TORISOUP / gist:e0b88d3afc73751fce0c
Last active August 29, 2015 14:16
ButtonClicked
using UnityEngine;
using UniRx;
using UnityEngine.UI;
namespace UniRxSamples
{
public class ButtonClick : MonoBehaviour
{
[SerializeField] private Button button;
[SerializeField] private Text text;
using UnityEngine;
using UniRx;
using UnityEngine.UI;
namespace UniRxSamples
{
public class InputFieldToText : MonoBehaviour
{
[SerializeField]
private InputField inputField;
using System;
using System.Collections.Generic;
using UnityEngine;
using UniRx;
using UnityEngine.UI;
using System.Linq;
using System.Xml.Linq;
namespace UniRxSamples
{
public class SuggestText : MonoBehaviour
using UnityEngine;
using UniRx;
namespace UniRxSamples
{
public class OnGroundedScript : ObservableMonoBehaviour
{
public override void Start()
{
var characterController = GetComponent<CharacterController>();
var enemyNames = Enemys.GetComponentsInChildren<Enemy>()
.Where(x => x.HP > 0)
.Where(x =>
{
var enemyPos = x.transform.position;
var playerPos = player.transform.position;
return Vector3.Distance(enemyPos, playerPos) <= 10;
})
.Where(x =>
{