mirror of
https://github.com/DerTyp7/fps-citybuild-unity.git
synced 2025-10-30 04:27:09 +01:00
update buildings
This commit is contained in:
@@ -4,7 +4,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
public abstract class Building : MonoBehaviour
|
public abstract class Building : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
||||||
public abstract string GetTitle();
|
public abstract string GetTitle();
|
||||||
public abstract string GetDescription();
|
public abstract string GetDescription();
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ public abstract class BuildingBlueprint : MonoBehaviour
|
|||||||
Ray ray;
|
Ray ray;
|
||||||
|
|
||||||
public abstract void Init();
|
public abstract void Init();
|
||||||
|
|
||||||
public abstract void WhileColliding();
|
public abstract void WhileColliding();
|
||||||
public abstract void WhileNotColliding();
|
public abstract void WhileNotColliding();
|
||||||
|
|
||||||
|
|||||||
@@ -4,23 +4,29 @@ using UnityEngine;
|
|||||||
|
|
||||||
public class HouseBlueprint : BuildingBlueprint
|
public class HouseBlueprint : BuildingBlueprint
|
||||||
{
|
{
|
||||||
public Material collisionMat;
|
|
||||||
|
|
||||||
|
public Material collisionMat;
|
||||||
public Material blueprintMat;
|
public Material blueprintMat;
|
||||||
|
|
||||||
|
|
||||||
private Transform houseCube;
|
private Transform houseCube;
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
|
//Haus cube <20>m Obj -> hier wird es benutzt zum material <20>ndern
|
||||||
houseCube = gameObject.transform.Find("HouseCube");
|
houseCube = gameObject.transform.Find("HouseCube");
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void WhileColliding()
|
public override void WhileColliding()
|
||||||
{
|
{
|
||||||
|
//Wenn es collidet soll der HouseCube IM Object ver<65>ndert werden!
|
||||||
|
//Das ist bei jedem Building anders
|
||||||
houseCube.GetComponent<MeshRenderer>().material = collisionMat;
|
houseCube.GetComponent<MeshRenderer>().material = collisionMat;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void WhileNotColliding()
|
public override void WhileNotColliding()
|
||||||
{
|
{
|
||||||
|
//Das selbe wie bei "WhileColliding"
|
||||||
houseCube.GetComponent<MeshRenderer>().material = blueprintMat;
|
houseCube.GetComponent<MeshRenderer>().material = blueprintMat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ using System.Collections.Generic;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class HouseBuildingScript : Building
|
public class HouseBuildingScript : Building
|
||||||
{
|
{
|
||||||
|
|
||||||
[SerializeField] private string title = "House";
|
[SerializeField] private string title = "House";
|
||||||
[SerializeField] private string description = "A place for people to live in.";
|
[SerializeField] private string description = "A place for people to live in.";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user