Skip to content

Instantly share code, notes, and snippets.

View adadesions's full-sized avatar
:octocat:
Applied Computer Scientist is the gem of the Earth.

Ada Kaminkure adadesions

:octocat:
Applied Computer Scientist is the gem of the Earth.
View GitHub Profile
@adadesions
adadesions / Install Google Protobuf to Unity Project
Created December 4, 2023 09:50
How to use Protobuf in Unity
# Installation and Setting up
1. Add link.xml to Assets folder
2. Download Google.Protobuf and System.Runtime.CompilerServices.Unsafe from these links
- https://www.nuget.org/packages/Google.Protobuf
- https://www.nuget.org/packages/System.Runtime.CompilerServices.Unsafe
3. Change its extension from .nupkg to .zip then unzip it.
4. Locate to lib/netstandard2.0 then copy .dll
5. Place to Assets/Plugins folder in Unity Project
ref: https://learn.microsoft.com/en-us/visualstudio/gamedev/unity/unity-scripting-upgrade
using System;
using Games.MiniGame.GCD_Game.Scripts.Items;
using Paideria.Minigames.GCD;
using UnityEngine;
namespace Games.MiniGame.GCD_Game.Scripts.Player
{
public class PlayerGrabItem : MonoBehaviour, IGrabItemByPlayer
{
[SerializeField] private Vector3 offset;
using Paideria.Minigames.GCD;
using TMPro;
using UnityEngine;
namespace Games.MiniGame.GCD_Game.Scripts.Items
{
public class GrabableItem : MonoBehaviour
{
[SerializeField] float _activeDistance = 2.0f;
[SerializeField] string _numberText = "0";
public Card {
}

Daily Routine

git pull <URL_REMOTE_REPO> Optional:Branch


Save the work step

git status git add

Commit for short comment

git commit -am "Comment..."

#include <iostream>
#include <queue>
#include <vector>
using namespace std;
struct Item {
float weight;
int value;
};
bool isPerfectSquare(int num) {
if (num < 2) {
return true;
}
int left = 2, right = num / 2;
while (left <= right) {
long long mid = left + (right - left) / 2;
long long square = mid * mid;
if (square == num) {
return true;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
void Awake()
{
GameObject[] playerObjects = GameObject.FindGameObjectsWithTag("Player");
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController1 : MonoBehaviour
{
[SerializeField] float speed = 4.0f;
[SerializeField] float jumpPower = 4.0f;
private Rigidbody rb;
public class SpaceController : MonoBehaviour
{
[SerializeField] private float cooldown = 1.0f;
private float lastTimeFire = -Mathf.Infinity;
private void spaceFire()
{
if (Input.GetKey(KeyCode.Space) || Input.GetButton("Fire1"))
{
if (Time.time > lastTimeFire + cooldown)