Commit 6c8c4d26 authored by astatham's avatar astatham
Browse files

Trying to get angle needle to start moving again to allow more than one pie to...

Trying to get angle needle to start moving again to allow more than one pie to be thrown, not working yet
parent 2bc1328b
......@@ -440,6 +440,46 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 53f76b8adcf2348e3a73cf1343cb10e5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &510235118
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 510235120}
- component: {fileID: 510235119}
m_Layer: 0
m_Name: PieMaster
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &510235119
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 510235118}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: da61e2cfda3fd4ded8570cfe5faa780b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &510235120
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 510235118}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.09692616, y: 0.35025632, z: -0.024424091}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &907546174
GameObject:
m_ObjectHideFlags: 0
......@@ -672,9 +712,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b597bcc6073264a21ae9168e77f78b21, type: 3}
m_Name:
m_EditorClassIdentifier:
angleChangeSpeed: 10
maxAngle: 90
minAngle: 0
--- !u!212 &1048895979
SpriteRenderer:
m_ObjectHideFlags: 0
......
......@@ -3,9 +3,11 @@ using System.Collections.Generic;
using UnityEngine;
public class Needle : MonoBehaviour {
public float angleChangeSpeed, maxAngle, minAngle;
float currentAngle = 0;
float previousAngle = -1f;
public static float angleChangeSpeed = 20;
public static float maxAngle = 90f;
public static float minAngle = 0;
public static float currentAngle = 0;
public static float previousAngle = -1f;
public static float finalAngle;
void Update()
......@@ -36,8 +38,14 @@ public class Needle : MonoBehaviour {
}
if (Input.GetKeyDown("space")){
finalAngle = currentAngle;
previousAngle = currentAngle;
angleChangeSpeed = 0;
PowerBar.previousPos = -9f;
}
}
public static void ResetAngles()
{
angleChangeSpeed = 20;
}
}
......@@ -12,8 +12,9 @@ public class Pie : MonoBehaviour {
private void OnTriggerEnter2D(Collider2D collision)
{
print("Blah");
PieManager.pieInScene = false;
PieManager.start = false;
Destroy(gameObject);
}
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PieManager : MonoBehaviour {
public static int pieCount = 3;
public static bool pieInScene = false;
public static bool start = true;
private void Update()
{
if (pieCount > 0 && !pieInScene && !start){
print("Bleh");
Needle.ResetAngles();
}
}
}
fileFormatVersion: 2
guid: da61e2cfda3fd4ded8570cfe5faa780b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment