Skip to content

Instantly share code, notes, and snippets.

View mahdisml's full-sized avatar
🎮
Focusing

Mahdi Safarmohammadloo mahdisml

🎮
Focusing
View GitHub Profile
@mahdisml
mahdisml / PrettyPrint.kt
Created August 26, 2023 15:24 — forked from mayankmkh/PrettyPrint.kt
Pretty Print Kotlin Data Class
fun Any.prettyPrint(): String {
var indentLevel = 0
val indentWidth = 4
fun padding() = "".padStart(indentLevel * indentWidth)
val toString = toString()
val stringBuilder = StringBuilder(toString.length)
@mahdisml
mahdisml / gist:b888dd6567209ce2203854c9b28895bf
Created July 28, 2023 22:19 — forked from phoenixperry/gist:6888925
Example of OnCollisionEnter in Unity in c# from Unity 3d Student
void OnCollisionEnter(Collision theCollision){
if(theCollision.gameObject.name == "Floor"){
Debug.Log("Hit the floor");
}else if(theCollision.gameObject.name == "Wall"){
Debug.Log("Hit the wall");
}