Added new assets

This commit is contained in:
Vladimir Koshevarov
2023-02-20 19:02:00 +02:00
parent 92a2aa49e5
commit 6388763d98
1501 changed files with 702875 additions and 637 deletions
@@ -0,0 +1,72 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace SojaExiles
{
public class opencloseSlide : MonoBehaviour
{
public Animator openandclosewindow;
public bool open;
public Transform Player;
void Start()
{
open = false;
}
void OnMouseOver()
{
{
if (Player)
{
float dist = Vector3.Distance(Player.position, transform.position);
if (dist < 15)
{
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 Window");
openandclosewindow.Play("OpeningSlide");
open = true;
yield return new WaitForSeconds(.5f);
}
IEnumerator closing()
{
print("you are closing the Window");
openandclosewindow.Play("ClosingSlide");
open = false;
yield return new WaitForSeconds(.5f);
}
}
}