Skip to content

Commit

Permalink
intial release
Browse files Browse the repository at this point in the history
  • Loading branch information
therealmichaelberna committed Apr 6, 2021
1 parent 745d56b commit 3643f97
Show file tree
Hide file tree
Showing 59 changed files with 7,669 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Assets/AutoHideTaskbar.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using UnityEngine;

public class AutoHideTaskbar : MonoBehaviour
{
public GameObject taskbar;

void Update()
{
if ((Input.touchCount != 0) || ((Input.GetAxis("Mouse X") != 0) || (Input.GetAxis("Mouse Y") != 0)))
{
taskbar.SetActive(true);
CancelInvoke("HideUISystem");
}

else
{
Invoke("HideUISystem", 1f);
}
}

void HideUISystem()
{
taskbar.SetActive(false);
}
}
11 changes: 11 additions & 0 deletions Assets/AutoHideTaskbar.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions Assets/Initialization.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Initialization : MonoBehaviour
{
[SerializeField]
private settings Settings;
// Start is called before the first frame update
void Start()
{
Settings.InitializeSettings();

}
}
11 changes: 11 additions & 0 deletions Assets/Initialization.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Assets/Mirror.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Mirror : MonoBehaviour
{
[SerializeField]
private RectTransform mainTextInputTransform;
[SerializeField]
private RectTransform teleprompterPlayText;

public void MirrorText()
{
Debug.Log("mirroring text");
mainTextInputTransform.localScale = new Vector3(mainTextInputTransform.localScale.x*-1, 1,1);
teleprompterPlayText.localScale = mainTextInputTransform.localScale;
}
}
11 changes: 11 additions & 0 deletions Assets/Mirror.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 84 additions & 0 deletions Assets/PlayAndStop.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class PlayAndStop : MonoBehaviour
{
[SerializeField]
private Sprite playIcon;

[SerializeField]
private Sprite stopIcon;

[SerializeField]
private InputField mainInputField;

[SerializeField]
private Text playText;

[SerializeField]
private Image playButtonIcon;

private bool currentlyPlaying = false;

[SerializeField]
private settings Settings;

private const float playTextDefaultYPosition = -287.5f;
private const float mouseScrollScale = 20f;

public void OnPlayStopButonClick()
{
if(currentlyPlaying)
{
Stop();
}
else
{
Play();
}
}
public void Play()
{
mainInputField.gameObject.SetActive(false);
playText.gameObject.SetActive(true);
playText.fontSize = mainInputField.textComponent.fontSize;
playText.text = mainInputField.text;
playText.gameObject.GetComponent<RectTransform>().sizeDelta = new Vector2(playText.gameObject.GetComponent<RectTransform>().sizeDelta.x, 1);
playButtonIcon.sprite = stopIcon;//change the icon indicating that we can stop
currentlyPlaying = true;
}
public void Stop()
{
mainInputField.gameObject.SetActive(true);
playText.gameObject.SetActive(false);
playButtonIcon.sprite = playIcon;//change the icon indicating that we can play

currentlyPlaying = false;
}

void Update()
{
float newYPos = 0;

if (currentlyPlaying)//if we are playing
{
if(Settings.autoScrollActiveSetting && Input.mouseScrollDelta.y == 0)//if auto scroll is enabled, scroll away!
{
newYPos = (playText.gameObject.GetComponent<RectTransform>().anchoredPosition.y) + (Settings.scrollSpeedActiveSetting * Time.deltaTime);
}

//Debug.Log("scrolling");
if (Input.mouseScrollDelta.y != 0)//also scroll if we are using the mouse
{
//Debug.Log("mouse scroll detected!");
//Debug.Log("mouse scroll value: " + Input.mouseScrollDelta.y);
//Debug.Log("mouse scroll scaled speed:" + );
newYPos = (playText.gameObject.GetComponent<RectTransform>().anchoredPosition.y) + (Input.mouseScrollDelta.y * mouseScrollScale);
}

playText.gameObject.GetComponent<RectTransform>().anchoredPosition = new Vector2(playText.gameObject.GetComponent<RectTransform>().anchoredPosition.x, newYPos);
}
}
}
11 changes: 11 additions & 0 deletions Assets/PlayAndStop.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Scenes.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3643f97

Please sign in to comment.