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);" |
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
sudo nano /etc/cloud/cloud.cfg.d/99-disable-motd.cfg | |
# Disable motd updates | |
system_info: | |
motd: [] |
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.Networking; | |
using System.Collections; | |
using System; | |
public class APIClient : MonoBehaviour | |
{ | |
// Server Base URL | |
private const string serverBaseUrl = "http://16.171.29.140:5002/"; |
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 run -d \ | |
--name mysql-container \ | |
--restart unless-stopped \ | |
-e MYSQL_ROOT_PASSWORD=rootpassword \ | |
-e MYSQL_DATABASE=mydatabase \ | |
-e MYSQL_USER=myuser \ | |
-e MYSQL_PASSWORD=mypassword \ | |
-v mysql-data:/var/lib/mysql \ | |
-p 3306:3306 \ | |
mysql:latest |
NewerOlder