Other projects I worked on while at Graveck were various unreleased projects and prototypes, and some Unity plugins and tools to be sold on the Unity Asset Store.

UDev GUI UDev Texture Composer UDev Selection Sets UDev Light Prober UDev External File SyncUDev Build Pivots

 

 

 

 

 

 

 

 

Here is some sample Unity Editor code I wrote for some of these plugins.

Selection Tools Editor GUI:

void OnGUI()
{
EditorGUILayout.LabelField(new GUIContent("Selections:","This shows at least the first 10 selections for the scene"));
scrollView = EditorGUILayout.BeginScrollView (scrollView);

EditorGUILayout.BeginVertical();
for(int i = 0; i < shownSelectionNumber;++i) { // we should do some checking so we don't get weird errors while adding or removing groups if(i >= selections.Count)
continue;

EditorGUILayout.BeginHorizontal();
selections[i].visible = EditorGUILayout.Toggle(selections[i].visible);
EditorGUILayout.LabelField(i.ToString ());
if(GUILayout.Button(new GUIContent(selections[i].name,"Select this selection and to interact more with it")))
SelectionButtonPressed(selections[i]);
EditorGUILayout.EndHorizontal();
}
EditorGUILayout.EndVertical();

EditorGUILayout.EndScrollView();

// Divider
GUILayout.Box("",new GUILayoutOption[]{GUILayout.ExpandWidth(true),GUILayout.Height(1)});

EditorGUILayout.BeginHorizontal();
if(GUILayout.Button (new GUIContent("Add","Adds a new selection group to the list")))
AddSelectionGroup();

if(selections.Count <= 10)
GUI.enabled = false;
if(GUILayout.Button (new GUIContent("Remove","Removes a selection group to the list (except the first 10)")))
RemoveSelectionGroup();
GUI.enabled = true;

EditorGUILayout.EndHorizontal();

// Divider
GUILayout.Box("",new GUILayoutOption[]{GUILayout.ExpandWidth(true),GUILayout.Height(1)});
EditorGUILayout.Separator ();

// here is where we add the bottom half to add functionality to each selection
//if we have clicked a selection button...
if(isShowingExtraOptions)
{
selections[currentSelectionIndex].name = EditorGUILayout.TextField ("Name: ",selections[currentSelectionIndex].name);
EditorGUILayout.Separator();

// show things
if(GUILayout.Button (new GUIContent("Add Selected To Group","Adds the currently selected items to this selection group")))
AddToGroup();

if(selections[currentSelectionIndex].objects.Count <= 0)
GUI.enabled = false;
if(GUILayout.Button (new GUIContent("Remove Selected From Group","Removes the currently selected items from this group if they are in it.")))
RemoveFromGroup();
GUI.enabled = true;

if(GUILayout.Button (new GUIContent("Redefine Selection Group","Replaces items in this group with the currently selected ones.")))
RedefineGroup();

// show the objects in the group
EditorGUI.indentLevel++;
EditorGUILayout.LabelField("Objects:");
extraOptionsScroll = EditorGUILayout.BeginScrollView(extraOptionsScroll);
EditorGUI.indentLevel++;
foreach(Object o in selections[currentSelectionIndex].objects)
EditorGUILayout.ObjectField(o,typeof(Object),true);
EditorGUILayout.EndScrollView();
}
else
{
for(int blah = 0; blah < 20;++blah) EditorGUILayout.Space(); } EditorGUI.indentLevel -= 2; EditorGUILayout.Separator(); } 

