Commit 5306387b authored by radow's avatar radow
Browse files

final

parent f5d86c27
......@@ -7,6 +7,7 @@ public class Collisionsound : MonoBehaviour
{
public AudioSource auds;
public GameObject collider;
public doorOpening door;
public bool isNote;
public enum Note {C,D,E,F,G,A,H,c};
......@@ -25,7 +26,10 @@ public class Collisionsound : MonoBehaviour
{
if (notes.Count >= 4) notes.Dequeue();
notes.Enqueue(note);
if ("A,C,A,H" == string.Join(",", notes.ToArray())) collider.SetActive(false);
if ("A,C,A,H" == string.Join(",", notes.ToArray())) {
collider.SetActive(false);
door.solved = true;
}
}
}
}
......@@ -20,6 +20,7 @@ public class PlayerSpring : MonoBehaviour
public float maxImpulse = 5;
public bool groundedFlag;
public float speed;
public bool sound = true;
bool charging;
float charge = 0;
......@@ -54,7 +55,7 @@ public class PlayerSpring : MonoBehaviour
//Launch
charging = false;
rb.AddForce(springBody.up * charge * maxImpulse, ForceMode.Impulse);
auds.Play();
if(sound)auds.Play();
charge = 0;
//Animation
sr.SetBlendShapeWeight(0, 0);
......
This diff is collapsed.
fileFormatVersion: 2
guid: a2ed27f996cc57046b6fcb68e7ce1a1a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: ff104b38bc560a74885cb4c2824fcb17
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 36b895e01f7f0424d90f0ebc3667b509
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
......@@ -12,11 +12,17 @@ public class TriggerZone : MonoBehaviour
bool inZone;
public bool set2D;
public PlayerSpring player;
public bool soundout;
public bool interactable;
public bool loadLevel;
public bool deactivateAgain;
public List<GameObject> activateOnTouch = new List<GameObject>();
public List<GameObject> deActivateOnTouch = new List<GameObject>();
public List<GameObject> activateOnInteract = new List<GameObject>();
public tut Tut;
public bool msg;
public string msgtext;
private void OnTriggerEnter(Collider other)
{
inZone = true;
......@@ -24,10 +30,13 @@ public class TriggerZone : MonoBehaviour
foreach (GameObject go in deActivateOnTouch) go.SetActive(false);
if (set2D) InputMode.SetMode(InputMode.Mode.TWOD);
if (loadLevel) SceneManager.LoadScene(2);
if (soundout) player.sound = false;
if (msg) Tut.SendMessage(msgtext);
}
private void OnTriggerExit(Collider other)
{
inZone = false;
if (!deactivateAgain) return;
foreach (GameObject go in activateOnTouch) go.SetActive(false);
}
}
......@@ -12,7 +12,7 @@ public class doorOpening : MonoBehaviour
public Transform openL;
public Transform openR;
public float speed;
public float duration;
public bool solved;
// Start is called before the first frame update
......@@ -21,12 +21,13 @@ public class doorOpening : MonoBehaviour
}
// Update is called once per frame
float progress = 0;
void Update()
{
if (solved) {
doorL.transform.rotation = Quaternion.Lerp(closedL.rotation, openL.rotation, Time.time * speed);
doorR.transform.rotation = Quaternion.Lerp(closedR.rotation, openR.rotation, Time.time * speed);
progress += Time.deltaTime / duration;
doorL.transform.rotation = Quaternion.Lerp(closedL.rotation, openL.rotation, progress);
doorR.transform.rotation = Quaternion.Lerp(closedR.rotation, openR.rotation, progress);
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class movit : MonoBehaviour
{
public float duration = 5;
public Transform obj;
public Transform inO;
public Transform outO;
float progress = 0;
void Update()
{
progress += Time.deltaTime / duration;
obj.localPosition = Vector3.Lerp(inO.localPosition, outO.localPosition, progress);
}
}
fileFormatVersion: 2
guid: 8e3852feda255a945a1e147b5c72bcc6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.SceneManagement;
public class tut : MonoBehaviour
{
public float delay;
public float fadedur;
public List<TextMeshProUGUI> texts = new List<TextMeshProUGUI>();
public GameObject escapemenu;
public TextMeshProUGUI Message;
public float messageduration;
bool message;
float progress;
bool pausemode;
bool startdone;
InputMode.Mode prevmode;
void Update()
{
if (Time.time > delay && !startdone)
{
progress += Time.deltaTime / fadedur;
foreach(TextMeshProUGUI tm in texts)
{
Color c = tm.color;
c.a = 1 - progress;
tm.color = c;
}
if (progress > 1)
{
startdone = true;
GetComponent<AudioSource>().Play();
}
}
if (Input.GetKeyDown(KeyCode.Escape))
{
EscapeMenuToggle();
}
if (message)
{
progress += Time.deltaTime / fadedur;
Color c = Message.color;
c.a = 1 - progress;
Message.color = c;
}
}
public void EscapeMenuToggle()
{
pausemode = !pausemode;
if (pausemode)
{
prevmode = InputMode.GetMode();
InputMode.SetMode(InputMode.Mode.UI);
escapemenu.SetActive(true);
}
else
{
InputMode.SetMode(prevmode);
escapemenu.SetActive(false);
}
}
public void QuitToMenu()
{
SceneManager.LoadScene(0);
}
public void SendMessage(string s)
{
progress = 0;
Message.text = s;
Message.color = Color.white;
Invoke("startfading", messageduration);
}
void startfading()
{
message = true;
}
}
fileFormatVersion: 2
guid: bb894e7bddb79374ea46fae91c991422
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment