Dungeon coords searching method and minor fix with player name input

This commit is contained in:
Jakub Sztuba 2023-01-06 18:17:42 +01:00
parent 1458c07489
commit 134500c1eb
3 changed files with 23 additions and 3 deletions

View File

@ -208,6 +208,7 @@
<Compile Include="Assets\Scripts\REFACTORING\Application\Dialogue\Panel\IPanel.cs" /> <Compile Include="Assets\Scripts\REFACTORING\Application\Dialogue\Panel\IPanel.cs" />
<Compile Include="Assets\Scripts\SaveSystem.cs" /> <Compile Include="Assets\Scripts\SaveSystem.cs" />
<Compile Include="Assets\Scripts\AnimatedDoorBehaviour.cs" /> <Compile Include="Assets\Scripts\AnimatedDoorBehaviour.cs" />
<Compile Include="Assets\Scripts\REFACTORING\Application\Enemy\EnemyDrop.cs" />
<Compile Include="Assets\Scripts\Door\TriggerDoor.cs" /> <Compile Include="Assets\Scripts\Door\TriggerDoor.cs" />
<Compile Include="Assets\Scripts\ProceduralGeneration\GraphNode.cs" /> <Compile Include="Assets\Scripts\ProceduralGeneration\GraphNode.cs" />
<Compile Include="Assets\Scripts\REFACTORING\Application\AccountBalance\PanelCashController.cs" /> <Compile Include="Assets\Scripts\REFACTORING\Application\AccountBalance\PanelCashController.cs" />

View File

@ -535,7 +535,7 @@ MonoBehaviour:
nameOfPlayer: nameOfPlayer:
saveName: saveName:
inputText: {fileID: 637316601} inputText: {fileID: 637316601}
loadedName: {fileID: 0} loadedName:
--- !u!4 &525115091 --- !u!4 &525115091
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2731,7 +2731,7 @@ MonoBehaviour:
m_LineType: 0 m_LineType: 0
m_HideMobileInput: 0 m_HideMobileInput: 0
m_CharacterValidation: 0 m_CharacterValidation: 0
m_CharacterLimit: 0 m_CharacterLimit: 15
m_OnEndEdit: m_OnEndEdit:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -15,6 +15,7 @@ public class TileMapGenerator : MonoBehaviour
public Tilemap ground, walls; public Tilemap ground, walls;
public Tile ground1, wall1, corner_left_up, corner_left_down, corner_right_down, corner_right_up, left, right, up, down; public Tile ground1, wall1, corner_left_up, corner_left_down, corner_right_down, corner_right_up, left, right, up, down;
public Graph graph; public Graph graph;
public List<Vector3> availablePos;
private void Start() private void Start()
{ {
@ -83,6 +84,7 @@ public class TileMapGenerator : MonoBehaviour
{ {
ground.SetTile(new Vector3Int(pos.x,pos.y,0), ground1); ground.SetTile(new Vector3Int(pos.x,pos.y,0), ground1);
startPosOfPlayer = new Vector3Int(pos.x, pos.y, 0); startPosOfPlayer = new Vector3Int(pos.x, pos.y, 0);
availablePos.Add(startPosOfPlayer);
} }
else if (id == 2) else if (id == 2)
{ {
@ -110,11 +112,28 @@ public class TileMapGenerator : MonoBehaviour
GameObject Player = GameObject.FindWithTag("Player"); GameObject Player = GameObject.FindWithTag("Player");
Player.transform.position = startPosOfPlayer; Player.transform.position = startPosOfPlayer;
randomCoordsForStanding();
return true; return true;
} }
public Vector3 randomCoordsForStanding()
{
Tile test = new Tile();
while (true)
{
int bound = availablePos.Count;
int randomVal;
randomVal = Random.Range(0, bound);
Debug.Log(availablePos[randomVal]);
return availablePos[randomVal];
}
}
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {