files arranged using assembly defn
This commit is contained in:
20
Assets/DarkMatter/Code/Domain/Platforms/FirstPlatform.cs
Normal file
20
Assets/DarkMatter/Code/Domain/Platforms/FirstPlatform.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Darkmatter.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Darkmatter.Domain
|
||||
{
|
||||
public class FirstPlatform : IPlatformRule
|
||||
{
|
||||
public void Execute(IPlatform platform)
|
||||
{
|
||||
foreach (var piece in platform.platformPiece)
|
||||
{
|
||||
piece.SetActive(true);
|
||||
piece.GetComponent<Renderer>().material = platform.safeMaterial;
|
||||
piece.gameObject.SetActive(true);
|
||||
piece.tag = "Safe";
|
||||
}
|
||||
platform.platformPiece[Random.Range(1, platform.platformPiece.Count)].gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27cd8a8665a6d104f85ecb3c791c9757
|
||||
28
Assets/DarkMatter/Code/Domain/Platforms/OtherPlatform.cs
Normal file
28
Assets/DarkMatter/Code/Domain/Platforms/OtherPlatform.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Darkmatter.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Darkmatter.Domain
|
||||
{
|
||||
public class OtherPlatform : IPlatformRule
|
||||
{
|
||||
int danger = 2;
|
||||
public void Execute(IPlatform platform)
|
||||
{
|
||||
foreach (var piece in platform.platformPiece)
|
||||
{
|
||||
piece.SetActive(true);
|
||||
piece.GetComponent<Renderer>().material = platform.safeMaterial;
|
||||
piece.gameObject.SetActive(true);
|
||||
piece.tag = "Safe";
|
||||
}
|
||||
|
||||
for (int i = 0; i < danger; i++)
|
||||
{
|
||||
GameObject deadPlatform = platform.platformPiece[Random.Range(0, platform.platformPiece.Count)];
|
||||
deadPlatform.GetComponent<Renderer>().material = platform.deathMaterial;
|
||||
deadPlatform.tag = "Death";
|
||||
}
|
||||
platform.platformPiece[Random.Range(0, platform.platformPiece.Count)].gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4136bc6323ff5ea40874d2b69bc2ca56
|
||||
Reference in New Issue
Block a user