From a8fe54592f727ddad05040b82ccb490218682d7c Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Sat, 1 Feb 2020 17:06:41 +0100 Subject: Renamed to Dragon Dust --- nGJ2019/Assets/Scripts/RockJaws.cs | 40 -------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 nGJ2019/Assets/Scripts/RockJaws.cs (limited to 'nGJ2019/Assets/Scripts/RockJaws.cs') diff --git a/nGJ2019/Assets/Scripts/RockJaws.cs b/nGJ2019/Assets/Scripts/RockJaws.cs deleted file mode 100644 index 874d6d3..0000000 --- a/nGJ2019/Assets/Scripts/RockJaws.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class RockJaws : MonoBehaviour -{ - public Transform TopJaw; - public Transform BottomJaw; - public int Speed = 10; - private bool reverse = false; - private float initialTopJawY; - // Start is called before the first frame update - void Start() - { - initialTopJawY = TopJaw.localPosition.y; - } - - // Update is called once per frame - void Update() - { - - } - - void FixedUpdate() - { - var topJawHeight= TopJaw.GetComponent().bounds.size.y; - var bottomJawHeight= BottomJaw.GetComponent().bounds.size.y; - - if (TopJaw.localPosition.y - topJawHeight / 2 < BottomJaw.localPosition.y + bottomJawHeight / 2) reverse = true; - else if(TopJaw.localPosition.y > initialTopJawY) reverse = false; - - if (!reverse) { - TopJaw.Translate(0, -0.01f * Speed, 0, Space.World); - BottomJaw.Translate(0, 0.01f * Speed, 0, Space.World); - } else { - TopJaw.Translate(0, 0.01f * Speed, 0, Space.World); - BottomJaw.Translate(0, -0.01f * Speed, 0, Space.World); - } - } -} -- cgit v1.2.3