small fixes

This commit is contained in:
joonasp
2022-05-16 17:47:54 +03:00
parent 9a104a8bd3
commit 86d16e0cf2
23 changed files with 11245 additions and 9795 deletions

View File

@@ -28,25 +28,26 @@ public class CuttableTree : MonoBehaviour
{
if (other.tag == "Cutter")
{
rotation = transform.rotation;
rotation *= Quaternion.AngleAxis(20, Vector3.up);
Instantiate(stumpPrefab, transform.position, rotation);
Instantiate(logPrefab, transform.position + new Vector3(0, 1, 0), rotation);
onCut.Invoke();
Destroy(gameObject);
Cut();
}
}
void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == "Cutter")
{
rotation = transform.rotation;
rotation *= Quaternion.AngleAxis(20, Vector3.up);
Instantiate(stumpPrefab, transform.position, rotation);
Instantiate(logPrefab, transform.position + new Vector3(0, 1, 0), rotation);
onCut.Invoke();
Destroy(gameObject);
Cut();
}
}
public void Cut()
{
Debug.LogWarning("CUT");
rotation = transform.rotation;
rotation *= Quaternion.AngleAxis(20, Vector3.up);
Instantiate(stumpPrefab, transform.position, rotation);
Instantiate(logPrefab, transform.position + new Vector3(0, 1, 0), rotation);
onCut.Invoke();
Destroy(gameObject);
}
}

View File

@@ -29,7 +29,7 @@ public class SlimeAI : MonoBehaviour
{
animator = GetComponent<Animator>();
player = GameObject.FindWithTag("Player");
HP = 0;
HP = 5;
}
@@ -141,6 +141,7 @@ public class SlimeAI : MonoBehaviour
{
yield return new WaitForSeconds(0.2f);
Debug.Log("Attack");
PlayerInfo.Instance.AddHealth(-1);
//do attack e.g check for player in range/hit collider
}