diff --git a/Greta/Assets/BoeseOmaAnimation.cs b/Greta/Assets/BoeseOmaAnimation.cs index cc79c6ca7ee5f37f981d192e73133da9de39cf7d..4598689daf631869268e1cc999e94dfc4c4894e5 100644 --- a/Greta/Assets/BoeseOmaAnimation.cs +++ b/Greta/Assets/BoeseOmaAnimation.cs @@ -16,7 +16,8 @@ public class BoeseOmaAnimation : MonoBehaviour // Update is called once per frame void Update() { - + /* see stevezuckt.cs for more informations + */ if (this.GetComponent<Entity>().dialogueInitiated) { currentAnimationState = "DameSprechend"; diff --git a/Greta/Assets/JonathanZuckt.cs b/Greta/Assets/JonathanZuckt.cs index 6feeed3bd274c29f412b49dc40cada034886eb8b..b79da17edda1358ec4366aae136d87d80029a326 100644 --- a/Greta/Assets/JonathanZuckt.cs +++ b/Greta/Assets/JonathanZuckt.cs @@ -17,6 +17,9 @@ public class JonathanZuckt : MonoBehaviour // Update is called once per frame void Update() { + + /* see stevezuckt.cs for more informations + */ if (this.GetComponent<Entity>().dialogueInitiated) { currentAnimationState = "IdleGiraffe"; diff --git a/Greta/Assets/JosieAnimation.cs b/Greta/Assets/JosieAnimation.cs index 436c71b91e5bfe76943a0f8542b440cfd918e0e1..7ef62146436e33c19f495a7f38942aa163c57e87 100644 --- a/Greta/Assets/JosieAnimation.cs +++ b/Greta/Assets/JosieAnimation.cs @@ -18,6 +18,8 @@ public class JosieAnimation : MonoBehaviour void Update() { + /* see stevezuckt.cs for more informations + */ if (this.GetComponent<Entity>().dialogueInitiated) { currentAnimationState = "BoxerinSprechend"; diff --git a/Greta/Assets/KatzenbesitzerinAnimation.cs b/Greta/Assets/KatzenbesitzerinAnimation.cs index c63366f7945195ab12d592b221d9b6ba5fbd5784..fdf0002dc314e58e3e0583d1411cad2fbae5e787 100644 --- a/Greta/Assets/KatzenbesitzerinAnimation.cs +++ b/Greta/Assets/KatzenbesitzerinAnimation.cs @@ -17,6 +17,8 @@ public class KatzenbesitzerinAnimation : MonoBehaviour void Update() { + /* see stevezuckt.cs for more informations + */ if (this.GetComponent<Entity>().dialogueInitiated) { currentAnimationState = "speakCat"; diff --git a/Greta/Assets/OnClick.cs b/Greta/Assets/OnClick.cs index 0670c5acada85f19a9facbfe6f71b5abebfd47ea..593c33a47673a99cec31ecf2bc3831a878a92c1c 100644 --- a/Greta/Assets/OnClick.cs +++ b/Greta/Assets/OnClick.cs @@ -4,6 +4,8 @@ using UnityEngine; public class OnClick : MonoBehaviour { + /*this script is used for the Schwarzblende + */ public GameObject Sprite; // Start is called before the first frame update void Start() @@ -14,7 +16,6 @@ public class OnClick : MonoBehaviour // Update is called once per frame void Update() { - Debug.Log("Danach bring ich mich um"); var blende = GameObject.Find("Schwarzblende (1)"); var Player = GameObject.Find("Player"); var GameManager = GameObject.Find("GameManager"); diff --git a/Greta/Assets/OpaAnimation.cs b/Greta/Assets/OpaAnimation.cs index fb2dfa90d288156cfa6e8f05767818fb5a4ecb8c..232ddefeca4ff5894e5871d8adfaea049ca42879 100644 --- a/Greta/Assets/OpaAnimation.cs +++ b/Greta/Assets/OpaAnimation.cs @@ -12,9 +12,7 @@ public class OpaAnimation : MonoBehaviour private float stockAnimationTime = -1f; - // 0 = not triggered - // 1 = currently active - // 2 = forbids triggering + private int animationStateStock = 0; // Start is called before the first frame update @@ -26,9 +24,9 @@ public class OpaAnimation : MonoBehaviour // Update is called once per frame void Update() { - if (this.GetComponent<Entity>().dialogueInitiated)//&& this.GetComponent<Entity>().GetNodeIndex() != 3) //Database.core.entities[SupportFunctions.core.findEntityIndexById(entityID)].entityStageId != 5) + if (this.GetComponent<Entity>().dialogueInitiated) { - if (this.GetComponent<Entity>().nodeIndex == 2) //Database.core.entities[SupportFunctions.core.findEntityIndexById(entityID)].entityStageId == 6) + if (this.GetComponent<Entity>().nodeIndex == 2) { if (animationStateStock == 0) @@ -42,15 +40,13 @@ public class OpaAnimation : MonoBehaviour { currentAnimationState = "Sprechend"; skeletonAnimation.AnimationName = "Sprechend"; - Debug.Log("Das könnte funktionieren!"); //Clicked " + hit.transform.gameObject.name); } } - else //(this.GetComponent<Entity>().dialogueInitiated && Database.core.entities[SupportFunctions.core.findEntityIndexById(entityID)].entityStageId == 0) + else { currentAnimationState = "Schlafend"; skeletonAnimation.AnimationName = "Schlafend"; - Debug.Log("Opa schläft."); // Clicked " + hit.transform.gameObject.name); } if (animationStateStock == 1) @@ -58,22 +54,16 @@ public class OpaAnimation : MonoBehaviour reduceStockAnimation(); } - - - // HIER FEHLT NOCH DER STOCKSCHLAG - // erster CLick SChlafen - // zweiter Click SPrechen - // dritter Click Wurfanimation - //default Schlafen } + /*the last two methods change the time for how long each animation is played when triggered + */ private void startStockAnimation(float time) { stockAnimationTime = time; animationStateStock = 1; currentAnimationState = "StockSchlag"; skeletonAnimation.AnimationName = "StockSchlag"; - Debug.Log("Opa schlägt mit dem Stock"); } private void reduceStockAnimation() diff --git a/Greta/Assets/PAC Engine/Scripts/SteveZuckt.cs b/Greta/Assets/PAC Engine/Scripts/SteveZuckt.cs index d0ce14d18a7fd741bd69661eb4b7df5f81b88540..db374c6035bd5138043cd6d2437af699ffc08102 100644 --- a/Greta/Assets/PAC Engine/Scripts/SteveZuckt.cs +++ b/Greta/Assets/PAC Engine/Scripts/SteveZuckt.cs @@ -18,42 +18,21 @@ public class SteveZuckt : MonoBehaviour void Update() { - // if (Input.GetMouseButtonDown(0)) - //{ - Debug.Log("Steve zuckt Mouse Down"); - //Vector3 mousePos = Input.mousePosition; - //mousePos.z = 10; - - //Vector3 screenPos = Camera.main.ScreenToWorldPoint(mousePos); - - //RaycastHit2D hit = Physics2D.Raycast(screenPos, Vector2.zero); - //Vector2 point = Camera.main.ScreenToWorldPoint(Input.mousePosition); - //RaycastHit2D hit = Physics2D.Raycast(point, Vector2.zero, Mathf.Infinity, ~(1 << LayerMask.NameToLayer("MovementCatcher"))); - - //Debug.Log(hit.transform.gameObject.name); - //if (hit && hit.transform.gameObject.name.Equals("Krokodilbesitzer")) + Debug.Log("Steve zuckt Mouse Down"); + /* If-statement to check if our player talks to Steve. If yes --> The animation is + played. If not --> he will not be animated. + */ if(this.GetComponent<Entity>().dialogueInitiated) { currentAnimationState = "SteveAnprechen"; skeletonAnimation.AnimationName = "SteveAnprechen"; - Debug.Log("Das könnte funktionieren! "); //Clicked " + hit.transform.gameObject.name); } else { currentAnimationState = "<None>"; skeletonAnimation.AnimationName = "<None>"; - Debug.Log("Das funktioniert so nicht! "); // Clicked " + hit.transform.gameObject.name); } - // } } - //void OnMouseDown() - //{ - // skeletonAnimation.AnimationName = "SteveAnsprechen"; - // //currentAnimationState = "animation"; - // Debug.Log("HAllo, ich bin getriggered"); - - //} - } diff --git a/Greta/Assets/SchaffnerAnimation.cs b/Greta/Assets/SchaffnerAnimation.cs index 6e1cc667a036333254691bc0786eb402221095dd..c08d8e2ae40174853d4171943c04e61bda46f4ab 100644 --- a/Greta/Assets/SchaffnerAnimation.cs +++ b/Greta/Assets/SchaffnerAnimation.cs @@ -18,6 +18,8 @@ public class SchaffnerAnimation : MonoBehaviour void Update() { + /* see stevezuckt.cs for more informations + */ if (this.GetComponent<Entity>().dialogueInitiated) { currentAnimationState = "Zeigend"; diff --git a/README.md b/README.md index 45f01befda0c68e7daccac9903254a38260e35c3..7e170fe7a7bed118dc3099bac505ef255cf93e42 100644 --- a/README.md +++ b/README.md @@ -96,13 +96,13 @@ It is important to understand how the Plugin works to create good code. Especial If you want to use the progress of the game an important factor with the game play you will need to use the database. After you understand how it works it is quite handy to use it for simple tasks, e.g. changing the scenery (Our ChangeScenery.cs for example) or also to make workarounds possible. -Now I want to show what I mean. +Now I want to show what I mean. if (Database.core.entities[SupportFunctions.core.findEntityIndexById(entityID)].entityStageId == stage) { oldSprite.GetComponent<SpriteRenderer>().enabled = false; neueSprite.GetComponent<SpriteRenderer>().enabled = true; - + if (DestroyOnChange == true) { @@ -122,4 +122,3 @@ And last, this plugin was only updated once. Lisa and I saw some of its shortcom To find more information about Unity and how the basics work, click here: [https://docs.unity3d.com/2018.3/Documentation/Manual/UnityManual.html](https://docs.unity3d.com/2018.3/Documentation/Manual/UnityManual.html) -