mirror of
https://github.com/DerTyp7/harvestdale-unity.git
synced 2026-07-31 13:59:03 +02:00
tools
This commit is contained in:
11
Assets/Scripts/Items/Crop.cs
Normal file
11
Assets/Scripts/Items/Crop.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[CreateAssetMenu(fileName = "Crop", menuName = "Harvestdale/Items/Crop", order = 0)]
|
||||
public class Crop : Item
|
||||
{
|
||||
public int daysToGrow;
|
||||
public List<Sprite> sprites = new List<Sprite>();
|
||||
}
|
||||
11
Assets/Scripts/Items/Crop.cs.meta
Normal file
11
Assets/Scripts/Items/Crop.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f00df81b4ec12f844a6f928d013437b2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
15
Assets/Scripts/Items/Hoe.cs
Normal file
15
Assets/Scripts/Items/Hoe.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "Hoe", menuName = "Harvestdale/Tools/Hoe", order = 0)]
|
||||
public class Hoe : Tool
|
||||
{
|
||||
public override void OnUse()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Use()
|
||||
{
|
||||
OnUse();
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Items/Hoe.cs.meta
Normal file
11
Assets/Scripts/Items/Hoe.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab99e668aa1ba5a469eef680f3bb4b45
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
25
Assets/Scripts/Items/Item.cs
Normal file
25
Assets/Scripts/Items/Item.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
[CreateAssetMenu(fileName = "Item", menuName = "Harvestdale/Items/Item", order = 0)]
|
||||
public class Item : ScriptableObject
|
||||
{
|
||||
public string uuid;
|
||||
public string itemName;
|
||||
|
||||
public Sprite sprite;
|
||||
|
||||
[Tooltip("Tools will set this to false on Awake()")]
|
||||
public bool stackable = true;
|
||||
public int maxStackSize = 100;
|
||||
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (!stackable)
|
||||
{
|
||||
maxStackSize = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Items/Item.cs.meta
Normal file
11
Assets/Scripts/Items/Item.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 00ac127aa1678874aa5c9f1381b6b47a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
14
Assets/Scripts/Items/Tool.cs
Normal file
14
Assets/Scripts/Items/Tool.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
public abstract class Tool : Item
|
||||
{
|
||||
public abstract void Use();
|
||||
public abstract void OnUse();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
stackable = false;
|
||||
maxStackSize = 1;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Items/Tool.cs.meta
Normal file
11
Assets/Scripts/Items/Tool.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 943c595a7de78d44eae1ff08651910a2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user