Skip to content

Instantly share code, notes, and snippets.

View tsmrecki's full-sized avatar

Tomislav Smrečki tsmrecki

  • Zagreb
View GitHub Profile
@tsmrecki
tsmrecki / Teleport.cs
Created May 19, 2016 08:50
Class extending MonoBehaviour
public class Teleport : MonoBehaviour {
private Vector3 startingPosition;
void Start() {
startingPosition = transform.localPosition;
SetGazedAt(false);
}
}
@tsmrecki
tsmrecki / Teleport.cs
Created May 19, 2016 08:52
Getting the component of the object
public void SetGazedAt(bool gazedAt) {
GetComponent<Renderer>().material.color = gazedAt ? Color.green : Color.red;
}
@tsmrecki
tsmrecki / Flying.cs
Created May 19, 2016 08:54
Make a object walk forward
void Update(){
GetComponent<Rigidbody> ().velocity = transform.forward * 2.0f;
}
@tsmrecki
tsmrecki / Gameplay.cs
Created May 19, 2016 09:01
Check for input actions
void LateUpdate(){
if (GvrViewer.Instance.BackButtonPressed) {
Application.Quit ();
}
if (GvrViewer.Instance.Triggered) {
SomeAction ();
}
}
@tsmrecki
tsmrecki / assetlinks.json
Created December 18, 2017 14:41
Asset links configuration file example for App Links
@tsmrecki
tsmrecki / build.gradle
Last active December 18, 2017 15:22
App module dependcies example
apply plugin: 'com.android.application'
...
dependencies {
implementation project(':product')
implementation project(':productlist')
implementation project(':base')
}
@tsmrecki
tsmrecki / build.gradle
Created December 18, 2017 15:26
Feature module dependencies example
apply plugin: 'com.android.feature'
...
dependencies {
implementation project(':base')
...
}
@tsmrecki
tsmrecki / build.gradle
Created December 18, 2017 15:42
Instant apps module configuration
apply plugin: 'com.android.instantapp'
dependencies {
implementation project(':product')
implementation project(':productlist')
implementation project(':base')
}
<meta-data
android:name="default-url"
android:value="https://example.domain" />
@tsmrecki
tsmrecki / build.gradle
Last active December 20, 2017 09:06
Base module dependencies example
apply plugin: 'com.android.feature'
android {
baseFeature true
...
}
dependencies {
api 'com.android.support:appcompat-v7:26.0.1'
api 'com.android.support.constraint:constraint-layout:1.0.2'