log creation
This commit is contained in:
@@ -7,6 +7,7 @@ public class CuttableTree : MonoBehaviour
|
||||
{
|
||||
private Quaternion rotation;
|
||||
public GameObject stumpPrefab;
|
||||
public GameObject logPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private UnityEvent onCut;
|
||||
@@ -30,8 +31,9 @@ public class CuttableTree : MonoBehaviour
|
||||
rotation = transform.rotation;
|
||||
rotation *= Quaternion.AngleAxis(20, Vector3.up);
|
||||
Instantiate(stumpPrefab, transform.position, rotation);
|
||||
Destroy(gameObject);
|
||||
Instantiate(logPrefab, transform.position+new Vector3(0, 1, 0), rotation);
|
||||
onCut.Invoke();
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user