Skip to content

Instantly share code, notes, and snippets.

View doremi31618's full-sized avatar
😇
feel free to contact me

EricZhan doremi31618

😇
feel free to contact me
View GitHub Profile
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Newtonsoft.Json;
using UnityEngine.Events;
using System.IO;
using System;
/// <summary>
/// Save And Load
/// 本篇腳本參考:http://zxxcc0001.pixnet.net/blog/post/243195373-unity---各平台檔案路徑
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PlayerData : MonoBehaviour {
SaveAndLoad SL;
public Text playerName;
public Text InputData;//在Inspector視窗中拖入InputField底下的Text
/// <summary>
/// 腳本功能解說:
/// 雙人動作判定,可以自定義多種狀態,可以自定義多種動作
/// 城市流程說明:
/// 動作偵測函式 -> 判斷玩家一或玩家二 ->判斷玩家狀態(不同狀態不同動作偵測)-> 動作偵測
/// 想要新增動作需要調整:
/// 1.PlayerGestureDetect函式裡面Swith case裏頭的姿勢
/// 2.userDetect 裡新增新增動作
/// 想要新增玩家新的狀態需要注意:
/// 1.調整動作或新增動作(呈上)
/// <summary>
/// 腳本功能說明:
/// 角色移動蘑菇頭
/// 互動流程:
/// 點擊螢幕 -> 出現UI在點擊位置 -> 按住滑動 -> 蘑菇頭跟著移動 ->角色跟著移動 -> 放開滑鼠(離開螢幕)->ui消失
/// </summary>
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@doremi31618
doremi31618 / Duck.cs
Created October 26, 2018 09:03
策略模式(strategy pattern)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Duck <see langword="abstract"/> .
/// </summary>
public abstract class Duck {
protected FlyBehavior flyBehavior;
protected QuackBehavior quackBehavior;
public void performQuack()
@doremi31618
doremi31618 / MallarDuck.cs
Created October 26, 2018 09:05
顯示策略模式結果
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MallardDuck : Duck
{
public MallardDuck()
{
quackBehavior = new MuteQuack();
Shader "Custom/"360ThetaV
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WebCamTest : MonoBehaviour
{
public int numberOfCamera = 0;
// Use this for initialization
void Start()
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.IO;
using System;
namespace ThetaV
{
/// <summary>
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ThetaV;
public class test : MonoBehaviour {
// Use this for initialization
void Start () {
JObject jObject = null;
//LoadData.ReadFileFromInternet(jObject);