add games
This commit is contained in:
33
assignment8final/Assets/ProtoPack/Scripts/OpenAnimTest.cs
Normal file
33
assignment8final/Assets/ProtoPack/Scripts/OpenAnimTest.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class OpenAnimTest: MonoBehaviour {
|
||||
|
||||
Animator anim;
|
||||
bool open = false;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
|
||||
anim = GetComponent<Animator>();
|
||||
|
||||
}
|
||||
|
||||
void OnMouseDown(){
|
||||
|
||||
if (!open){
|
||||
|
||||
open = true;
|
||||
anim.SetBool("open", open);
|
||||
|
||||
} else {
|
||||
|
||||
open = false;
|
||||
anim.SetBool("open", open);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d7c1ecb3a9ab7342931fc05b75f6367
|
||||
timeCreated: 1447516014
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class PlatformLiftTest : MonoBehaviour
|
||||
{
|
||||
|
||||
Vector3 startPos;
|
||||
float sinFloat;
|
||||
|
||||
void Start ()
|
||||
{
|
||||
|
||||
startPos = transform.position;
|
||||
|
||||
}
|
||||
|
||||
void Update ()
|
||||
{
|
||||
|
||||
sinFloat = Mathf.Sin (Time.time) / 2 + 0.5f;
|
||||
transform.position = startPos + new Vector3 (0f, sinFloat, 0f);
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee8d1921848700a4293d095929fee990
|
||||
timeCreated: 1446465857
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
51
assignment8final/Assets/ProtoPack/Scripts/PlayerJumpTest.cs
Normal file
51
assignment8final/Assets/ProtoPack/Scripts/PlayerJumpTest.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class PlayerJumpTest : MonoBehaviour
|
||||
{
|
||||
|
||||
Animator anim;
|
||||
Rigidbody rb;
|
||||
bool jump = false;
|
||||
|
||||
void Start ()
|
||||
{
|
||||
|
||||
anim = GetComponent<Animator> ();
|
||||
rb = GetComponent<Rigidbody> ();
|
||||
|
||||
}
|
||||
|
||||
void Update ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OnMouseDown ()
|
||||
{
|
||||
|
||||
if (!jump) {
|
||||
jump = true;
|
||||
anim.SetBool ("jump", true);
|
||||
anim.SetBool ("land", false);
|
||||
rb.AddForce (Vector3.up * 200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void OnCollisionEnter ()
|
||||
{
|
||||
|
||||
if (jump) {
|
||||
Invoke ("JumpReset", 0.25f);
|
||||
anim.SetBool ("jump", false);
|
||||
anim.SetBool ("land", true);
|
||||
}
|
||||
}
|
||||
|
||||
void JumpReset ()
|
||||
{
|
||||
jump = false;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28aa144229a826944bfc77b5e19cb891
|
||||
timeCreated: 1447531597
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
11
assignment8final/Assets/ProtoPack/Scripts/RotateScript.cs
Normal file
11
assignment8final/Assets/ProtoPack/Scripts/RotateScript.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class RotateScript : MonoBehaviour {
|
||||
|
||||
void Update () {
|
||||
|
||||
transform.Rotate (Vector3.up*5);
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 764b60f3d4c3710448927f6e62b204ab
|
||||
timeCreated: 1447853057
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
12
assignment8final/Assets/ProtoPack/Scripts/SlimeMoveTest.cs
Normal file
12
assignment8final/Assets/ProtoPack/Scripts/SlimeMoveTest.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class SlimeMoveTest : MonoBehaviour {
|
||||
|
||||
void Update () {
|
||||
|
||||
transform.Translate (Vector3.forward / 60);
|
||||
transform.Rotate (Vector3.up * 1.5f);
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: defb3eee67ce9e449b872e8203082291
|
||||
timeCreated: 1447801051
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user