Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections;
public class PlayParticle: MonoBehaviour {
public ParticleSystem myEffect;
void OnTriggerEnter(Collider col)
{
if (col.CompareTag("projectile"))
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ChangeText : MonoBehaviour {
public Text mytext;
private int counter;
// Use this for initialization
void Start () {
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Video;
using UnityEngine.UI;
public class PlayMovieOnSpace : MonoBehaviour {
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class ScoreBoard : MonoBehaviour {
public GameManager gameManager;
private Text scoreText;
// Use this for initialization
void Start () {
using UnityEngine;
using System.Collections;
public class Goal : MonoBehaviour {
public int scoreMultiplier = 1;
void OnTriggerEnter(Collider col)
{
if (col.CompareTag("projectile"))
using UnityEngine;
using System.Collections;
public class BallReset : MonoBehaviour {
private Transform myTransform;
private Rigidbody myRigidbody;
private Vector3 startPosition;
public float resetYHeight = 0f;
public GameManager gameManager;
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
[RequireComponent(typeof(SteamVR_LoadLevel))]
public class GameManager : MonoBehaviour {
public int score;
public int projectilesThrown;
public bool countNumberOfProjsThrown = true;
public int projectilesPerLevel = 5;
@atakotestudios
atakotestudios / Projectile.cs
Last active June 27, 2017 01:27
Projectile Script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Projectile : MonoBehaviour {
// Use this for initialization
void Start () {
Destroy(gameObject, 11f);
}
@atakotestudios
atakotestudios / Cannon.cs
Last active October 26, 2017 00:58
Cannon Script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Cannon : MonoBehaviour {
public GameObject projectile; //attach the projectile prefab here
public GameObject spawnpoint; //empty gameObject at position projectile should spawn
public float forceSpeed = 15f;
//SteamVR input
@atakotestudios
atakotestudios / GrabThrowFromHands.cs
Last active October 26, 2017 00:59
Script for controller in 2 hr intro session 5/9/2017
using UnityEngine;
using System.Collections;
//How to Use: Attach this script to Controller(left) and/or Controller(right) to enable object pickup and throwing.
//Controller(left/right) need trigger collider components. Objects you want to interact with need the "Throwable" tag.
[RequireComponent(typeof(Collider))]
[RequireComponent(typeof(Rigidbody))]
public class GrabThrowFromHands : MonoBehaviour {
private SteamVR_TrackedObject trackedObj;