Commit 718c8167 authored by mmaluschnig's avatar mmaluschnig
Browse files

fixed animation in pie throwing

parent c907c842
<Properties StartupConfiguration="{67A4F128-F6AC-CD88-DA35-F29416A0792A}|">
<MonoDevelop.Ide.ItemProperties.Assembly-CSharp PreferredExecutionTarget="Unity.Editor" />
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/Scripts/MimeScripts/MimeMime.cs">
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/Scripts/PieScripts/PieTutorial.cs">
<Files>
<File FileName="Assets/Scripts/MimeScripts/SpawnKeys.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/MimeScripts/TriggerManager.cs" Line="143" Column="32" />
<File FileName="Assets/Scripts/MimeScripts/MimeMime.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/TrapezeScripts/TrapezeController.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/TrapezeScripts/TrapezePerson.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/TrapezeScripts/TrapezeTutorial.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/DaytimeScripts/CharacterSpeech/JohnSmithSpeech.cs" Line="100" Column="5" />
<File FileName="Assets/Scripts/TrapezeScripts/GenerateTrapezes.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/PieScripts/throwManager.cs" Line="44" Column="1" />
<File FileName="Assets/Scripts/PieScripts/PieTutorial.cs" Line="1" Column="1" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
......
......@@ -14,6 +14,12 @@ AnimatorController:
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
- m_Name: ResetThrow
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
......@@ -72,6 +78,30 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &1101564807554565124
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: ResetThrow
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102218952275480054}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &1102218952275480054
AnimatorState:
serializedVersion: 5
......@@ -139,7 +169,8 @@ AnimatorStateMachine:
m_State: {fileID: 1102942337200287226}
m_Position: {x: 372, y: 120, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_AnyStateTransitions:
- {fileID: 1101564807554565124}
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
......
......@@ -2190,7 +2190,7 @@ MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1407271054}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 62dcd6197646ba745a427bef4fee2474, type: 3}
m_Name:
......@@ -2202,6 +2202,7 @@ MonoBehaviour:
AngleBorder: {fileID: 53951142}
piePrefab: {fileID: 1202179348292156, guid: 39accd453c2c645ab81f09dc448b32c6, type: 2}
pieSpawn: {fileID: 1163067307}
hand: {fileID: 0}
--- !u!114 &1407271056
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -2816,6 +2817,34 @@ CanvasRenderer:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1718877379}
m_CullTransparentMesh: 0
--- !u!1 &1845103527
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1845103528}
m_Layer: 0
m_Name: Hand
m_TagString: Player
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1845103528
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1845103527}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.47999954, y: -0.40999985, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1911354534}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1911354532
GameObject:
m_ObjectHideFlags: 0
......@@ -2825,6 +2854,8 @@ GameObject:
m_Component:
- component: {fileID: 1911354534}
- component: {fileID: 1911354533}
- component: {fileID: 1911354536}
- component: {fileID: 1911354535}
m_Layer: 0
m_Name: clownDraft-1
m_TagString: Untagged
......@@ -2887,10 +2918,48 @@ Transform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -8.583075, y: -3.9202561, z: -0.9755759}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Children:
- {fileID: 1845103528}
m_Father: {fileID: 634434897}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!95 &1911354535
Animator:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1911354532}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: fe73ebc4f502f314097c12208a5df7cd, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!114 &1911354536
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1911354532}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 62dcd6197646ba745a427bef4fee2474, type: 3}
m_Name:
m_EditorClassIdentifier:
fillSpeed: 1
fillSmoothness: 0.01
powerBar: {fileID: 2133793784}
angleMeter: {fileID: 100312132}
AngleBorder: {fileID: 53951142}
piePrefab: {fileID: 1202179348292156, guid: 39accd453c2c645ab81f09dc448b32c6, type: 2}
pieSpawn: {fileID: 1163067307}
hand: {fileID: 1845103527}
--- !u!4 &1911399260
Transform:
m_ObjectHideFlags: 0
......
......@@ -36,7 +36,8 @@ public class PieTutorial : MonoBehaviour {
}
if (Input.GetKey(KeyCode.Space) && GameManager.TutorialState == 2)
{
if(powerBar.fillAmount > 0.5){
GameObject.FindWithTag("Player").GetComponentInParent<Animator>().SetBool("ResetThrow", false);
if (powerBar.fillAmount > 0.5){
canThrow = true;
SimonText.text = "GRR (Great! Now release it to fire the pie)";
}
......@@ -47,6 +48,8 @@ public class PieTutorial : MonoBehaviour {
progress();
powerPointer.gameObject.SetActive(false);
}else{
GameObject.FindWithTag("Player").GetComponentInParent<Animator>().SetBool("ResetThrow", true);
GameObject.FindWithTag("Player").transform.DetachChildren();
SimonText.text = "Grr (No you have to HOLD DOWN spaceBar to change power)";
}
}
......
......@@ -23,6 +23,8 @@ public class throwManager : MonoBehaviour {
private GameObject currentPie;
private bool shotPie;
private float angle;
// Use this for initialization
void Start () {
anim = GetComponent<Animator>();
......@@ -38,6 +40,7 @@ public class throwManager : MonoBehaviour {
if (Input.GetKeyDown(KeyCode.Space)) {
AngleState = PowerIncreasing;
PowerIncreasing = true;
angle = angleMeter.fillAmount;
}
if (Input.GetKeyUp(KeyCode.Space)) {
PowerIncreasing = AngleState;
......@@ -66,6 +69,7 @@ public class throwManager : MonoBehaviour {
//load pie into players hand
anim.SetBool("BeginThrow", true);
anim.speed = 1;
angle = angleMeter.fillAmount;
currentPie = Instantiate(piePrefab, hand.transform);
currentPie.GetComponent<Rigidbody2D>().bodyType = RigidbodyType2D.Static;
......@@ -98,7 +102,7 @@ public class throwManager : MonoBehaviour {
currentPie.GetComponent<Rigidbody2D>().bodyType = RigidbodyType2D.Dynamic;
currentPie.GetComponent<Pie>().force = powerBar.fillAmount;
currentPie.transform.parent.DetachChildren();
currentPie.transform.rotation = Quaternion.Euler(new Vector3(0, 0, (1 - angleMeter.fillAmount) * -90));
currentPie.transform.rotation = Quaternion.Euler(new Vector3(0, 0, (1 - angle) * -90));
currentPie.GetComponent<Pie>().Launch();
PieManager.pieInScene = true;
PieManager.pieCount--;
......
Markdown is supported
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