1
Fork 0
slime-blood-and-pain/Assets/Scripts/Monster.cs

24 lines
445 B
C#
Raw Normal View History

2019-04-27 15:57:01 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Monster : MonoBehaviour
{
public int hpMax;
2019-04-27 20:19:35 +00:00
[AfterStartAttribute]
2019-04-27 15:57:01 +00:00
public int hp;
[BeforeStartAttribute]
public Sprite sprite;
2019-04-27 20:19:35 +00:00
private SpriteRenderer spriteRenderer;
2019-04-27 17:04:27 +00:00
private void Start()
2019-04-27 15:57:01 +00:00
{
2019-04-27 20:19:35 +00:00
spriteRenderer = GetComponent<SpriteRenderer>();
spriteRenderer.sprite = sprite;
hp = hpMax;
2019-04-27 15:57:01 +00:00
}
}