-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
762 additions
and
397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"visualstudiotoolsforunity.vstuc" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Attach to Unity", | ||
"type": "vstuc", | ||
"request": "attach" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"files.exclude": { | ||
"**/.DS_Store": true, | ||
"**/.git": true, | ||
"**/.vs": true, | ||
"**/.gitmodules": true, | ||
"**/.vsconfig": true, | ||
"**/*.booproj": true, | ||
"**/*.pidb": true, | ||
"**/*.suo": true, | ||
"**/*.user": true, | ||
"**/*.userprefs": true, | ||
"**/*.unityproj": true, | ||
"**/*.dll": true, | ||
"**/*.exe": true, | ||
"**/*.pdf": true, | ||
"**/*.mid": true, | ||
"**/*.midi": true, | ||
"**/*.wav": true, | ||
"**/*.gif": true, | ||
"**/*.ico": true, | ||
"**/*.jpg": true, | ||
"**/*.jpeg": true, | ||
"**/*.png": true, | ||
"**/*.psd": true, | ||
"**/*.tga": true, | ||
"**/*.tif": true, | ||
"**/*.tiff": true, | ||
"**/*.3ds": true, | ||
"**/*.3DS": true, | ||
"**/*.fbx": true, | ||
"**/*.FBX": true, | ||
"**/*.lxo": true, | ||
"**/*.LXO": true, | ||
"**/*.ma": true, | ||
"**/*.MA": true, | ||
"**/*.obj": true, | ||
"**/*.OBJ": true, | ||
"**/*.asset": true, | ||
"**/*.cubemap": true, | ||
"**/*.flare": true, | ||
"**/*.mat": true, | ||
"**/*.meta": true, | ||
"**/*.prefab": true, | ||
"**/*.unity": true, | ||
"build/": true, | ||
"Build/": true, | ||
"Library/": true, | ||
"library/": true, | ||
"obj/": true, | ||
"Obj/": true, | ||
"Logs/": true, | ||
"logs/": true, | ||
"ProjectSettings/": true, | ||
"UserSettings/": true, | ||
"temp/": true, | ||
"Temp/": true | ||
}, | ||
"dotnet.defaultSolution": "05-tilemap-pathfinding.sln" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using UnityEngine; | ||
using UnityEngine.Tilemaps; | ||
|
||
/** | ||
* This component manages the boat's interactions. | ||
* Handles player pickup, updates allowed tiles for movement, and ensures compatibility with the game system. | ||
*/ | ||
public class Boat : MonoBehaviour { | ||
[SerializeField] AllowedTiles allowedTiles = null; | ||
|
||
private bool isPickedUp = false; // Tracks whether the boat is picked up. | ||
|
||
/** | ||
* Handles the player's interaction with the boat. | ||
* Updates allowed tiles when the boat is picked up. | ||
* @param player The GameObject interacting with the boat. | ||
*/ | ||
public void OnPlayerInteraction(GameObject player) { | ||
if (!isPickedUp) { | ||
Debug.Log("Boat picked up by player!"); | ||
isPickedUp = true; | ||
UpdateAllowedTilesForBoat(); | ||
} else { | ||
Debug.Log("Boat is already being carried!"); | ||
} | ||
} | ||
|
||
/** | ||
* Updates the allowed tiles to include water tiles when the boat is picked up. | ||
*/ | ||
private void UpdateAllowedTilesForBoat() { | ||
TileBase[] waterTiles = { /* Add the specific water tiles here */ }; | ||
allowedTiles.UpdateAllowedTiles(waterTiles); | ||
Debug.Log("Allowed tiles updated for boat movement."); | ||
} | ||
|
||
/** | ||
* Resets the boat's state when dropped by the player. | ||
* Updates allowed tiles back to the default state. | ||
* @param player The GameObject dropping the boat. | ||
*/ | ||
public void OnPlayerDrop(GameObject player) { | ||
if (isPickedUp) { | ||
Debug.Log("Boat dropped by player."); | ||
isPickedUp = false; | ||
ResetAllowedTiles(); | ||
} | ||
} | ||
|
||
/** | ||
* Resets the allowed tiles back to the default state. | ||
*/ | ||
private void ResetAllowedTiles() { | ||
TileBase[] defaultTiles = { /* Add default tiles here */ }; | ||
allowedTiles.UpdateAllowedTiles(defaultTiles); | ||
Debug.Log("Allowed tiles reset after boat drop."); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using UnityEngine; | ||
using UnityEngine.Tilemaps; | ||
|
||
/** | ||
* This component manages the goat's interactions. | ||
* Handles player pickup, updates allowed tiles for movement, and ensures compatibility with the game system. | ||
*/ | ||
public class Goat : MonoBehaviour { | ||
[SerializeField] AllowedTiles allowedTiles = null; | ||
|
||
private bool isPickedUp = false; // Tracks whether the goat is picked up. | ||
|
||
/** | ||
* Handles the player's interaction with the goat. | ||
* Updates allowed tiles when the goat is picked up. | ||
* @param player The GameObject interacting with the goat. | ||
*/ | ||
public void OnPlayerInteraction(GameObject player) { | ||
if (!isPickedUp) { | ||
Debug.Log("Goat picked up by player!"); | ||
isPickedUp = true; | ||
UpdateAllowedTilesForGoat(); | ||
} else { | ||
Debug.Log("Goat is already being carried!"); | ||
} | ||
} | ||
|
||
/** | ||
* Updates the allowed tiles to include goat-friendly terrain when picked up. | ||
*/ | ||
private void UpdateAllowedTilesForGoat() { | ||
TileBase[] goatAllowedTiles = { /* Add specific tiles here (e.g., grass) */ }; | ||
allowedTiles.UpdateAllowedTiles(goatAllowedTiles); | ||
Debug.Log("Allowed tiles updated for goat movement."); | ||
} | ||
|
||
/** | ||
* Resets the goat's state when dropped by the player. | ||
* Updates allowed tiles back to the default state. | ||
* @param player The GameObject dropping the goat. | ||
*/ | ||
public void OnPlayerDrop(GameObject player) { | ||
if (isPickedUp) { | ||
Debug.Log("Goat dropped by player."); | ||
isPickedUp = false; | ||
ResetAllowedTiles(); | ||
} | ||
} | ||
|
||
/** | ||
* Resets the allowed tiles back to the default state. | ||
*/ | ||
private void ResetAllowedTiles() { | ||
TileBase[] defaultTiles = { /* Add default tiles here */ }; | ||
allowedTiles.UpdateAllowedTiles(defaultTiles); | ||
Debug.Log("Allowed tiles reset after goat drop."); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.