// Jimmy Vegas Unity Tutorials // These scripts will open your chest and for splashscreen //JS CHEST var ChestSwing : GameObject; var ThisObject : GameObject; function OnMouseDown () { ThisObject.GetComponent("BoxCollider").enabled = false; yield WaitForSeconds(0.5); ChestSwing.GetComponent("Animation").enabled = true; yield WaitForSeconds (0.99); ChestSwing.GetComponent("Animation").enabled = false; } //C# CHEST using System.Collections; using System.Collections.Generic; using UnityEngine; public class ChestOpening : MonoBehaviour { public GameObject chestSwing; public GameObject thisObject; void OnMouseDown() { chestSwing.GetComponent().Play("ChestPivot"); } } //splash using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class SplashToTitle : MonoBehaviour { void Start () { StartCoroutine(JimmyToMenu()); } IEnumerator JimmyToMenu() { yield return new WaitForSeconds(4); SceneManager.LoadScene(1); } }