Commit 224ba164 authored by Tania Rubach Holst's avatar Tania Rubach Holst
Browse files

add highlight on selected

parent 30546ea1
......@@ -66,7 +66,9 @@ Material:
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _OutlineThickness: 0.005
- _Parallax: 0.02
- _Smoothness: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
......@@ -75,3 +77,4 @@ Material:
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _OutlineColor: {r: 1, g: 1, b: 1, a: 1}
This diff is collapsed.
......@@ -73,5 +73,5 @@ Material:
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 0.5935783, b: 0.3726415, a: 1}
- _EmissionColor: {r: 1, g: 0.5587921, b: 0, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 1, g: 0.8892157, b: 0.75, a: 1}
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8598744590128899134
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8598744590128899130}
- component: {fileID: 8598744590128899131}
- component: {fileID: 8598744590128899128}
- component: {fileID: 8598744590128899129}
m_Layer: 0
m_Name: SelectableObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8598744590128899130
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8598744590128899134}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 3615920370279813819}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8598744590128899131
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8598744590128899134}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a34e18e59c7402c4ab54035fb4b1a4c3, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &8598744590128899128
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8598744590128899134}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aa584fbee541324448dd18d8409c7a41, type: 3}
m_Name:
m_EditorClassIdentifier:
ObservedComponentsFoldoutOpen: 1
Group: 0
prefixField: -1
Synchronization: 3
OwnershipTransfer: 1
ObservedComponents:
- {fileID: 8598744590128899129}
viewIdField: 0
InstantiationId: 0
isRuntimeInstantiated: 0
--- !u!114 &8598744590128899129
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8598744590128899134}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8efc6b1d64977384eb3405357896c656, type: 3}
m_Name:
m_EditorClassIdentifier:
m_PositionModel:
SynchronizeEnabled: 1
TeleportEnabled: 1
TeleportIfDistanceGreaterThan: 3
InterpolateOption: 2
InterpolateMoveTowardsSpeed: 1
InterpolateLerpSpeed: 1
ExtrapolateOption: 0
ExtrapolateSpeed: 1
ExtrapolateIncludingRoundTripTime: 1
ExtrapolateNumberOfStoredPositions: 1
m_RotationModel:
SynchronizeEnabled: 1
InterpolateOption: 1
InterpolateRotateTowardsSpeed: 180
InterpolateLerpSpeed: 5
m_ScaleModel:
SynchronizeEnabled: 1
InterpolateOption: 0
InterpolateMoveTowardsSpeed: 1
InterpolateLerpSpeed: 0
--- !u!1001 &8598744590905325985
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 8598744590128899130}
m_Modifications:
- target: {fileID: -927199367670048503, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_Name
value: Cowgirl
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalPosition.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -2416733968201007103, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 944ce024f1fd16c4492a30a4a7b6b410, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 32794dcb34c91444883c5305eba167e9, type: 3}
--- !u!4 &3615920370279813819 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
m_PrefabInstance: {fileID: 8598744590905325985}
m_PrefabAsset: {fileID: 0}
fileFormatVersion: 2
guid: 864eb2317986b524ea847b0a53487841
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -220,86 +220,6 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 32686994}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &66253412
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1010446335}
m_Modifications:
- target: {fileID: -927199367670048503, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_Name
value: Cowgirl
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalPosition.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -2416733968201007103, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 944ce024f1fd16c4492a30a4a7b6b410, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 32794dcb34c91444883c5305eba167e9, type: 3}
--- !u!4 &66253413 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: 32794dcb34c91444883c5305eba167e9,
type: 3}
m_PrefabInstance: {fileID: 66253412}
m_PrefabAsset: {fileID: 0}
--- !u!1 &89790557
GameObject:
m_ObjectHideFlags: 0
......@@ -907,107 +827,6 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 827125061}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1010446331
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1010446335}
- component: {fileID: 1010446334}
- component: {fileID: 1010446333}
- component: {fileID: 1010446332}
m_Layer: 0
m_Name: CowboyGirl
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1010446332
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1010446331}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8efc6b1d64977384eb3405357896c656, type: 3}
m_Name:
m_EditorClassIdentifier:
m_PositionModel:
SynchronizeEnabled: 1
TeleportEnabled: 1
TeleportIfDistanceGreaterThan: 3
InterpolateOption: 2
InterpolateMoveTowardsSpeed: 1
InterpolateLerpSpeed: 1
ExtrapolateOption: 0
ExtrapolateSpeed: 1
ExtrapolateIncludingRoundTripTime: 1
ExtrapolateNumberOfStoredPositions: 1
m_RotationModel:
SynchronizeEnabled: 1
InterpolateOption: 1
InterpolateRotateTowardsSpeed: 180
InterpolateLerpSpeed: 5
m_ScaleModel:
SynchronizeEnabled: 1
InterpolateOption: 0
InterpolateMoveTowardsSpeed: 1
InterpolateLerpSpeed: 0
--- !u!114 &1010446333
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1010446331}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aa584fbee541324448dd18d8409c7a41, type: 3}
m_Name:
m_EditorClassIdentifier:
ObservedComponentsFoldoutOpen: 1
Group: 0
prefixField: -1
Synchronization: 3
OwnershipTransfer: 1
ObservedComponents:
- {fileID: 1010446332}
viewIdField: 9
InstantiationId: 0
isRuntimeInstantiated: 0
--- !u!114 &1010446334
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1010446331}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a34e18e59c7402c4ab54035fb4b1a4c3, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1010446335
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1010446331}
m_LocalRotation: {x: 0, y: -0.8573919, z: 0, w: 0.5146641}
m_LocalPosition: {x: 0.897, y: -0.74, z: 1.398}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 66253413}
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: -118.05, z: 0}
--- !u!1 &1077539459
GameObject:
m_ObjectHideFlags: 0
......@@ -1376,3 +1195,77 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1c823f8a93420a445932cc61d30f8141, type: 3}
--- !u!1001 &8598744590864600005
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 8598744590128899134, guid: 864eb2317986b524ea847b0a53487841,
type: 3}
propertyPath: m_Name
value: CowboyGirl
objectReference: {fileID: 0}
- target: {fileID: 8598744590128899130, guid: 864eb2317986b524ea847b0a53487841,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.897
objectReference: {fileID: 0}
- target: {fileID: 8598744590128899130, guid: 864eb2317986b524ea847b0a53487841,
type: 3}
propertyPath: m_LocalPosition.y
value: -0.74
objectReference: {fileID: 0}
- target: {fileID: 8598744590128899130, guid: 864eb2317986b524ea847b0a53487841,
type: 3}
propertyPath: m_LocalPosition.z
value: 1.398
objectReference: {fileID: 0}
- target: {fileID: 8598744590128899130, guid: 864eb2317986b524ea847b0a53487841,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8598744590128899130, guid: 864eb2317986b524ea847b0a53487841,
type: 3}
propertyPath: m_LocalRotation.y
value: -0.8573919
objectReference: {fileID: 0}
- target: {fileID: 8598744590128899130, guid: 864eb2317986b524ea847b0a53487841,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8598744590128899130, guid: 864eb2317986b524ea847b0a53487841,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.5146641
objectReference: {fileID: 0}
- target: {fileID: 8598744590128899130, guid: 864eb2317986b524ea847b0a53487841,
type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 8598744590128899130, guid: 864eb2317986b524ea847b0a53487841,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8598744590128899130, guid: 864eb2317986b524ea847b0a53487841,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -118.05
objectReference: {fileID: 0}
- target: {fileID: 8598744590128899130, guid: 864eb2317986b524ea847b0a53487841,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8598744590128899128, guid: 864eb2317986b524ea847b0a53487841,
type: 3}
propertyPath: viewIdField
value: 9
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 864eb2317986b524ea847b0a53487841, type: 3}
......@@ -334,14 +334,19 @@ namespace com.defaultcompany.photontest
void SelectObject()
{
GameObject newSelection = _selector.GetSelected();
if (newSelection != null)
if(_selection != null)
{
//Debug.Log("Selecting: " + newSelection.name);
_selection = newSelection;
_controlModes[0].SetSelection(_selection);
_controlModes[1].SetSelection(_selection);
_selection.GetComponent<SelectableObject>().OnDeselect();
}
//GameObject newSelection = _selector.GetSelected();
//if (newSelection != null)
//{
//Debug.Log("Selecting: " + newSelection.name);
_selection = _selector.GetSelected();
_controlModes[0].SetSelection(_selection);
_controlModes[1].SetSelection(_selection);
//}
}
#endregion
......
......@@ -41,7 +41,7 @@ public class GizmoConstraints : MonoBehaviourPunCallbacks
_gizmos[0].SetGizmodeActive(true, 0);
_gizmos[1].SetGizmodeActive(false, 0);
_gizmos[2].SetGizmodeActive(false, 0);
Debug.Log(_gizmos.Count);
//Debug.Log(_gizmos.Count);
}
}
......@@ -60,7 +60,7 @@ public class GizmoConstraints : MonoBehaviourPunCallbacks
public int GetGizmode()
{
Debug.Log(_gizmos.Count);
//Debug.Log(_gizmos.Count);
return _gizmode % _gizmos.Count;
}
......
......@@ -15,8 +15,8 @@ public class SelectableObject : MonoBehaviourPun, IPunOwnershipCallbacks
private bool _selected = false;
private Renderer[] _children;
//[SerializeField]
private Shader _outliner;
private Shader _outliner;
private float[] _outline_rgba = new float[4];
void Awake()
{
......@@ -30,6 +30,11 @@ public class SelectableObject : MonoBehaviourPun, IPunOwnershipCallbacks
_outliner = Shader.Find("Interface3/Surface_Outline");
_meshes = GetComponentsInChildren<MeshFilter>();
_children = GetComponentsInChildren<Renderer>();
_outline_rgba[0] = 255f;
_outline_rgba[0] = 255f;
_outline_rgba[0] = 255f;
_outline_rgba[0] = 100f;
foreach (MeshFilter _mf in _meshes)
{
if (_mf && _mf.sharedMesh)
......@@ -70,6 +75,10 @@ public class SelectableObject : MonoBehaviourPun, IPunOwnershipCallbacks
if (_selected)
{
mat.shader = _outliner;
mat.SetFloat("_OutlineThickness", 0.005f);
//mat.SetFloatArray("_Color", _outline_rgba);
mat.SetColor("_OutlineColor", Color.white);
mat.SetFloat("_Smoothness", 0f);
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment