small fixes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user