Dungeon coords searching method and minor fix with player name input
This commit is contained in:
parent
1458c07489
commit
134500c1eb
@ -208,6 +208,7 @@
|
||||
<Compile Include="Assets\Scripts\REFACTORING\Application\Dialogue\Panel\IPanel.cs" />
|
||||
<Compile Include="Assets\Scripts\SaveSystem.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\ProceduralGeneration\GraphNode.cs" />
|
||||
<Compile Include="Assets\Scripts\REFACTORING\Application\AccountBalance\PanelCashController.cs" />
|
||||
|
@ -535,7 +535,7 @@ MonoBehaviour:
|
||||
nameOfPlayer:
|
||||
saveName:
|
||||
inputText: {fileID: 637316601}
|
||||
loadedName: {fileID: 0}
|
||||
loadedName:
|
||||
--- !u!4 &525115091
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2731,7 +2731,7 @@ MonoBehaviour:
|
||||
m_LineType: 0
|
||||
m_HideMobileInput: 0
|
||||
m_CharacterValidation: 0
|
||||
m_CharacterLimit: 0
|
||||
m_CharacterLimit: 15
|
||||
m_OnEndEdit:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
|
@ -15,6 +15,7 @@ public class TileMapGenerator : MonoBehaviour
|
||||
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 Graph graph;
|
||||
public List<Vector3> availablePos;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
@ -83,6 +84,7 @@ public class TileMapGenerator : MonoBehaviour
|
||||
{
|
||||
ground.SetTile(new Vector3Int(pos.x,pos.y,0), ground1);
|
||||
startPosOfPlayer = new Vector3Int(pos.x, pos.y, 0);
|
||||
availablePos.Add(startPosOfPlayer);
|
||||
}
|
||||
else if (id == 2)
|
||||
{
|
||||
@ -111,10 +113,27 @@ public class TileMapGenerator : MonoBehaviour
|
||||
GameObject Player = GameObject.FindWithTag("Player");
|
||||
Player.transform.position = startPosOfPlayer;
|
||||
|
||||
randomCoordsForStanding();
|
||||
|
||||
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
|
||||
void Update()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user