mirror of
https://github.com/DerTyp7/fps-citybuild-unity.git
synced 2026-07-31 14:59:02 +02:00
Added Basic ResourceManagement
This commit is contained in:
32
Assets/Scripts/Building/Buildings/House/HouseBlueprint.cs
Normal file
32
Assets/Scripts/Building/Buildings/House/HouseBlueprint.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class HouseBlueprint : BuildingBlueprint
|
||||
{
|
||||
|
||||
public Material collisionMat;
|
||||
public Material blueprintMat;
|
||||
|
||||
|
||||
private Transform houseCube;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
//Haus cube ím Obj -> hier wird es benutzt zum material ändern
|
||||
houseCube = gameObject.transform.Find("HouseCube");
|
||||
}
|
||||
|
||||
public override void WhileColliding()
|
||||
{
|
||||
//Wenn es collidet soll der HouseCube IM Object verändert werden!
|
||||
//Das ist bei jedem Building anders
|
||||
houseCube.GetComponent<MeshRenderer>().material = collisionMat;
|
||||
}
|
||||
|
||||
public override void WhileNotColliding()
|
||||
{
|
||||
//Das selbe wie bei "WhileColliding"
|
||||
houseCube.GetComponent<MeshRenderer>().material = blueprintMat;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user