Initial commit
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c95c1404923c9134f9634c0671b773ae
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SojaExiles
|
||||
|
||||
{
|
||||
|
||||
public class Drawer_Pull_X : MonoBehaviour
|
||||
{
|
||||
|
||||
public Animator pull_01;
|
||||
public bool open;
|
||||
public Transform Player;
|
||||
|
||||
void Start()
|
||||
{
|
||||
open = false;
|
||||
}
|
||||
|
||||
void OnMouseOver()
|
||||
{
|
||||
{
|
||||
if (Player)
|
||||
{
|
||||
float dist = Vector3.Distance(Player.position, transform.position);
|
||||
if (dist < 10)
|
||||
{
|
||||
print("object name");
|
||||
if (open == false)
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
StartCoroutine(opening());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (open == true)
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
StartCoroutine(closing());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
IEnumerator opening()
|
||||
{
|
||||
print("you are opening the door");
|
||||
pull_01.Play("openpull_01");
|
||||
open = true;
|
||||
yield return new WaitForSeconds(.5f);
|
||||
}
|
||||
|
||||
IEnumerator closing()
|
||||
{
|
||||
print("you are closing the door");
|
||||
pull_01.Play("closepush_01");
|
||||
open = false;
|
||||
yield return new WaitForSeconds(.5f);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0d5557a01f4e0740bd53d6ed2ab7327
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cbe129b7b03ebee479e57de9c57e9527
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SojaExiles
|
||||
|
||||
{
|
||||
public class Drawer_Pull_Z : MonoBehaviour
|
||||
{
|
||||
|
||||
public Animator pull;
|
||||
public bool open;
|
||||
public Transform Player;
|
||||
|
||||
void Start()
|
||||
{
|
||||
open = false;
|
||||
}
|
||||
|
||||
void OnMouseOver()
|
||||
{
|
||||
{
|
||||
if (Player)
|
||||
{
|
||||
float dist = Vector3.Distance(Player.position, transform.position);
|
||||
if (dist < 10)
|
||||
{
|
||||
print("object name");
|
||||
if (open == false)
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
StartCoroutine(opening());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (open == true)
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
StartCoroutine(closing());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
IEnumerator opening()
|
||||
{
|
||||
print("you are opening the door");
|
||||
pull.Play("openpull");
|
||||
open = true;
|
||||
yield return new WaitForSeconds(.5f);
|
||||
}
|
||||
|
||||
IEnumerator closing()
|
||||
{
|
||||
print("you are closing the door");
|
||||
pull.Play("closepush");
|
||||
open = false;
|
||||
yield return new WaitForSeconds(.5f);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 286620fa050ddc24d90bd777daaa73c5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user