Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
8211a11c2c
9 changed files with 33 additions and 75 deletions
|
|
@ -12,7 +12,6 @@ GameObject:
|
||||||
- component: {fileID: 4752245148499717902}
|
- component: {fileID: 4752245148499717902}
|
||||||
- component: {fileID: 4752245148499717903}
|
- component: {fileID: 4752245148499717903}
|
||||||
- component: {fileID: 4752245148499717900}
|
- component: {fileID: 4752245148499717900}
|
||||||
- component: {fileID: 7967442993183754557}
|
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: BaseTile
|
m_Name: BaseTile
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -73,10 +72,10 @@ SpriteRenderer:
|
||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
m_SortingLayerID: -2016319409
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 1
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
m_Sprite: {fileID: 21300000, guid: 2700e06d970d112489ff23cfb58c3f78, type: 3}
|
m_Sprite: {fileID: 0}
|
||||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
m_FlipX: 0
|
m_FlipX: 0
|
||||||
m_FlipY: 0
|
m_FlipY: 0
|
||||||
|
|
@ -84,7 +83,7 @@ SpriteRenderer:
|
||||||
m_Size: {x: 1, y: 1}
|
m_Size: {x: 1, y: 1}
|
||||||
m_AdaptiveModeThreshold: 0.5
|
m_AdaptiveModeThreshold: 0.5
|
||||||
m_SpriteTileMode: 0
|
m_SpriteTileMode: 0
|
||||||
m_WasSpriteAssigned: 1
|
m_WasSpriteAssigned: 0
|
||||||
m_MaskInteraction: 0
|
m_MaskInteraction: 0
|
||||||
m_SpriteSortPoint: 0
|
m_SpriteSortPoint: 0
|
||||||
--- !u!61 &4752245148499717903
|
--- !u!61 &4752245148499717903
|
||||||
|
|
@ -125,18 +124,3 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 3fd8bc1d313319d4f89f11548ccb1b6a, type: 3}
|
m_Script: {fileID: 11500000, guid: 3fd8bc1d313319d4f89f11548ccb1b6a, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
--- !u!114 &7967442993183754557
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 4752245148499717901}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: ae14b865b73e45c5b15efb9484f9cae2, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
GrassTileSprite: {fileID: 21300002, guid: 2700e06d970d112489ff23cfb58c3f78, type: 3}
|
|
||||||
FarmlandTileSprite: {fileID: 21300016, guid: 2700e06d970d112489ff23cfb58c3f78, type: 3}
|
|
||||||
WheatSprite: {fileID: 21300078, guid: 2700e06d970d112489ff23cfb58c3f78, type: 3}
|
|
||||||
|
|
|
||||||
|
|
@ -6509,11 +6509,7 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: bc5eb8967b8912c42b93a2086383ddd9, type: 3}
|
m_Script: {fileID: 11500000, guid: bc5eb8967b8912c42b93a2086383ddd9, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
startItems:
|
startItems: []
|
||||||
- {fileID: 11400000, guid: 008a8fdd2c3a95745acafee4087a855d, type: 2}
|
|
||||||
- {fileID: 11400000, guid: 430db451ae959f34b8fba8d8b17276fd, type: 2}
|
|
||||||
- {fileID: 11400000, guid: d651d57ba97a4246a0094409e29fe56a, type: 2}
|
|
||||||
- {fileID: 11400000, guid: bb9777a7d5804bd6bf25d5510206aaf0, type: 2}
|
|
||||||
--- !u!1001 &1701153146
|
--- !u!1001 &1701153146
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -6756,7 +6752,7 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
startMoney: 10000
|
startMoney: 10000
|
||||||
moneyTextMeshProUGUI: {fileID: 1347709342}
|
moneyTextMeshProUGUI: {fileID: 0}
|
||||||
--- !u!4 &1800469990
|
--- !u!4 &1800469990
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,11 @@ public class Crop
|
||||||
private bool _markedForDeletion;
|
private bool _markedForDeletion;
|
||||||
public bool MarkedForDeletion => _markedForDeletion;
|
public bool MarkedForDeletion => _markedForDeletion;
|
||||||
|
|
||||||
|
private bool _dead;
|
||||||
|
public bool IsDead => _dead;
|
||||||
|
|
||||||
|
private bool _hydrated;
|
||||||
|
|
||||||
private int _daysGrown;
|
private int _daysGrown;
|
||||||
|
|
||||||
public Crop()
|
public Crop()
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ public class TileBehaviour : MonoBehaviour
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
Debug.Log("Created");
|
|
||||||
SetTile(new GrassTile());
|
SetTile(new GrassTile());
|
||||||
|
|
||||||
HouseController.NewDayEvent.AddListener(_tile.DayLightStep);
|
HouseController.NewDayEvent.AddListener(_tile.DayLightStep);
|
||||||
|
|
@ -22,8 +21,6 @@ public class TileBehaviour : MonoBehaviour
|
||||||
|
|
||||||
void OnMouseDown()
|
void OnMouseDown()
|
||||||
{
|
{
|
||||||
Debug.Log("Clicked");
|
|
||||||
|
|
||||||
UsableItem usable = null;
|
UsableItem usable = null;
|
||||||
BaseTile tileToSetTo = null;
|
BaseTile tileToSetTo = null;
|
||||||
|
|
||||||
|
|
@ -42,9 +39,8 @@ public class TileBehaviour : MonoBehaviour
|
||||||
|
|
||||||
void SetTile(BaseTile tileToSet)
|
void SetTile(BaseTile tileToSet)
|
||||||
{
|
{
|
||||||
Debug.Log("Set tile to " + tileToSet.ToString());
|
|
||||||
_tile = tileToSet;
|
_tile = tileToSet;
|
||||||
Debug.Log(_tile.Sprite);
|
Debug.Log(_tile.Sprite);
|
||||||
GetComponent<SpriteRenderer>().sprite = _tile.Sprite; // TODO: Change to Sprite
|
GetComponent<SpriteRenderer>().sprite = _tile.Sprite;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
using System;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace DefaultNamespace
|
|
||||||
{
|
|
||||||
public class TileSpriteContainer : MonoBehaviour
|
|
||||||
{
|
|
||||||
public static Sprite GrassTileSprite;
|
|
||||||
public static Sprite FarmlandTileSprite;
|
|
||||||
public static Sprite WheatSprite;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: ae14b865b73e45c5b15efb9484f9cae2
|
|
||||||
timeCreated: 1654172944
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Tiles
|
namespace Tiles
|
||||||
{
|
{
|
||||||
public abstract class BaseTile
|
public abstract class BaseTile
|
||||||
{
|
{
|
||||||
protected Color color;
|
private Sprite _sprite;
|
||||||
public Color getColor => color;
|
public Sprite Sprite => _sprite;
|
||||||
// TODO: Change to Sprite, also in subclasses
|
|
||||||
public Sprite Sprite;
|
|
||||||
|
|
||||||
protected BaseTile(Sprite sprite)
|
protected BaseTile(String pathToImageFile)
|
||||||
{
|
{
|
||||||
this.Sprite = sprite;
|
this._sprite = GenerateSpriteFromFile(pathToImageFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void Start()
|
protected void Start()
|
||||||
|
|
@ -34,11 +34,16 @@ namespace Tiles
|
||||||
Debug.Log(usable.ToString() + " used on " + this.ToString());
|
Debug.Log(usable.ToString() + " used on " + this.ToString());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
static protected Sprite GenerateSpriteFromFile()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
static protected Sprite GenerateSpriteFromFile(String pathToImageFile)
|
||||||
|
{
|
||||||
|
byte[] data = System.IO.File.ReadAllBytes(pathToImageFile);
|
||||||
|
Texture2D texture = new Texture2D(32, 32, TextureFormat.ARGB32, false);
|
||||||
|
texture.LoadImage(data);
|
||||||
|
Sprite sprite = Sprite.Create(texture, new Rect(0.0f, 0.0f, texture.width, texture.height), new Vector2(0.5f, 0.5f), 32);
|
||||||
|
Debug.Log(sprite);
|
||||||
|
return sprite;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,30 +1,18 @@
|
||||||
using DefaultNamespace;
|
using UnityEngine;
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace Tiles
|
namespace Tiles
|
||||||
{
|
{
|
||||||
public class FarmlandTile : BaseTile
|
public class FarmlandTile : BaseTile
|
||||||
{
|
{
|
||||||
private Crop _crop;
|
private Crop _crop;
|
||||||
private bool _hydrated;
|
|
||||||
|
|
||||||
public FarmlandTile() : base(TileSpriteContainer.FarmlandTileSprite)
|
public FarmlandTile() : base("Assets/Farming Asset Pack/Split Assets/farming_tileset_008.png")
|
||||||
{
|
{
|
||||||
_crop = null;
|
_crop = null;
|
||||||
_hydrated = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public new void DayLightStep()
|
public new void DayLightStep()
|
||||||
{
|
{
|
||||||
if (_crop != null)
|
|
||||||
{
|
|
||||||
_crop.DayLightStep(_hydrated);
|
|
||||||
if (_crop.MarkedForDeletion)
|
|
||||||
{
|
|
||||||
Debug.Log("Farmland crop deleted");
|
|
||||||
_crop = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public new BaseTile Clicked(UsableItem usable)
|
public new BaseTile Clicked(UsableItem usable)
|
||||||
|
|
@ -36,7 +24,7 @@ namespace Tiles
|
||||||
if (usable.id == ic.GetItemIdByName("Hoe"))
|
if (usable.id == ic.GetItemIdByName("Hoe"))
|
||||||
{
|
{
|
||||||
Debug.Log("Farmland hydrated");
|
Debug.Log("Farmland hydrated");
|
||||||
_hydrated = true;
|
//_hydrated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usable.id == ic.GetItemIdByName("Wheat Seed") && _crop == null)
|
if (usable.id == ic.GetItemIdByName("Wheat Seed") && _crop == null)
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
using DefaultNamespace;
|
using UnityEngine;
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace Tiles
|
namespace Tiles
|
||||||
{
|
{
|
||||||
public class GrassTile : BaseTile
|
public class GrassTile : BaseTile
|
||||||
{
|
{
|
||||||
public GrassTile() : base(TileSpriteContainer.GrassTileSprite)
|
public GrassTile() : base("C:/Users/maile/UnityProjects/2122_3AHITN_Scrum_sprechtl_jweissen_dhain/Assets/Farming Asset Pack/Split Assets/farming_tileset_000.png")
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue