This file contains hidden or 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
| using UnityEngine; | |
| using UnityEngine.EventSystems; | |
| public class MinimapClickHandler : MonoBehaviour, IPointerClickHandler | |
| { | |
| public Camera minimapCamera; | |
| [Header("Fine-tune offsets")] | |
| public float offsetX = -12f; // Use your own values | |
| public float offsetZ = -15f; // Use your own values |
This file contains hidden or 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
| using UnityEngine; | |
| using System.Collections.Generic; | |
| public class FogOfWarManager : MonoBehaviour | |
| { | |
| public static FogOfWarManager Instance; | |
| public int textureResolution = 250; // Higher will impact game performance | |
| public float worldSize = 100f; | |
| public float visionRadius = 5f; |
This file contains hidden or 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
| Shader "Custom/URP/SimpleFogOfWar_SmoothEdges" | |
| { | |
| Properties | |
| { | |
| _MainTex ("Fog Texture", 2D) = "white" {} | |
| _TexelSize ("Texel Size", Vector) = (1,1,0,0) | |
| } | |
| SubShader | |
| { |
This file contains hidden or 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
| using UnityEngine; | |
| public class ProceduralGenerator : MonoBehaviour | |
| { | |
| public GameObject prefab; | |
| public int numberOfPrefabInstances = 200; | |
| public Vector3 generationAreaSize = new Vector3(100f, 1f, 100f); | |
| public float yAxisOffset = 0.07f; |
This file contains hidden or 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
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| [RequireComponent(typeof(Animator))] | |
| public class HorseController : MonoBehaviour | |
| { | |
| public Transform saddlePoint; |
This file contains hidden or 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
| public void RemoveItem(string itemName, int amountToRemove) | |
| { | |
| int remainingAmountToRemove = amountToRemove; | |
| foreach (InventorySlot slot in slotList) | |
| { | |
| if (slot.itemInSlot != null && slot.itemInSlot.thisName == itemName) | |
| { | |
| int amountInSlot = slot.itemInSlot.amountInInventory; |
This file contains hidden or 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
| using UnityEngine; | |
| using UnityEngine.AI; | |
| public class Harvester : MonoBehaviour | |
| { | |
| public Transform assignedNode; // Assigned resource node | |
| public Transform supplyCenter; // Supply center for depositing resources | |
| public float harvestAmountPerSecond = 1f; // Harvest rate | |
| public float maxCapacity = 10f; // Max carrying capacity |
This file contains hidden or 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
| using System.Collections; | |
| using UnityEngine; | |
| public class Projectile : MonoBehaviour | |
| { | |
| private Rigidbody rb; | |
| private int arrowDamage = 25; | |
| private bool isStuck = false; // Flag to track if the arrow is stuck | |
| private void Start() |
This file contains hidden or 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
| using System.Collections; | |
| using UnityEngine; | |
| public class BowController : MonoBehaviour | |
| { | |
| private Animator bowAnimator; // Reference to the Animator | |
| public InventorySystem inventory; // Reference to your inventory system | |
| public string arrowItemName = "Arrow"; // Name of the arrow item in the inventory | |
| private bool isDrawing = false; |
This file contains hidden or 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
| docker exec -i mysql-container mysql -u mike -pmike1234 mydatabase -e " | |
| DROP TABLE IF EXISTS users; | |
| CREATE TABLE users (id VARCHAR(255) PRIMARY KEY, score INT);" |
NewerOlder