Fixes
This commit is contained in:
parent
533463a95a
commit
a3d6123e59
@ -193,7 +193,6 @@ MonoBehaviour:
|
|||||||
- {fileID: 8768991388683709947, guid: 32d2ba4971e4c7e4ab98a1f9c37dcffc, type: 3}
|
- {fileID: 8768991388683709947, guid: 32d2ba4971e4c7e4ab98a1f9c37dcffc, type: 3}
|
||||||
- {fileID: 6650340373999088090, guid: 76b3e3235b07ca04f91c9b020603e1dd, type: 3}
|
- {fileID: 6650340373999088090, guid: 76b3e3235b07ca04f91c9b020603e1dd, type: 3}
|
||||||
- {fileID: 7834549091241900869, guid: 085af51cf1ada0a4fa8a290eba8b0fd5, type: 3}
|
- {fileID: 7834549091241900869, guid: 085af51cf1ada0a4fa8a290eba8b0fd5, type: 3}
|
||||||
- {fileID: 2628890434173161082, guid: aa81b1bce294ebf42a0a5fff43100935, type: 3}
|
|
||||||
- {fileID: 8768991388683709947, guid: 1e3f34788e0cb3f49a0bef285d5b059a, type: 3}
|
- {fileID: 8768991388683709947, guid: 1e3f34788e0cb3f49a0bef285d5b059a, type: 3}
|
||||||
- {fileID: 1316835597118596560, guid: 685c607395b2cfa46a548c481d178540, type: 3}
|
- {fileID: 1316835597118596560, guid: 685c607395b2cfa46a548c481d178540, type: 3}
|
||||||
- {fileID: 1316835597118596560, guid: edd9e993fa2520f4095e33c7552ecd54, type: 3}
|
- {fileID: 1316835597118596560, guid: edd9e993fa2520f4095e33c7552ecd54, type: 3}
|
||||||
@ -203,7 +202,6 @@ MonoBehaviour:
|
|||||||
- {fileID: 5287741263160770601, guid: 7a596fa177a8fd34face58d8f58e0e41, type: 3}
|
- {fileID: 5287741263160770601, guid: 7a596fa177a8fd34face58d8f58e0e41, type: 3}
|
||||||
- {fileID: 2394897577413455488, guid: 1348a4eeda762ae4db83cd873efb4c44, type: 3}
|
- {fileID: 2394897577413455488, guid: 1348a4eeda762ae4db83cd873efb4c44, type: 3}
|
||||||
backgroundLevelBlocks: []
|
backgroundLevelBlocks: []
|
||||||
bgParrent: {fileID: 1253020012}
|
|
||||||
player: {fileID: 250075900}
|
player: {fileID: 250075900}
|
||||||
lastBlock: {fileID: 126480931}
|
lastBlock: {fileID: 126480931}
|
||||||
--- !u!1 &705507993
|
--- !u!1 &705507993
|
||||||
|
@ -5,10 +5,12 @@ using UnityEngine;
|
|||||||
public class BGRotation : MonoBehaviour
|
public class BGRotation : MonoBehaviour
|
||||||
{
|
{
|
||||||
private Vector3 rotation;
|
private Vector3 rotation;
|
||||||
|
private ProceduralGeneration bgParrentScript;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
rotation = new Vector3(Random.Range(0, 360), Random.Range(0, 360), Random.Range(0, 360)) * 0.009f;
|
rotation = new Vector3(Random.Range(0, 360), Random.Range(0, 360), Random.Range(0, 360)) * 0.009f;
|
||||||
|
bgParrentScript = GameObject.Find("Level").GetComponent<ProceduralGeneration>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FixedUpdate()
|
void FixedUpdate()
|
||||||
@ -20,7 +22,9 @@ public class BGRotation : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (other.tag == "platform")
|
if (other.tag == "platform")
|
||||||
{
|
{
|
||||||
|
this.bgParrentScript.backgroundLevelBlocks.Remove(this.gameObject);
|
||||||
Destroy(this.gameObject);
|
Destroy(this.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class ProceduralGeneration : MonoBehaviour
|
|||||||
public List<GameObject> backgroundBlocks = new List<GameObject>();
|
public List<GameObject> backgroundBlocks = new List<GameObject>();
|
||||||
public List<GameObject> backgroundLevelBlocks = new List<GameObject>();
|
public List<GameObject> backgroundLevelBlocks = new List<GameObject>();
|
||||||
private float maximumDistanceOfPlatformFromPlayerBg = 600.0f;
|
private float maximumDistanceOfPlatformFromPlayerBg = 600.0f;
|
||||||
public GameObject bgParrent = null;
|
private GameObject bgParrent = null;
|
||||||
|
|
||||||
public GameObject player = null;
|
public GameObject player = null;
|
||||||
public GameObject lastBlock;
|
public GameObject lastBlock;
|
||||||
@ -103,13 +103,16 @@ public class ProceduralGeneration : MonoBehaviour
|
|||||||
levelParrent = this.gameObject;
|
levelParrent = this.gameObject;
|
||||||
lastBlockPrefab = this.gameObject.transform.GetChild(0).gameObject;
|
lastBlockPrefab = this.gameObject.transform.GetChild(0).gameObject;
|
||||||
lastBlock = this.gameObject.transform.GetChild(0).gameObject;
|
lastBlock = this.gameObject.transform.GetChild(0).gameObject;
|
||||||
|
if (bgParrent == null)
|
||||||
|
{
|
||||||
|
bgParrent = GameObject.Find("Background");
|
||||||
|
}
|
||||||
this.spawnedLevelBlocks.Add(lastBlock);
|
this.spawnedLevelBlocks.Add(lastBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
|
||||||
// if (playerControlsSript.isFalling)
|
// if (playerControlsSript.isFalling)
|
||||||
// {
|
// {
|
||||||
// return;
|
// return;
|
||||||
@ -159,7 +162,10 @@ public class ProceduralGeneration : MonoBehaviour
|
|||||||
int blockToSpawn = Random.Range(0, (levelBlocks.Count + 1));
|
int blockToSpawn = Random.Range(0, (levelBlocks.Count + 1));
|
||||||
|
|
||||||
|
|
||||||
if (levelBlocks[blockToSpawn].name == lastBlockPrefab.name)
|
if (
|
||||||
|
(blockToSpawn > -1 && (blockToSpawn < levelBlocks.Count)) &&
|
||||||
|
(levelBlocks[blockToSpawn].name == lastBlockPrefab.name)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
Debug.Log("Same Block");
|
Debug.Log("Same Block");
|
||||||
if (blockToSpawn > levelBlocks.Count || blockToSpawn < 0)
|
if (blockToSpawn > levelBlocks.Count || blockToSpawn < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user