This is the Editor Window OnGUI function for the Company’s GUI utility plugin along with a couple of functions used for code cleanliness, which are called by the OnGUI function via instantiated EditorWindowGroupHelper classes. These classes are linked to the functions elsewhere in code. Ugh Editor Window:

 void OnGUI() { if(windowGroups == null) InitWindowGroups (); scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition); // selection filters selectedSprites = Selection.GetFiltered(typeof(UghSprite), SelectionMode.DeepAssets | SelectionMode.Editable); selectedUghTexts = Selection.GetFiltered(typeof(UghText), SelectionMode.DeepAssets | SelectionMode.Editable); selectedSpritesForAlign = Selection.GetFiltered (typeof(Transform),SelectionMode.DeepAssets | SelectionMode.Editable); sceneSprites = FindObjectsOfType(typeof(UghSprite)); // to find any ughsprites in the scene stopAutoUpdate = EditorGUILayout.Toggle (new GUIContent("Stop Automatic Updates","This will turn off the automatic updates for things like UghStretch and UghAlign so UghSprites can be moved and animated in the scene view."),stopAutoUpdate); GUILayout.Box("",new GUILayoutOption[]{GUILayout.ExpandWidth(true),GUILayout.Height(1)}); foreach(UghEditorWindowGroupHelper gh in windowGroups) { gh.OnGUIMethod(); // line between sections EditorGUILayout.Space (); GUI.enabled = true; GUILayout.Box("",new GUILayoutOption[]{GUILayout.ExpandWidth(true),GUILayout.Height(1)}); GUI.enabled = false; EditorGUILayout.Space (); } EditorGUILayout.EndScrollView(); if (GUI.changed) { UpdateAllSprites(); forceUpdate = true; } } public bool DoGeneralOnGUI() { GUI.enabled = true; // to reset this section UghEditorWindowGroupHelper gh = windowGroups[(int)GroupNames.General]; EditorGUILayout.LabelField (new GUIContent("General","General Functionality")); { Hashtable helpGroup = infoHash[GroupNames.General.ToString()] as Hashtable; string disabledTip = helpGroup["TooltipDisabled"] as string; EditorGUI.indentLevel++; EditorGUILayout.LabelField(new GUIContent("Utility", "Utility stuff")); // if (showUtilityGroup) { EditorGUI.indentLevel++; GUI.enabled = selectedUghTexts.Length > 0 || selectedSprites.Length > 0;

string duplicateTooltip = disabledTip;
if(GUI.enabled)
duplicateTooltip = helpGroup["TooltipDuplicate"] as string;
if(IndentButton(new GUIContent("Duplicate Ugh Asset", duplicateTooltip)))
{
if (selectedSprites.Length > 0)
DuplicateUgh(selectedSprites);

if (selectedUghTexts.Length > 0)
DuplicateUghText (selectedUghTexts);
}

GUI.enabled = true;

if (areSpritesDisabled) {
GUI.color = Color.yellow;
GUILayout.Label("Caution: UghSprites are disabled");
GUI.color = Color.white;
}

///////////
// activate all UghSprites
GUI.enabled = areSpritesDisabled && sceneSprites != null && sceneSprites.Length > 0;
string activateToolTip = helpGroup["TooltipActivateDisabled"] as string;
if(sceneSprites != null && sceneSprites.Length > 0)
activateToolTip = helpGroup["TooltipActivateNone"] as string;
if(GUI.enabled)
activateToolTip = helpGroup["TooltipActivate"] as string;
if (IndentButton(new GUIContent("Activate All UghSprites",activateToolTip))) {
SetAllUghSpritesActive(true);
areSpritesDisabled = false;

}
////////////

////////////
// deactivate all UghSprites
GUI.enabled = !areSpritesDisabled && sceneSprites != null && sceneSprites.Length > 0;
string deactivateToolTip = helpGroup["ToolTipDeactivateDisabled"] as string;
if(sceneSprites != null && sceneSprites.Length > 0)
deactivateToolTip = helpGroup["TooltipDeactivateNone"] as string;
if(GUI.enabled)
deactivateToolTip = helpGroup["TooltipDeactivate"] as string;
if (IndentButton(new GUIContent("Deactivate All UghSprites", deactivateToolTip))) {
SetAllUghSpritesActive(false);
areSpritesDisabled = true;
}
/////////////

EditorGUI.indentLevel--;
// }
EditorGUI.indentLevel--;
}

