Skip to content

Instantly share code, notes, and snippets.

View dimmduh's full-sized avatar
🎮
Learning Unity

Dmitrii Dukhnich dimmduh

🎮
Learning Unity
View GitHub Profile
@dimmduh
dimmduh / mainTemplate.gradle
Last active June 15, 2018 06:50
Unity gradle custom template with multidex
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
}
}
@dimmduh
dimmduh / Ball.cs
Created June 14, 2018 16:28
unity example - ball jump
using UnityEngine;
public class Ball : MonoBehaviour
{
private Rigidbody rb;
[Header("Jumping")]
public Vector3 jumpForce = Vector3.up;
public float jumpTimeout = 0.1f;
@dimmduh
dimmduh / TilingTexture.shader
Last active April 18, 2018 04:33 — forked from alexshikov/TilingTexture.shader
Tiling shader for Unity3D 5.3.x (material tiling is broken in 5.3.4f1 for some reason) + transparent
Shader "Unlit/Tiling Transparent Texture"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Tiling ("Tiling", Vector) = (1, 1, 0, 0)
}
SubShader
{
Tags
@dimmduh
dimmduh / run.sh
Created February 6, 2018 03:30
How to update gitlab - ubuntu 16 - whne package 'gitlab-ce' has no installation candidate
copy text from
https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/config_file.list?os=Ubuntu&dist=xenial&source=script
put to
nano /etc/apt/sources.list.d/gitlab_gitlab-ce.list
update
gitlab-rake gitlab:backup:create STRATEGY=copy
apt-get update && sudo apt-get install gitlab-ce
@dimmduh
dimmduh / .gitignore
Created February 6, 2018 02:32
My unity gitignore
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
# Visual Studio 2015 cache directory
/.vs/
@dimmduh
dimmduh / flat_array.php
Created February 1, 2018 14:44
php - make multidimensional array to flat array path => value
<?php
function flat_array($array, $delimiter = '/')
{
$result = [];
foreach ($array as $key => $value) {
if (is_array($value)) {
$subResult = flat_array($value, $delimiter);
foreach ($subResult as $subKey => $subValue) {
$result[$key . $delimiter . $subKey] = $subValue;
}
@dimmduh
dimmduh / InspectorLabelEditor.cs
Created October 6, 2017 07:31
Label for inspector. Put to Editor folder
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class InspectorLabel : MonoBehaviour
{
}
@dimmduh
dimmduh / LLApi MessagesConsumer.cs
Created October 5, 2017 07:19
Unity LLApi MessagesConsumer.cs
public void Start()
{
Disconnect = false;
//@todo tune params!
var gConfig = new GlobalConfig
{
ThreadPoolSize = threadPoolSize,
MaxPacketSize = maxPacketSize
};
@dimmduh
dimmduh / tank_rotation.cs
Created October 4, 2017 10:46
Unity tank rotation
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Tank : MonoBehaviour
{
public Transform cabina;
public Transform dulo;
@dimmduh
dimmduh / MainActivity.java
Created September 29, 2017 09:13
App2top event tracking MainActivity example
package org.app2top.tracking.example;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import org.app2top.tracking.App2top;
public class MainActivity extends AppCompatActivity {