mirror of
https://github.com/DerTyp7/fps-citybuild-unity.git
synced 2025-10-30 12:37:08 +01:00
Merge branch 'Buildings' into Resources
This commit is contained in:
@@ -4,9 +4,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
public abstract class Building : MonoBehaviour
|
public abstract class Building : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public string title = "New Building";
|
||||||
public abstract string GetTitle();
|
public string description = "A cool new building";
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,10 @@ using UnityEngine;
|
|||||||
|
|
||||||
public class HouseBuildingScript : Building
|
public class HouseBuildingScript : Building
|
||||||
{
|
{
|
||||||
[SerializeField] private string title = "House";
|
private void Start()
|
||||||
[SerializeField] private string description = "A place for people to live in.";
|
{
|
||||||
|
title = "House";
|
||||||
|
description = "A place to live in";
|
||||||
|
}
|
||||||
|
|
||||||
public override string GetTitle()
|
|
||||||
{
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
public override string GetDescription()
|
|
||||||
{
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ public class InfoSign : Interactable
|
|||||||
|
|
||||||
public override void Interact()
|
public override void Interact()
|
||||||
{
|
{
|
||||||
Debug.Log(parentBuilding.GetTitle());
|
|
||||||
|
|
||||||
Debug.Log("interact");
|
Debug.Log("interact");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
8
Assets/Scripts/Building/Types.meta
Normal file
8
Assets/Scripts/Building/Types.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: efcc2aca90f2a2b4eb81b54c475f3df4
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/Building/Types/StorageBuilding.cs
Normal file
8
Assets/Scripts/Building/Types/StorageBuilding.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class StorageBuilding : Building
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
11
Assets/Scripts/Building/Types/StorageBuilding.cs.meta
Normal file
11
Assets/Scripts/Building/Types/StorageBuilding.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9cd3101a861849b4f97e2f4f499d7d46
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.collab-proxy": "1.9.0",
|
"com.unity.collab-proxy": "1.9.0",
|
||||||
"com.unity.ide.rider": "2.0.7",
|
"com.unity.ide.rider": "3.0.7",
|
||||||
"com.unity.ide.visualstudio": "2.0.11",
|
"com.unity.ide.visualstudio": "2.0.11",
|
||||||
"com.unity.ide.vscode": "1.2.3",
|
"com.unity.ide.vscode": "1.2.4",
|
||||||
"com.unity.test-framework": "1.1.29",
|
"com.unity.test-framework": "1.1.29",
|
||||||
"com.unity.textmeshpro": "3.0.6",
|
"com.unity.textmeshpro": "3.0.6",
|
||||||
"com.unity.timeline": "1.4.8",
|
"com.unity.timeline": "1.5.6",
|
||||||
"com.unity.ugui": "1.0.0",
|
"com.unity.ugui": "1.0.0",
|
||||||
"com.unity.modules.ai": "1.0.0",
|
"com.unity.modules.ai": "1.0.0",
|
||||||
"com.unity.modules.androidjni": "1.0.0",
|
"com.unity.modules.androidjni": "1.0.0",
|
||||||
|
|||||||
@@ -15,11 +15,11 @@
|
|||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.ide.rider": {
|
"com.unity.ide.rider": {
|
||||||
"version": "2.0.7",
|
"version": "3.0.7",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.test-framework": "1.1.1"
|
"com.unity.ext.nunit": "1.0.6"
|
||||||
},
|
},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.ide.vscode": {
|
"com.unity.ide.vscode": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.4",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.timeline": {
|
"com.unity.timeline": {
|
||||||
"version": "1.4.8",
|
"version": "1.5.6",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
m_EditorVersion: 2020.3.18f1
|
m_EditorVersion: 2021.1.22f1
|
||||||
m_EditorVersionWithRevision: 2020.3.18f1 (a7d1c678663c)
|
m_EditorVersionWithRevision: 2021.1.22f1 (a137e5fb0427)
|
||||||
|
|||||||
Reference in New Issue
Block a user