GUI.enabled = false;
return gh.isShowing;
}

public bool DoCreateOnGUI()
{
GUI.enabled = true; // to reset next section
UghEditorWindowGroupHelper gh = windowGroups[(int)GroupNames.Create];

EditorGUILayout.LabelField("Create");
{

Hashtable helpGroup = infoHash[GroupNames.Create.ToString()] as Hashtable;

EditorGUI.indentLevel++;

/////////////////
// texts
EditorGUILayout.LabelField ("Text");
string fontTip = helpGroup["TooltipFontDisabled"] as string;
EditorGUI.indentLevel++;
UnityEngine.Object[] fontList = Selection.GetFiltered(typeof(Font),SelectionMode.DeepAssets);
GUI.enabled = fontList.Length > 0;
string wordWrapTip = fontTip;
if(GUI.enabled){
fontTip = helpGroup["TooltipFontEnabled"] as string;
wordWrapTip = helpGroup["TooltipWordWrap"] as string;
}

textToCreate = IndentTextArea(textToCreate);

if (IndentButton(new GUIContent("TextMesh from Fonts", fontTip))) {
CreateTextsFromFonts(false, UghSprite.Anchor.MiddleCenter, textToCreate, GetSelectedFonts(fontList));
}
if(IndentButton (new GUIContent("UghText from Fonts",wordWrapTip)))
CreateTextsFromFonts (true, UghSprite.Anchor.MiddleCenter, textToCreate, GetSelectedFonts(fontList));

EditorGUI.indentLevel--;
EditorGUILayout.Separator();
//////////////////

GUI.enabled = true;
EditorGUILayout.LabelField (new GUIContent("UghScrollView"));
GUI.enabled = false;
// just in case they have deleted their selection
selectedSpritesForAlign = Selection.GetFiltered (typeof(Transform),SelectionMode.DeepAssets | SelectionMode.Editable);
if(selectedSpritesForAlign.Length > 0) // this means they have a transform selected
{
GUI.enabled = (selectedSpritesForAlign.GetValue (0) as Transform).childCount > 0; // the transform has children
}
EditorGUI.indentLevel++;
if(IndentButton(new GUIContent("Make UghScrollView (BETA)","This will add the UghScrollView script to the selected parent Transform")))
CreateUghScrollView(selectedSpritesForAlign);
EditorGUILayout.Space ();
EditorGUI.indentLevel--;

EditorGUI.indentLevel--;
}

GUI.enabled = false;
return gh.isShowing;
}

Autostrata Ad

One of the unreleased projects included a racing game that may be released at a later date which included some cool camera effects that I helped program.
These effects included a slow mo crash cam which could zero in on the point of impact as it slowed down and was very fun to code.

Below is a small snippet of the camera code showing the Update loop of the camera state in which the car is crashing, moving the camera to a desired position and rotation to look at a specific point in slow motion.

Slow Mo Crash Cam:

public override void Update ()
{
if (slowMoFactor > 0.01f)
{
slowMoFactor = Mathf.Max(slowMoFactor - Time.deltaTime * 5f / slowMoFactor, 0.01f);
Time.timeScale = originalTimeScale * slowMoFactor;
Time.fixedDeltaTime = originalfixedDeltaTime * slowMoFactor;
}

rotation += Time.deltaTime / slowMoFactor * data.orbitCameraSpeed * 2f;

Vector3 desiredPos = following.position + (Quaternion.Euler(0, rotation, 0) * data.followOffset * 2f);
cam.transform.position = Vector3.Lerp(cam.transform.position, desiredPos, Time.deltaTime / slowMoFactor);

Quaternion desiredRot = Quaternion.LookRotation(following.position - cam.transform.position);
cam.transform.rotation = Quaternion.Slerp(cam.transform.rotation, desiredRot, Time.deltaTime / slowMoFactor * 10f);

stateDuration -= Time.deltaTime / slowMoFactor;
if (stateDuration <= 0)
parent.PopState();
}