Merge branch 'main' of https://git.steelants.cz/GJP/GGJ2022
This commit is contained in:
@@ -198,8 +198,8 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
type: 0
|
||||
speed: 5
|
||||
type: 2
|
||||
speed: 10
|
||||
--- !u!65 &8238111678033492397
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@@ -199,7 +199,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
type: 1
|
||||
type: 0
|
||||
speed: 5
|
||||
--- !u!65 &3865253352867341094
|
||||
BoxCollider:
|
||||
|
@@ -198,7 +198,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
type: 5
|
||||
type: 6
|
||||
speed: 10
|
||||
--- !u!65 &6218203028538785626
|
||||
BoxCollider:
|
||||
|
@@ -198,8 +198,8 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
type: 0
|
||||
speed: 5
|
||||
type: 1
|
||||
speed: 10
|
||||
--- !u!65 &5316890779910729157
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@@ -198,7 +198,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
type: 4
|
||||
type: 5
|
||||
speed: 10
|
||||
--- !u!65 &4344779564172896453
|
||||
BoxCollider:
|
||||
|
@@ -4,7 +4,7 @@ using UnityEngine;
|
||||
|
||||
public class PlatformManager : MonoBehaviour
|
||||
{
|
||||
public enum PlatformType {Pull, Push, RotateZ, RotateY, SpeedUp, SpeedDown};
|
||||
public enum PlatformType {Basic, Pull, Push, RotateZ, RotateY, SpeedUp, SpeedDown};
|
||||
public PlatformType type = PlatformType.Pull;
|
||||
public float speed = 5;
|
||||
|
||||
|
@@ -178,8 +178,10 @@ public class PlayerController : MonoBehaviour
|
||||
switch (platform.type)
|
||||
{
|
||||
case PlatformManager.PlatformType.Push:
|
||||
rb.AddForce(other.GetContact(0).normal * platform.speed * Time.deltaTime, ForceMode.Impulse);
|
||||
break;
|
||||
case PlatformManager.PlatformType.Pull:
|
||||
rb.AddForce(-other.GetContact(0).normal * platform.speed * Time.deltaTime, ForceMode.Impulse);
|
||||
break;
|
||||
case PlatformManager.PlatformType.RotateY:
|
||||
break;
|
||||
@@ -196,11 +198,11 @@ public class PlayerController : MonoBehaviour
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gDirection = -transform.up;
|
||||
gDirection = -other.GetContact(0).normal;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
gDirection = -transform.up;
|
||||
gDirection = -other.GetContact(0).normal;
|
||||
}
|
||||
platformForward = other.transform.forward;
|
||||
this.downDirection = gDirection;
|
||||
|
@@ -30,7 +30,14 @@ public class ProceduralGeneration : MonoBehaviour
|
||||
int pieceCount = 10;
|
||||
float radius = (pieceCount / 2) * 2;
|
||||
float angle = 360f / (float)pieceCount;
|
||||
Vector3 centerPoint = new Vector3(lastObject.transform.position.x, (lastObject.transform.position.y + radius), lastObject.transform.position.z + 3.0f);
|
||||
|
||||
MeshFilter meshfilter = lastObject.GetComponent<MeshFilter>();
|
||||
Bounds bounds = meshfilter.mesh.bounds;
|
||||
|
||||
float scale = meshfilter.transform.localScale.x;
|
||||
Bounds b = new Bounds(bounds.center * scale, bounds.size * scale);
|
||||
|
||||
Vector3 centerPoint = new Vector3(lastObject.transform.position.x, (lastObject.transform.position.y + radius), this.lastBlock.transform.position.z + b.size.z + 1.0f);
|
||||
|
||||
float heightOffset = radius;
|
||||
|
||||
@@ -73,7 +80,7 @@ public class ProceduralGeneration : MonoBehaviour
|
||||
|
||||
if (this.spawnedLevelBlocks.Count <= maxNumberOfBlock)
|
||||
{
|
||||
int blockToSpawn = Random.Range(0, levelBlocks.Count - 1);
|
||||
int blockToSpawn = Random.Range(0, levelBlocks.Count);
|
||||
|
||||
GameObject instantiatedGameObject;
|
||||
GameObject blockObjToSpawn;
|
||||
@@ -82,21 +89,9 @@ public class ProceduralGeneration : MonoBehaviour
|
||||
if (blockObjToSpawn.name == lastBlockPrefab.name)
|
||||
{
|
||||
Debug.Log("Same Block");
|
||||
if ((blockToSpawn + 1) <= levelBlocks.Count)
|
||||
if (blockToSpawn < levelBlocks.Count || blockToSpawn > -1)
|
||||
{
|
||||
blockToSpawn++;
|
||||
}
|
||||
else if ((blockToSpawn - 1) >= levelBlocks.Count)
|
||||
{
|
||||
blockToSpawn--;
|
||||
}
|
||||
if ((blockToSpawn + 1) <= levelBlocks.Count)
|
||||
{
|
||||
blockToSpawn++;
|
||||
}
|
||||
else if ((blockToSpawn - 1) >= levelBlocks.Count)
|
||||
{
|
||||
blockToSpawn--;
|
||||
blockToSpawn = Random.Range(0, (levelBlocks.Count - 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user