Skip to content

Instantly share code, notes, and snippets.

View braindroplabs's full-sized avatar

Braindrop Labs braindroplabs

View GitHub Profile
@braindroplabs
braindroplabs / ShapeRainEditorWindow
Last active January 15, 2017 16:23
Everything is working as intended currently except for the rounding of rotation values. I'm assuming this has something to do with Quaternions (of which I'm not quite familiar). My approach on 133-139 isn't working, any ideas as to why? What I ultimately want is to 1) Rotate a GO in the SceneView 2) When done rotating (mouse up) I want the XYZ v…
// DOCUMENTATION -----------------------------------------------------------------------------------
// This custom EditorWindow exists to streamline common level design scenarios for Shape Rain.
// DEPENDENCIES ------------------------------------------------------------------------------------
using UnityEngine;
using System;
using UnityEditor;
using System;
using UnityEngine;
public class Signals : MonoBehaviour
{
/***********************************************************************************************
PRELOAD
***********************************************************************************************/
@braindroplabs
braindroplabs / app.component.html
Last active June 23, 2016 21:00
How is transclusion (content projection) done in Angular 2 when using SVG?
<my-custom-svg [width]="500" [height]="300">
<g my-custom-content-projected-svg [item]="item"></g>
</my-custom-svg>
@braindroplabs
braindroplabs / selectable.directive.ts
Last active May 9, 2016 14:41
I have a SelectableDirective that I place on distinct elements. How can I use @ViewChild to get the directives by name/alias (#header and #body below) vs getting the element the directive is on?
import { Directive, ElementRef, EventEmitter, Input, Output } from '@angular/core';
@Directive({
selector: '[selectable]',
host: {
'(click)': 'onClick()'
}
})
export class SelectableDirective {
@braindroplabs
braindroplabs / main.componenent.html
Created May 7, 2016 17:38
I'm looking for the lightest approach for allowing the buttons transcluded within <app-control-panel-button> to notify components in <app-control-panel-body> that they've been clicked.
<div class="row">
<div class="col-md-4">
<!-- Images Component -->
<app-control-panel label="Images">
<app-control-panel-button>
<button class="pull-right">Shuffle</button>
</app-control-panel-button>
<app-control-panel-body>
<app-image-select></app-image-select>
/*
In EX1, my objects would render (seemingly a single frame) at the ZKpositionTo position before starting from the setFrom() position. Not every time, but sometimes.
I'm used to Greensock's (AS3/JS) Tween library and I never ran into this issue, so I may be bringing expectations over incorrectly.
In EX2, I explicitly set the from position and then only use ZKpositionTo. This works as expected.
You mentioned on Twitter that "the first tick is a 0 elapsedTime tick", and I'm assuming this may be the culprit of the unwanted frame render.
Any way to alleviate the issue? Any other thoughts? Or is this expected behavior?
*/
//EX1 - this example has the issue