Skip to content

Instantly share code, notes, and snippets.

View insthync's full-sized avatar

Ittipon Teerapruettikulchai insthync

  • Chiang Mai, Thailand
View GitHub Profile
@insthync
insthync / Dev Extension Sample
Last active November 28, 2018 02:33
Dev Extension Sample
using LiteNetLibManager;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MultiplayerARPG
{
public partial class PlayerCharacterEntity
{
[DevExtMethods("Start")]
@insthync
insthync / Turnbase RPG - Add currency (LiteDB)
Last active November 28, 2018 02:33
Turnbase RPG - Add currency (LiteDB)
// Add soft currency (coin)
var increaseSoftCurrency = 100; // Adding 100 coins
var softCurrency = GetCurrency(playerId, GameInstance.GameDatabase.softCurrency.id);
softCurrency.Amount += increaseSoftCurrency;
colPlayerCurrency.Update(softCurrency);
// Add hard currency (gem)
var increaseHardCurrency = 50; // Adding 50 gems
var hardCurrency = GetCurrency(playerId, GameInstance.GameDatabase.hardCurrency.id);
hardCurrency.Amount += increaseHardCurrency;
@insthync
insthync / Start, Spawn Map arguments
Created November 28, 2018 02:28
MMORPG KIT - MMO Getting Started
-startMapSpawnServer
-spawnExePath "Path of your execution file such as C:\Game\Game.exe"
-startCentralServer
-startChatServer
@insthync
insthync / Machine address arguments
Created November 28, 2018 02:29
MMORPG KIT - MMO Getting Started
-machineAddress "Address to your machine"
@insthync
insthync / Full arguments
Created November 28, 2018 02:30
MMORPG KIT - MMO Getting Started
D:\MMO\MMO.exe -startMapSpawnServer -spawnExePath "D:\MMO\MMO.exe" -startCentralServer -startChatServer -machineAddress "192.168.1.102"
@insthync
insthync / Linux or Mac arguments
Created November 28, 2018 02:31
MMORPG KIT - MMO Getting Started
$ ./Game.app -startMapSpawnServer -spawnExePath "Path of your execution file such as /Game/Game.app" -startCentralServer -startChatServer
minValue + Mathf.CeilToInt((maxValue - minValue) * Mathf.Pow((float)(currentLevel - 1) / (float)(maxLevel - 1), growth))
@insthync
insthync / gist:7d2ea7935f491e8decbe29eb840c98ea
Created February 12, 2019 11:25
Install Laravel (Always forget)
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newpassword';
composer install
php artisan migrate
chmod -R 0777 storage/
@insthync
insthync / gist:8d4438848dcbb3a1e4268dea4873861f
Created February 13, 2019 03:34
Simple draggable window
using UnityEngine;
using UnityEngine.EventSystems;
public class DraggableWindow : MonoBehaviour, IBeginDragHandler, IDragHandler
{
private float mouseOffsetY;
private float mouseOffsetX;
public void OnBeginDrag(PointerEventData eventData)
{
@insthync
insthync / EnterMMOServer
Created February 17, 2019 15:24
EnterMMOServer
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using LiteNetLib;
using LiteNetLibManager;
namespace MultiplayerARPG.MMO
{
public class EnterMMOServer : MonoBehviour