Large diffs are not rendered by default.

@@ -1,33 +1,67 @@
using UnityEngine;
using System.Collections;
using System.Linq;

public class HandController : MonoBehaviour {
public GameObject handItem;
[SerializeField] private Transform handItem;
private Vector3 screenPos;
private Vector3 worldPos;
public Renderer rend;
//public Renderer rend;

private Vector3 lastRayPos;
private float rayMovedMag;
[SerializeField] private float threshold = 2f;

[SerializeField] private int force = 3;

// Use this for initialization
void Start () {
this.handItem = GameObject.Find ("HandItem");
//renderer.
rend = GetComponent<Renderer>();
//this.handItem = GameObject.Find ("HandItem");

//renderer.
//rend = GetComponent<Renderer>();

}

// Update is called once per frame
void Update () {

// Hand Item positon move to cursor position
this.screenPos = Input.mousePosition;
this.screenPos.z = 10f;
this.worldPos = Camera.main.ScreenToWorldPoint (this.screenPos);
this.handItem.transform.position = this.worldPos;
Debug.Log (this.worldPos);

// render material.
if (Input.GetMouseButton(0)) {
this.rend.sharedMaterial.color = Color.gray;
} else {
this.rend.sharedMaterial.color = Color.blue;
}
}
this.handItem.position = this.worldPos;

// raycast for erase YOGORE
if(Input.GetMouseButton(0))
{
if(lastRayPos == Vector3.zero)
{
lastRayPos = worldPos;
}

rayMovedMag += (lastRayPos - worldPos).magnitude;
lastRayPos = worldPos;

if (rayMovedMag >= threshold)
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
IErasable[] erasables;

erasables = Physics.RaycastAll(ray, Mathf.Infinity)
.Select(t => t.transform.GetComponent<IErasable>())
.ToArray();
foreach (var erasable in erasables)
{
if(erasable != null)
{
erasable.Erase(force);
}
}
rayMovedMag = 0;
}
}

if (Input.GetMouseButtonUp(0)) lastRayPos = Vector3.zero;
}
}
@@ -47,7 +47,6 @@ void Awake()
yield return new WaitForEndOfFrame();
continue;
}

yield return new WaitForSeconds(yogoreData.recover_interval);
curHp += yogoreData.recover_value;
}
@@ -62,8 +61,9 @@ void CleanUp()
{
if (cleanupEffect)
{
Debug.Log("SET UP CLEAN UP EFFECT!");
Instantiate(cleanupEffect, transform.position, Quaternion.identity);
}

Destroy(gameObject);
}
}
@@ -0,0 +1,157 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: toilet_bathroom_01_starter
m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _METALLICGLOSSMAP _NORMALMAP _SPECGLOSSMAP
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: c365a829de8d89945bf193aabd14996e, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 2800000, guid: 811bd7a3e8a536b478d33411d6f07070, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _OcclusionMap
second:
m_Texture: {fileID: 2800000, guid: 0877c86c1d677cd40a279fe2ccd1a027, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 2800000, guid: be6c8590a34856546b0fc78d2a34e062, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _SpecGlossMap
second:
m_Texture: {fileID: 2800000, guid: c62cb93227badb0428879b58b54b25ba, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _SrcBlend
second: 1
data:
first:
name: _DstBlend
second: 0
data:
first:
name: _Cutoff
second: 0.5
data:
first:
name: _Parallax
second: 0.02
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: 0.5
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 0.045
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: 0
data:
first:
name: _EmissionScaleUI
second: 0
m_Colors:
data:
first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 0}
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _SpecColor
second: {r: 0.2, g: 0.2, b: 0.2, a: 1}
data:
first:
name: _EmissionColorUI
second: {r: 1, g: 1, b: 1, a: 1}
@@ -0,0 +1,138 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C91"
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 0277d7502650d8e45851772e2f639603, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _SrcBlend
second: 1
data:
first:
name: _DstBlend
second: 0
data:
first:
name: _Cutoff
second: 0.5
data:
first:
name: _Parallax
second: 0.02
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: 0.5
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 1
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: 0
m_Colors:
data:
first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Large diffs are not rendered by default.