mirror of
https://github.com/DerTyp7/fps-citybuild-unity.git
synced 2026-07-31 14:59:02 +02:00
Added Warehouse
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class WarehouseBlueprint : BuildingBlueprint
|
||||
{
|
||||
private MeshRenderer[] childrenMeshRenderer;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
//Haus cube ím Obj -> hier wird es benutzt zum material ändern
|
||||
childrenMeshRenderer = gameObject.GetComponentsInChildren<MeshRenderer>();
|
||||
}
|
||||
|
||||
public override void WhileColliding()
|
||||
{
|
||||
//Wenn es collidet soll der HouseCube IM Object verändert werden!
|
||||
//Das ist bei jedem Building anders
|
||||
foreach(MeshRenderer r in childrenMeshRenderer)
|
||||
{
|
||||
r.material = collisionMat;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override void WhileNotColliding()
|
||||
{
|
||||
//Das selbe wie bei "WhileColliding"
|
||||
foreach (MeshRenderer r in childrenMeshRenderer)
|
||||
{
|
||||
r.material = blueprintMat;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c08df78a8e2e51d4c80019a27fc2cc5c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -7,6 +7,8 @@ public class WarehouseBuilding : StorageBuilding
|
||||
|
||||
private void Start()
|
||||
{
|
||||
title = "Warehouse";
|
||||
description = "A place to store your resources";
|
||||
inventorySpace = 500;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class WarehouseConstruction : BuildingConstruction
|
||||
{
|
||||
[Header("Needed Resources")]
|
||||
[SerializeField] private int neededWood = 10;
|
||||
|
||||
[Header("Having Resources")]
|
||||
[SerializeField] private int havingWood = 0;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckForResources()
|
||||
{
|
||||
if (havingWood == neededWood)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c290e17b16e818841aabd5083a3475db
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user