Skip to content

Commit

Permalink
Merge pull request #183 from Unity-Technologies/staging
Browse files Browse the repository at this point in the history
0.0.7 staging -> master
  • Loading branch information
amirebrahimi authored Jun 5, 2017
2 parents 1253841 + d7c4a73 commit 7254d60
Show file tree
Hide file tree
Showing 263 changed files with 19,202 additions and 24,754 deletions.
4 changes: 0 additions & 4 deletions Action Maps/DirectSelectInput.asset
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 24e5bc088c9caeb44bc4283dc321b033, type: 3}
m_Name: DirectSelectInput
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_Actions:
- {fileID: 114000012349872818}
- {fileID: 114000013014554554}
Expand Down Expand Up @@ -67,7 +66,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: Cancel
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 2
m_ControlData:
Expand All @@ -88,7 +86,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: Select
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 0
m_ControlData:
Expand All @@ -109,7 +106,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: Multi Select
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 1
m_ControlData:
Expand Down
2 changes: 0 additions & 2 deletions Action Maps/Standard.asset
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 24e5bc088c9caeb44bc4283dc321b033, type: 3}
m_Name: Standard
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_Actions:
- {fileID: 114000013893770434}
m_ControlSchemes:
Expand Down Expand Up @@ -46,7 +45,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: Standard
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 0
m_ControlData:
Expand Down
19 changes: 0 additions & 19 deletions Action Maps/TrackedObject.asset
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 24e5bc088c9caeb44bc4283dc321b033, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_Actions:
- {fileID: 114000012697452144}
- {fileID: 114000013037932804}
Expand Down Expand Up @@ -221,7 +220,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 4
m_ControlData:
Expand All @@ -242,7 +240,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 6
m_ControlData:
Expand All @@ -263,7 +260,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 7
m_ControlData:
Expand All @@ -284,7 +280,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 12
m_ControlData:
Expand All @@ -305,7 +300,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 17
m_ControlData:
Expand All @@ -326,7 +320,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 11
m_ControlData:
Expand All @@ -347,7 +340,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 9
m_ControlData:
Expand All @@ -368,7 +360,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 5
m_ControlData:
Expand All @@ -389,7 +380,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 13
m_ControlData:
Expand All @@ -410,7 +400,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 14
m_ControlData:
Expand All @@ -431,7 +420,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 15
m_ControlData:
Expand All @@ -452,7 +440,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 0
m_ControlData:
Expand All @@ -473,7 +460,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 1
m_ControlData:
Expand All @@ -494,7 +480,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 3
m_ControlData:
Expand All @@ -515,7 +500,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 10
m_ControlData:
Expand All @@ -536,7 +520,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 16
m_ControlData:
Expand All @@ -557,7 +540,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 2
m_ControlData:
Expand All @@ -578,7 +560,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: TrackedObject
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 8
m_ControlData:
Expand Down
4 changes: 0 additions & 4 deletions Action Maps/UIActions.asset
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 24e5bc088c9caeb44bc4283dc321b033, type: 3}
m_Name: UIActions
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_Actions:
- {fileID: 114000012573131854}
- {fileID: 114000010783367338}
Expand Down Expand Up @@ -66,7 +65,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: VerticalScroll
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 1
m_ControlData:
Expand All @@ -87,7 +85,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: HorizontalScroll
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 2
m_ControlData:
Expand All @@ -108,7 +105,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3}
m_Name: UIActions
m_EditorClassIdentifier:
m_RunInEditMode: 0
m_ActionMap: {fileID: 11400000}
m_ActionIndex: 0
m_ControlData:
Expand Down
6 changes: 3 additions & 3 deletions Actions/Clone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
namespace UnityEditor.Experimental.EditorVR.Actions
{
[ActionMenuItem("Clone", ActionMenuItemAttribute.DefaultActionSectionName, 3)]
sealed class Clone : BaseAction, IUsesSpatialHash
sealed class Clone : BaseAction, IUsesSpatialHash, IUsesViewerScale
{
public override void ExecuteAction()
{
var selection = Selection.gameObjects;
var selection = Selection.transforms;
var clones = new GameObject[selection.Length];
var index = 0;
var bounds = ObjectUtils.GetBounds(selection);
Expand All @@ -21,7 +21,7 @@ public override void ExecuteAction()
var cloneTransform = clone.transform;
var cameraTransform = CameraUtils.GetMainCamera().transform;
var viewDirection = cloneTransform.position - cameraTransform.position;
cloneTransform.position = cameraTransform.TransformPoint(Vector3.forward * viewDirection.magnitude)
cloneTransform.position = cameraTransform.TransformPoint(Vector3.forward * viewDirection.magnitude / this.GetViewerScale())
+ cloneTransform.position - bounds.center;
this.AddToSpatialHash(clone);
clones[index++] = clone;
Expand Down
6 changes: 1 addition & 5 deletions Actions/Copy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ sealed class Copy : BaseAction
{
public override void ExecuteAction()
{
//bug (case 451825)
//http://forum.unity3d.com/threads/editorapplication-ExecuteActionmenuitem-dont-include-edit-menu.148215/
//return EditorApplication.ExecuteActionMenuItem("Edit/Copy");

Paste.buffer = Selection.gameObjects;
Paste.buffer = Selection.transforms;
}
}
}
Expand Down
9 changes: 3 additions & 6 deletions Actions/Cut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ sealed class Cut : BaseAction
{
public override void ExecuteAction()
{
//bug (case 451825)
//http://forum.unity3d.com/threads/editorapplication-ExecuteActionmenuitem-dont-include-edit-menu.148215/
//return EditorApplication.ExecuteActionMenuItem("Edit/Cut");

var selection = Selection.gameObjects;
var selection = Selection.transforms;
if (selection != null)
{
foreach (var go in selection)
foreach (var transform in selection)
{
var go = transform.gameObject;
go.hideFlags = HideFlags.HideAndDontSave;
go.SetActive(false);
}
Expand Down
17 changes: 8 additions & 9 deletions Actions/Paste.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
namespace UnityEditor.Experimental.EditorVR.Actions
{
[ActionMenuItem("Paste", ActionMenuItemAttribute.DefaultActionSectionName, 6)]
sealed class Paste : BaseAction, IUsesSpatialHash
sealed class Paste : BaseAction, IUsesSpatialHash, IUsesViewerScale
{
public static GameObject[] buffer
public static Transform[] buffer
{
get
{
Expand All @@ -22,26 +22,25 @@ public static GameObject[] buffer
{
var bounds = ObjectUtils.GetBounds(value);

s_BufferDistance = bounds.size == Vector3.zero ? (bounds.center - CameraUtils.GetMainCamera().transform.position).magnitude : 0f;
s_BufferDistance = bounds.size != Vector3.zero ? (bounds.center - CameraUtils.GetMainCamera().transform.position).magnitude : 0f;
s_BufferDistance /= IUsesViewerScaleMethods.getViewerScale(); // Normalize this value, so if viewer scale changes when pasted
}
}
}
static GameObject[] s_Buffer;
static Transform[] s_Buffer;

static float s_BufferDistance;

public override void ExecuteAction()
{
//return EditorApplication.ExecuteActionMenuItem("Edit/Paste");

if (buffer != null)
{
var pastedGameObjects = new GameObject[buffer.Length];
var index = 0;
var bounds = ObjectUtils.GetBounds(buffer);
foreach (var go in buffer)
foreach (var transform in buffer)
{
var pasted = Instantiate(go);
var pasted = Instantiate(transform.gameObject);
var pastedTransform = pasted.transform;
pasted.hideFlags = HideFlags.None;
var cameraTransform = CameraUtils.GetMainCamera().transform;
Expand All @@ -53,7 +52,7 @@ public override void ExecuteAction()
}

if (pastedGameObjects.Length > 0)
Selection.objects = pastedGameObjects;
Selection.objects = pastedGameObjects;
}
}
}
Expand Down
Loading

0 comments on commit 7254d60

Please sign in to comment.