Commit 86a15e6f authored by Sebastian's avatar Sebastian

Merge branch 'master' of gitlab.fsi.hochschule-trier.de:GameDevWeek/ws-18_19/unity/suck-it

merge into master
parents 03809be5 b54608a9
This diff is collapsed.
This diff is collapsed.
fileFormatVersion: 2
guid: 32561bea78ffe5941b1379159c0b43b2
guid: 402871cf6f60f0b4398268f7095604a0
DefaultImporter:
externalObjects: {}
userData:
......
......@@ -6,12 +6,10 @@ public class isHittingWall : MonoBehaviour
{
private void OnTriggerEnter2D(Collider2D collision)
{
Debug.Log(collision.gameObject.layer + "stuff"+ LayerMask.NameToLayer("Ground"));
if (!(collision.gameObject.layer == LayerMask.NameToLayer("Ground") || collision.gameObject.layer == LayerMask.NameToLayer("Enemy")))
if (collision.gameObject.layer == LayerMask.NameToLayer("Ground") || collision.gameObject.layer == LayerMask.NameToLayer("Enemy"))
{
return;
this.GetComponentInParent<AI_WaterAttack>().turn();
}
this.GetComponentInParent<AI_WaterAttack>().turn();
}
//private void OnCollisionEnter2D(Collision2D collision)
......
......@@ -17,7 +17,8 @@ public class AI_WaterAttack : WeightedAction
void Start()
{
myAI = GetComponent<AI_Core>();
}
movingRight = true;
}
void CheckConditions()
{
......@@ -30,11 +31,12 @@ public class AI_WaterAttack : WeightedAction
RaycastHit2D groundInfo = Physics2D.Raycast(groundDetection.position, Vector3.down, distance, 1<<LayerMask.NameToLayer("Ground"));
if (groundInfo.collider == false)
if (!groundInfo.collider == false)
{
turn();
if(!groundInfo.collider.gameObject.CompareTag("Moving")) return;
}
}
turn();
}
public void turn()
{
......
......@@ -8,7 +8,7 @@ using UnityEngine.UI;
public class SavePoint : MonoBehaviour
{
private bool isUsed;
private Transform options;
public GameObject options;
public Button button;
private Animator anim;
......@@ -17,17 +17,17 @@ public class SavePoint : MonoBehaviour
isUsed = false;
button.interactable = false;
anim = GetComponent<Animator>();
//options = gameObject.transform.Find("Options");
Debug.Log(options);
}
public void OnTriggerEnter2D(Collider2D other)
{
//options.gameObject.SetActive(true);
options.gameObject.SetActive(true);
}
public void OnTriggerExit2D(Collider2D other)
{
//options.gameObject.SetActive(false);
options.gameObject.SetActive(false);
}
public void OnTriggerStay2D(Collider2D collision)
......
......@@ -14,6 +14,7 @@ TagManager:
- EnemyShot
- DestroyableByFire
- Interactive
- Moving
layers:
- Default
- TransparentFX
......
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