Formatting scripts
This commit is contained in:
Родитель
9535220ba8
Коммит
856e2ab85d
|
@ -70,7 +70,7 @@ namespace HoloToolkit.Unity.ControllerExamples
|
|||
{
|
||||
set
|
||||
{
|
||||
width = Mathf.Clamp01 (value);
|
||||
width = Mathf.Clamp01(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
using HoloToolkit.Unity.Controllers;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.WSA.Input;
|
||||
|
@ -64,7 +63,7 @@ namespace HoloToolkit.Unity.ControllerExamples
|
|||
private bool draw = false;
|
||||
private float width = 0f;
|
||||
private float lastPointAddedTime = 0f;
|
||||
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
// Locate the ColorPickerWheel
|
||||
|
|
|
@ -212,7 +212,7 @@ namespace HoloToolkit.Unity.ControllerExamples
|
|||
if (obj.state.selectPressedAmount >= selectPressedDrawThreshold)
|
||||
{
|
||||
activeBrush.Draw = true;
|
||||
activeBrush.Width = ProcessSelectPressedAmount (obj.state.selectPressedAmount);
|
||||
activeBrush.Width = ProcessSelectPressedAmount(obj.state.selectPressedAmount);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -238,7 +238,7 @@ namespace HoloToolkit.Unity.ControllerExamples
|
|||
touchpadRenderer.material = touchpadMaterial;
|
||||
touchpadRenderer.enabled = true;
|
||||
}
|
||||
|
||||
|
||||
// Subscribe to input now that we're parented under the controller
|
||||
InteractionManager.InteractionSourceUpdated += InteractionSourceUpdated;
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ namespace HoloToolkit.Unity.ControllerExamples
|
|||
InteractionManager.InteractionSourceUpdated -= InteractionSourceUpdated;
|
||||
}
|
||||
|
||||
private float ProcessSelectPressedAmount (float selectPressedAmount)
|
||||
private float ProcessSelectPressedAmount(float selectPressedAmount)
|
||||
{
|
||||
float selectPressedProcessed = Mathf.Clamp01(selectWidthCurve.Evaluate(selectPressedAmount - selectPressedStartValue / (1f - selectPressedStartValue)));
|
||||
selectPressedSmooth = Mathf.Lerp(selectPressedSmooth, selectPressedProcessed, Time.deltaTime * 5);
|
||||
|
|
|
@ -106,7 +106,7 @@ namespace HoloToolkit.Unity.ControllerExamples
|
|||
selectedColor.a = 1f;
|
||||
}
|
||||
// Set the selector's color and blend it with white to make it visible on top of the wheel
|
||||
selectorRenderer.material.color = Color.Lerp (selectedColor, Color.white, 0.5f);
|
||||
selectorRenderer.material.color = Color.Lerp(selectedColor, Color.white, 0.5f);
|
||||
}
|
||||
|
||||
protected override void OnAttachToController()
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace HoloToolkit.Unity.Design
|
|||
|
||||
[Header("Object Placement")]
|
||||
public LineUtils.StepModeEnum StepMode = LineUtils.StepModeEnum.Interpolated;
|
||||
|
||||
|
||||
[SerializeField]
|
||||
private LineBase source;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace HoloToolkit.Unity.Design
|
|||
public int MaxLineSteps = 2048;
|
||||
|
||||
public AnimationCurve StepLengthCurve = AnimationCurve.Linear(0f, 1f, 1f, 0.5f);
|
||||
|
||||
|
||||
[SerializeField]
|
||||
protected LineBase source;
|
||||
public virtual LineBase Target
|
||||
|
|
|
@ -156,7 +156,7 @@ namespace HoloToolkit.Unity.ControllerExamples
|
|||
state = StateEnum.Idle;
|
||||
yield break;
|
||||
}
|
||||
|
||||
|
||||
private void InteractionSourcePressed(InteractionSourcePressedEventArgs obj)
|
||||
{
|
||||
// Check handedness, see if it is left controller
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace HoloToolkit.Unity.Controllers
|
|||
{
|
||||
get { return pointer; }
|
||||
}
|
||||
|
||||
|
||||
[SerializeField]
|
||||
protected float sizeOnScreen = 0.015f;
|
||||
[SerializeField]
|
||||
|
@ -61,14 +61,15 @@ namespace HoloToolkit.Unity.Controllers
|
|||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < renderers.Length; i++) {
|
||||
for (int i = 0; i < renderers.Length; i++)
|
||||
{
|
||||
// TODO figure out gradient - it may have transparency
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
renderers[i].material.color = pointer.GetColor(pointer.TargetResult).Evaluate(0.5f);
|
||||
}
|
||||
renderers[i].enabled = pointer.TargetResult != PointerSurfaceResultEnum.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче