initial commit
This commit is contained in:
parent
6715289efe
commit
788c3389af
37645 changed files with 2526849 additions and 80 deletions
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Toolbars;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.Splines.Examples
|
||||
{
|
||||
[EditorToolbarElement("SpeedTiltTool/SplineDataType")]
|
||||
public class SpeedTiltDropdown : EditorToolbarDropdown
|
||||
{
|
||||
string[] m_SplineDataTypes = new []
|
||||
{
|
||||
SpeedTiltTool.SplineDataType.SpeedData.ToString(),
|
||||
SpeedTiltTool.SplineDataType.TiltData.ToString()
|
||||
};
|
||||
|
||||
public string k_Tooltip = "Select the SplineData to target for interactions.";
|
||||
|
||||
public SpeedTiltDropdown()
|
||||
{
|
||||
name = "SplineData Target Type";
|
||||
|
||||
clicked += OpenContextMenu;
|
||||
text = m_SplineDataTypes[(int)SpeedTiltTool.selectedSplineData];
|
||||
}
|
||||
|
||||
void OpenContextMenu()
|
||||
{
|
||||
var menu = new GenericMenu();
|
||||
for(int i = 0; i< m_SplineDataTypes.Length; i++)
|
||||
{
|
||||
var index = i;
|
||||
var component = m_SplineDataTypes[i];
|
||||
menu.AddItem(new GUIContent(component, k_Tooltip), text == component,
|
||||
() => SetSelectedComponent(index));
|
||||
}
|
||||
menu.DropDown(worldBound);
|
||||
}
|
||||
|
||||
void SetSelectedComponent(int selectedIndex)
|
||||
{
|
||||
text = m_SplineDataTypes[selectedIndex];
|
||||
SpeedTiltTool.selectedSplineData = (SpeedTiltTool.SplineDataType)selectedIndex;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d4c650b6f99c0d149be6ca04cbb10e7e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue