Skip to content
Snippets Groups Projects
Commit ef9a8b4a authored by Meike Wienholt's avatar Meike Wienholt
Browse files

tried to coomment in Lisas scripts. I will later upload a .txt file about...

tried to coomment in Lisas scripts. I will later upload a .txt file about every component etc that is needed for the animations
parent dcc504d7
Branches master
No related tags found
No related merge requests found
...@@ -16,7 +16,8 @@ public class BoeseOmaAnimation : MonoBehaviour ...@@ -16,7 +16,8 @@ public class BoeseOmaAnimation : MonoBehaviour
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
/* see stevezuckt.cs for more informations
*/
if (this.GetComponent<Entity>().dialogueInitiated) if (this.GetComponent<Entity>().dialogueInitiated)
{ {
currentAnimationState = "DameSprechend"; currentAnimationState = "DameSprechend";
......
...@@ -17,6 +17,9 @@ public class JonathanZuckt : MonoBehaviour ...@@ -17,6 +17,9 @@ public class JonathanZuckt : MonoBehaviour
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
/* see stevezuckt.cs for more informations
*/
if (this.GetComponent<Entity>().dialogueInitiated) if (this.GetComponent<Entity>().dialogueInitiated)
{ {
currentAnimationState = "IdleGiraffe"; currentAnimationState = "IdleGiraffe";
......
...@@ -18,6 +18,8 @@ public class JosieAnimation : MonoBehaviour ...@@ -18,6 +18,8 @@ public class JosieAnimation : MonoBehaviour
void Update() void Update()
{ {
/* see stevezuckt.cs for more informations
*/
if (this.GetComponent<Entity>().dialogueInitiated) if (this.GetComponent<Entity>().dialogueInitiated)
{ {
currentAnimationState = "BoxerinSprechend"; currentAnimationState = "BoxerinSprechend";
......
...@@ -17,6 +17,8 @@ public class KatzenbesitzerinAnimation : MonoBehaviour ...@@ -17,6 +17,8 @@ public class KatzenbesitzerinAnimation : MonoBehaviour
void Update() void Update()
{ {
/* see stevezuckt.cs for more informations
*/
if (this.GetComponent<Entity>().dialogueInitiated) if (this.GetComponent<Entity>().dialogueInitiated)
{ {
currentAnimationState = "speakCat"; currentAnimationState = "speakCat";
......
...@@ -4,6 +4,8 @@ using UnityEngine; ...@@ -4,6 +4,8 @@ using UnityEngine;
public class OnClick : MonoBehaviour public class OnClick : MonoBehaviour
{ {
/*this script is used for the Schwarzblende
*/
public GameObject Sprite; public GameObject Sprite;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
...@@ -14,7 +16,6 @@ public class OnClick : MonoBehaviour ...@@ -14,7 +16,6 @@ public class OnClick : MonoBehaviour
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
Debug.Log("Danach bring ich mich um");
var blende = GameObject.Find("Schwarzblende (1)"); var blende = GameObject.Find("Schwarzblende (1)");
var Player = GameObject.Find("Player"); var Player = GameObject.Find("Player");
var GameManager = GameObject.Find("GameManager"); var GameManager = GameObject.Find("GameManager");
......
...@@ -12,9 +12,7 @@ public class OpaAnimation : MonoBehaviour ...@@ -12,9 +12,7 @@ public class OpaAnimation : MonoBehaviour
private float stockAnimationTime = -1f; private float stockAnimationTime = -1f;
// 0 = not triggered
// 1 = currently active
// 2 = forbids triggering
private int animationStateStock = 0; private int animationStateStock = 0;
// Start is called before the first frame update // Start is called before the first frame update
...@@ -26,9 +24,9 @@ public class OpaAnimation : MonoBehaviour ...@@ -26,9 +24,9 @@ public class OpaAnimation : MonoBehaviour
// Update is called once per frame // Update is called once per frame
void Update() 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) if (animationStateStock == 0)
...@@ -42,15 +40,13 @@ public class OpaAnimation : MonoBehaviour ...@@ -42,15 +40,13 @@ public class OpaAnimation : MonoBehaviour
{ {
currentAnimationState = "Sprechend"; currentAnimationState = "Sprechend";
skeletonAnimation.AnimationName = "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"; currentAnimationState = "Schlafend";
skeletonAnimation.AnimationName = "Schlafend"; skeletonAnimation.AnimationName = "Schlafend";
Debug.Log("Opa schläft."); // Clicked " + hit.transform.gameObject.name);
} }
if (animationStateStock == 1) if (animationStateStock == 1)
...@@ -58,22 +54,16 @@ public class OpaAnimation : MonoBehaviour ...@@ -58,22 +54,16 @@ public class OpaAnimation : MonoBehaviour
reduceStockAnimation(); 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) private void startStockAnimation(float time)
{ {
stockAnimationTime = time; stockAnimationTime = time;
animationStateStock = 1; animationStateStock = 1;
currentAnimationState = "StockSchlag"; currentAnimationState = "StockSchlag";
skeletonAnimation.AnimationName = "StockSchlag"; skeletonAnimation.AnimationName = "StockSchlag";
Debug.Log("Opa schlägt mit dem Stock");
} }
private void reduceStockAnimation() private void reduceStockAnimation()
......
...@@ -18,42 +18,21 @@ public class SteveZuckt : MonoBehaviour ...@@ -18,42 +18,21 @@ public class SteveZuckt : MonoBehaviour
void Update() 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) if(this.GetComponent<Entity>().dialogueInitiated)
{ {
currentAnimationState = "SteveAnprechen"; currentAnimationState = "SteveAnprechen";
skeletonAnimation.AnimationName = "SteveAnprechen"; skeletonAnimation.AnimationName = "SteveAnprechen";
Debug.Log("Das könnte funktionieren! "); //Clicked " + hit.transform.gameObject.name);
} }
else else
{ {
currentAnimationState = "<None>"; currentAnimationState = "<None>";
skeletonAnimation.AnimationName = "<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");
//}
} }
...@@ -18,6 +18,8 @@ public class SchaffnerAnimation : MonoBehaviour ...@@ -18,6 +18,8 @@ public class SchaffnerAnimation : MonoBehaviour
void Update() void Update()
{ {
/* see stevezuckt.cs for more informations
*/
if (this.GetComponent<Entity>().dialogueInitiated) if (this.GetComponent<Entity>().dialogueInitiated)
{ {
currentAnimationState = "Zeigend"; currentAnimationState = "Zeigend";
......
...@@ -96,13 +96,13 @@ It is important to understand how the Plugin works to create good code. Especial ...@@ -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. 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) if (Database.core.entities[SupportFunctions.core.findEntityIndexById(entityID)].entityStageId == stage)
{ {
oldSprite.GetComponent<SpriteRenderer>().enabled = false; oldSprite.GetComponent<SpriteRenderer>().enabled = false;
neueSprite.GetComponent<SpriteRenderer>().enabled = true; neueSprite.GetComponent<SpriteRenderer>().enabled = true;
if (DestroyOnChange == true) if (DestroyOnChange == true)
{ {
...@@ -122,4 +122,3 @@ And last, this plugin was only updated once. Lisa and I saw some of its shortcom ...@@ -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: 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) [https://docs.unity3d.com/2018.3/Documentation/Manual/UnityManual.html](https://docs.unity3d.com/2018.3/Documentation/Manual/UnityManual.html)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment