Changed how items work
This commit is contained in:
@@ -4,12 +4,9 @@ namespace Fruitomation.Game.Items
|
||||
{
|
||||
public class FruitBehaviour : ItemBehaviour
|
||||
{
|
||||
[SerializeField] private ItemType OverridenItemType;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Body2D.linearVelocity = Random.insideUnitCircle * 2.5f;
|
||||
CurrentType = OverridenItemType;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,19 +15,17 @@ namespace Fruitomation.Game.Items
|
||||
public ItemType CurrentType
|
||||
{
|
||||
get => InternalItemType;
|
||||
set
|
||||
{
|
||||
InternalItemType = value;
|
||||
}
|
||||
set => InternalItemType = value;
|
||||
}
|
||||
|
||||
protected virtual void OnInitialized() { }
|
||||
|
||||
public void InitBehaviour(Canvas canvas)
|
||||
|
||||
public void InitBehaviour(Canvas canvas, ItemType startType)
|
||||
{
|
||||
RectTransform = transform.GetComponent<RectTransform>();
|
||||
Body2D = transform.GetComponent<Rigidbody2D>();
|
||||
|
||||
InternalItemType = startType;
|
||||
AttachedCanvas = canvas;
|
||||
EnteredCanvas = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user