Refactored to ActionInvoker.cs
This commit is contained in:
parent
c06d161006
commit
afaddd940c
11 changed files with 189 additions and 214 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using DefaultNamespace;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Tiles {
|
||||
|
|
@ -7,20 +8,13 @@ namespace Tiles {
|
|||
private Sprite _sprite;
|
||||
public Sprite Sprite => _sprite;
|
||||
|
||||
protected GameObject _gameObject;
|
||||
|
||||
protected BaseTile(String pathToImageFile, GameObject gameObject) {
|
||||
_gameObject = gameObject;
|
||||
protected BaseTile(String pathToImageFile) {
|
||||
_sprite = GenerateSpriteFromFile(pathToImageFile);
|
||||
HouseController.NewDayEvent.AddListener(DayLightStep);
|
||||
}
|
||||
|
||||
public virtual void DayLightStep() { }
|
||||
|
||||
public virtual BaseTile Clicked(UsableItem usable) {
|
||||
return null;
|
||||
}
|
||||
|
||||
static public Sprite GenerateSpriteFromFile(String pathToImageFile) {
|
||||
byte[] data = File.ReadAllBytes(pathToImageFile);
|
||||
Texture2D texture = new Texture2D(32, 32, TextureFormat.ARGB32, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue