@@ -1,47 +1,69 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &126708
--- !u!1 &118576
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 486836}
- 114: {fileID: 11459568}
- 4: {fileID: 481134}
- 114: {fileID: 11453932}
- 114: {fileID: 11472344}
- 114: {fileID: 11419548}
m_Layer: 0
m_Name: testChallenge
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &486836
--- !u!4 &481134
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 126708}
m_GameObject: {fileID: 118576}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!114 &11459568
--- !u!114 &11419548
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 126708}
m_GameObject: {fileID: 118576}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 24a77853c0cdd4e4a8575000b40d2e25, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &11453932
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 118576}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 54be832093c5b04439660a5d13a596d6, type: 3}
m_Name:
m_EditorClassIdentifier:
IsStarted: 0
goalState: {fileID: 11453254, guid: 5fc30c70039363049a84996103f62a91, type: 2}
failState: {fileID: 11444124, guid: 265729e9293713545b4b868dcdd060af, type: 2}
--- !u!114 &11472344
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 118576}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8a074625b25322d4b99bb754919d2f3d, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
@@ -51,5 +73,5 @@ Prefab:
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 126708}
m_RootGameObject: {fileID: 118576}
m_IsPrefabParent: 1
Empty file.
Empty file.
Empty file.
Empty file.
@@ -0,0 +1,104 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &186856
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 427344}
- 33: {fileID: 3397568}
- 65: {fileID: 6528084}
- 23: {fileID: 2359148}
- 54: {fileID: 5477216}
m_Layer: 0
m_Name: testcube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &427344
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 186856}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.37, z: 0.224}
m_LocalScale: {x: 0.06751924, y: 0.0675192, z: 0.0675192}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!23 &2359148
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 186856}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 1
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!33 &3397568
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 186856}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!54 &5477216
Rigidbody:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 186856}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 2
--- !u!65 &6528084
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 186856}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 186856}
m_IsPrefabParent: 1
0 HackerMan/Assets/Scripts.meta 100755 → 100644
Empty file.
@@ -11,61 +11,63 @@ public class Challenge : MonoBehaviour {
public bool IsStarted = false;

// Goal
public GoalState goalState;
private GoalState goalState;
// Fail State
public FailState failState;
private FailState failState;

// Use this for initialization
void Start () {


void Start () {


}


// use this to initialize any game specific logic
public void StartChallenge()
{
IsStarted = true;
goalState = Instantiate(goalState);
failState = Instantiate(failState);
Debug.Log("chellege staert");
}
public void StartChallenge()
{
IsStarted = true;
//goalState = Instantiate(goalState);
//failState = Instantiate(failState);
goalState = GetComponent<GoalState>();
failState = GetComponent<FailState>();
Debug.Log("chellege staert");
}

// Update is called once per frame
void Update () {
if (IsStarted && goalState.CheckIfStateIsReached())
{
Debug.Log("goal reached");
goalReached.Invoke(this, EventArgs.Empty);
Destroy(failState);
Destroy(goalState);
IsStarted = false;
void Update () {
if (IsStarted && goalState.CheckIfStateIsReached())
{
Debug.Log("goal reached");
goalReached.Invoke(this, EventArgs.Empty);
DestroyImmediate(failState);
DestroyImmediate(goalState);
IsStarted = false;
}
if (IsStarted && failState.CheckIfStateIsReached())
{
Debug.Log("fail reached");
failStateReached.Invoke(this, EventArgs.Empty);
DestroyImmediate(failState);
DestroyImmediate(goalState);
IsStarted = false;
}
if (IsStarted && failState.CheckIfStateIsReached())
{
Debug.Log("fail reached");
failStateReached.Invoke(this, EventArgs.Empty);
Destroy(failState);
Destroy(goalState);
IsStarted = false;
}
}

protected virtual void OnGoalReached(EventArgs e)
{
EventHandler handler = goalReached;
if (handler != null)
{
handler(this, e);
}
protected virtual void OnGoalReached(EventArgs e)
{
EventHandler handler = goalReached;
if (handler != null)
{
handler(this, e);
}
}

protected virtual void OnFailStateReached(EventArgs e)
{
EventHandler handler = failStateReached;
if (handler != null)
{
handler(this, e);
}
protected virtual void OnFailStateReached(EventArgs e)
{
EventHandler handler = failStateReached;
if (handler != null)
{
handler(this, e);
}
}
}
Empty file.
@@ -1,29 +1,19 @@
using UnityEngine;
using System.Collections;
using System;

abstract public class GameObjectiveState : MonoBehaviour {
using System;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
abstract public class GameObjectiveState : MonoBehaviour {

public abstract bool CheckIfStateIsReached();
}



abstract public class GoalState : GameObjectiveState { }



abstract public class FailState : GameObjectiveState { }



abstract public class GoalState : GameObjectiveState { }



abstract public class FailState : GameObjectiveState { }



Empty file.
@@ -5,7 +5,7 @@

public class MissionControl : MonoBehaviour {



private LinkedListNode<Challenge> currentChallenge;

public Challenge[] challenges;
@@ -18,48 +18,50 @@ public class MissionControl : MonoBehaviour {

challengeList = new LinkedList<Challenge>();

for (int i = 0; i < challenges.Length; i++)
{
Challenge c = Instantiate(challenges[i]);
if (c == null)
{
Debug.Log("why u no work");
}
c.goalReached += C_goalReached;
c.failStateReached += C_failStateReached;
challengeList.AddLast(c);
for (int i = 0; i < challenges.Length; i++)
{
Challenge c = Instantiate(challenges[i]);
if (c == null)
{
Debug.Log("why u no work");
}
c.goalReached += C_goalReached;
c.failStateReached += C_failStateReached;
challengeList.AddLast(c);
}
currentChallenge = challengeList.First;
GameIsRunning = true;
currentChallenge.Value.StartChallenge();
}

private void AttemptNextChallenge()
{
Destroy(currentChallenge.Value);
currentChallenge = currentChallenge.Next;
// check if there are any more challenges
if (currentChallenge == null)
{
throw new NotImplementedException("TODO: NO MORE CHALLENGES");
}
else
{
currentChallenge.Value.StartChallenge();
}

}

private void C_failStateReached(object sender, EventArgs e)
{
throw new NotImplementedException("TODO: The Challenge has Failed -- TAKE DAMAGE OR END GAME");
}

private void C_goalReached(object sender, EventArgs e)
{
AttemptNextChallenge();
}

// Update is called once per frame
}

private void AttemptNextChallenge()
{
DestroyImmediate(currentChallenge.Value);
currentChallenge = currentChallenge.Next;
// check if there are any more challenges
if (currentChallenge == null)
{
throw new NotImplementedException("TODO: NO MORE CHALLENGES");
GameIsRunning = false;
}
else
{
currentChallenge.Value.StartChallenge();
}

}

private void C_failStateReached(object sender, EventArgs e)
{
throw new NotImplementedException("TODO: The Challenge has Failed -- TAKE DAMAGE OR END GAME");
}

private void C_goalReached(object sender, EventArgs e)
{
AttemptNextChallenge();
}

// Update is called once per frame
void Update () {

}
Empty file.
@@ -0,0 +1,33 @@
using UnityEngine;
using System.Collections;

public class OnTouchBehavior : MonoBehaviour {

public string targetName;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}

void OnCollisionEnter(Collision other)
{
if (other.gameObject.name == targetName)
{
Debug.Log("YESSSSS");
}
}

void OnTriggerEnter(Collider other)
{
if (other.name == targetName)
{
Debug.Log("YESSSSS");
}
}
}
@@ -1,23 +1,23 @@
using UnityEngine;
using System.Collections;

// example fail
public class TestFail : FailState
{

int test = 0;

public override bool CheckIfStateIsReached()
{
if (test == 10)
{
return true;
}
return false;
}

public void Update()
{
test++;
}
// example fail
public class TestFail : FailState
{

int test = 0;

public override bool CheckIfStateIsReached()
{
if (test == 10)
{
return true;
}
return false;
}

public void Update()
{
test++;
}
}
Empty file.
@@ -1,24 +1,24 @@
using UnityEngine;
using System.Collections;
using System;


// example goal
public class TestGoal : GoalState
{
int test = 0;

public override bool CheckIfStateIsReached()
{
if (test == 5)
{
return true;
}
return false;
}

public void Update()
{
test++;
}
using System;


// example goal
public class TestGoal : GoalState
{
int test = 0;

public override bool CheckIfStateIsReached()
{
if (test == 5)
{
return true;
}
return false;
}

public void Update()
{
test++;
}
}
Empty file.
@@ -0,0 +1,45 @@
using UnityEngine;
using System.Collections;
using System;

public class ThrowGoal : GoalState
{
public GameObject objectToThrow;
public GameObject targetObject;

public float distanceToThrowObject = 10f;

private Rigidbody targetRB;
private Rigidbody grabbedRB;

void Start()
{
objectToThrow = GameObject.Find(objectToThrow.name);
if (targetObject != null)
{
targetObject = GameObject.Find(targetObject.name);
targetRB = targetObject.GetComponent<Rigidbody>();
grabbedRB = objectToThrow.GetComponent<Rigidbody>();
}
}

public override bool CheckIfStateIsReached()
{
// We have a target that must we must throw something at
if (targetObject != null)
{
// TODO: target throw not implemented
// what if mulitple objects to throw?

}
else // otherwise throw an object away a certain distance
{
float distance = Vector3.Distance(objectToThrow.transform.position, Camera.main.transform.position);
if (distance >= distanceToThrowObject)
{
return true;
}
}
return false;
}
}
@@ -0,0 +1,29 @@
using System;
using UnityEngine;

public class TimeFail : FailState {

public float countdownTime = 30;

private float counter;

// TODO true if time has passed
public override bool CheckIfStateIsReached()
{
if (counter >= countdownTime)
{
return true;
}
return false;
}

// Use this for initialization
void Start () {
counter = 0;
}

void Update()
{
counter += Time.deltaTime;
}
}
@@ -11,6 +11,7 @@ public class SixenseHand : MonoBehaviour
{
public SixenseHands m_hand;
public SixenseInput.Controller m_controller = null;
public float moveSpeed;

//Animator m_animator;
Vector3 LVelocity, RVelocity;
@@ -125,8 +126,36 @@ public Vector3 InitialPosition

void OnTriggerStay(Collider col)
{

GameObject LObject, RObject;

if (LTrig && gameObject.name == "left" && col.tag == "Throwable")
{
LObject = col.gameObject;

Vector3 dist = gameObject.transform.position - LObject.transform.position;

LObject.GetComponent<Rigidbody>().AddForce(dist * moveSpeed);
LObject.transform.rotation = gameObject.transform.rotation;
LObject.GetComponent<Rigidbody>().velocity = LVelocity / 750;
}

if (RTrig && gameObject.name == "right" && col.tag == "Throwable")
{
RObject = col.gameObject;

Vector3 dist = gameObject.transform.position - RObject.transform.position;

}
RObject.GetComponent<Rigidbody>().AddForce(dist * moveSpeed);
RObject.transform.rotation = gameObject.transform.rotation;
RObject.GetComponent<Rigidbody>().velocity = RVelocity / 750;

}

//print("name : " + gameObject.name);
}

}



@@ -57,6 +57,12 @@
<Reference Include="UnityEngine.Networking">
<HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>Library\UnityAssemblies\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEditor">
<HintPath>Library\UnityAssemblies\UnityEditor.dll</HintPath>
</Reference>
@@ -65,8 +71,11 @@
<Compile Include="Assets\Scripts\Challenge.cs" />
<Compile Include="Assets\Scripts\GameObjectiveState.cs" />
<Compile Include="Assets\Scripts\MissionControl.cs" />
<Compile Include="Assets\Scripts\OnTouchBehavior.cs" />
<Compile Include="Assets\Scripts\TestFail.cs" />
<Compile Include="Assets\Scripts\TestGoal.cs" />
<Compile Include="Assets\Scripts\ThrowGoal.cs" />
<Compile Include="Assets\Scripts\TimeFail.cs" />
<Compile Include="Assets\SixenseInput\DemoScenes\Scripts\SixenseHand.cs" />
<Compile Include="Assets\SixenseInput\DemoScenes\Scripts\SixenseHandsController.cs" />
<Compile Include="Assets\SixenseInput\DemoScenes\Scripts\SixenseInputTest.cs" />
Binary file not shown.
Binary file not shown.
@@ -95,7 +95,7 @@ PlayerSettings:
metroEnableIndependentInputSource: 0
metroEnableLowLatencyPresentationAPI: 0
xboxOneDisableKinectGpuReservation: 0
virtualRealitySupported: 1
virtualRealitySupported: 0
productGUID: 0a8f77ae35878814c9fcf9ecfbdb8deb
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 9
@@ -418,14 +418,34 @@ PlayerSettings:
intPropertyNames:
- Android::ScriptingBackend
- Standalone::ScriptingBackend
- WebGL::ScriptingBackend
- WebGL::audioCompressionFormat
- WebGL::exceptionSupport
- WebGL::memorySize
- WebPlayer::ScriptingBackend
Android::ScriptingBackend: 0
Standalone::ScriptingBackend: 0
WebGL::ScriptingBackend: 1
WebGL::audioCompressionFormat: 4
WebGL::exceptionSupport: 1
WebGL::memorySize: 256
WebPlayer::ScriptingBackend: 0
boolPropertyNames:
- WebGL::analyzeBuildSize
- WebGL::dataCaching
- WebGL::useEmbeddedResources
- XboxOne::enus
WebGL::analyzeBuildSize: 0
WebGL::dataCaching: 0
WebGL::useEmbeddedResources: 0
XboxOne::enus: 1
stringPropertyNames: []
stringPropertyNames:
- WebGL::emscriptenArgs
- WebGL::template
- additionalIl2CppArgs::additionalIl2CppArgs
WebGL::emscriptenArgs:
WebGL::template: APPLICATION:Default
additionalIl2CppArgs::additionalIl2CppArgs:
cloudProjectId:
projectName:
organizationId:
Binary file not shown.
Binary file not shown.
BIN +1.77 KB (100%) HackerMan/Library/assetDatabase3
Binary file not shown.
BIN -12 Bytes (100%) HackerMan/Library/expandedItems
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -95,7 +95,7 @@ PlayerSettings:
metroEnableIndependentInputSource: 0
metroEnableLowLatencyPresentationAPI: 0
xboxOneDisableKinectGpuReservation: 0
virtualRealitySupported: 1
virtualRealitySupported: 0
productGUID: 0a8f77ae35878814c9fcf9ecfbdb8deb
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 9
@@ -418,14 +418,34 @@ PlayerSettings:
intPropertyNames:
- Android::ScriptingBackend
- Standalone::ScriptingBackend
- WebGL::ScriptingBackend
- WebGL::audioCompressionFormat
- WebGL::exceptionSupport
- WebGL::memorySize
- WebPlayer::ScriptingBackend
Android::ScriptingBackend: 0
Standalone::ScriptingBackend: 0
WebGL::ScriptingBackend: 1
WebGL::audioCompressionFormat: 4
WebGL::exceptionSupport: 1
WebGL::memorySize: 256
WebPlayer::ScriptingBackend: 0
boolPropertyNames:
- WebGL::analyzeBuildSize
- WebGL::dataCaching
- WebGL::useEmbeddedResources
- XboxOne::enus
WebGL::analyzeBuildSize: 0
WebGL::dataCaching: 0
WebGL::useEmbeddedResources: 0
XboxOne::enus: 1
stringPropertyNames: []
stringPropertyNames:
- WebGL::emscriptenArgs
- WebGL::template
- additionalIl2CppArgs::additionalIl2CppArgs
WebGL::emscriptenArgs:
WebGL::template: APPLICATION:Default
additionalIl2CppArgs::additionalIl2CppArgs:
cloudProjectId:
projectName:
organizationId:
@@ -3,7 +3,8 @@
--- !u!78 &1
TagManager:
serializedVersion: 2
tags: []
tags:
- Throwable
layers:
- Default
- TransparentFX