Commit 1acb95d7 authored by Danial KordModanlou's avatar Danial KordModanlou

vibrate system updated

parent f2d4261e
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<project version="4"> <project version="4">
<component name="ContentModelStore"> <component name="ContentModelStore">
<e p="C:\Users\Lenovo\.Rider2019.1\system\extResources" t="IncludeRecursive" /> <e p="C:\Users\Lenovo\.Rider2019.1\system\extResources" t="IncludeRecursive" />
<e p="C:\Users\Lenovo\.Rider2019.1\system\resharper-host\local\Transient\ReSharperHost\v191\SolutionCaches\_car-sim-remaster.1598272308.00" t="ExcludeRecursive" /> <e p="C:\Users\Lenovo\.Rider2019.1\system\resharper-host\local\Transient\ReSharperHost\v191\SolutionCaches\_car-sim-remaster.545966568.00" t="ExcludeRecursive" />
<e p="D:\Projects\Unity\Main\KK\car-sim-remaster" t="IncludeRecursive"> <e p="D:\Projects\Unity\Main\KK\test\car-sim-remaster" t="IncludeRecursive">
<e p="Assembly-CSharp-Editor-firstpass.csproj" t="IncludeRecursive" /> <e p="Assembly-CSharp-Editor-firstpass.csproj" t="IncludeRecursive" />
<e p="Assembly-CSharp-Editor.csproj" t="IncludeRecursive" /> <e p="Assembly-CSharp-Editor.csproj" t="IncludeRecursive" />
<e p="Assembly-CSharp-firstpass.csproj" t="IncludeRecursive" /> <e p="Assembly-CSharp-firstpass.csproj" t="IncludeRecursive" />
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -166,6 +166,50 @@ AudioListener: ...@@ -166,6 +166,50 @@ AudioListener:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1313670780} m_GameObject: {fileID: 1313670780}
m_Enabled: 0 m_Enabled: 0
--- !u!1 &1475102662
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1475102663}
- component: {fileID: 1475102664}
m_Layer: 0
m_Name: Trriger (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1475102663
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1475102662}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.523, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 6517492368537500524}
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &1475102664
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1475102662}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1.9673462, y: 1.7052002, z: 4.597786}
m_Center: {x: 0.06185913, y: 0.18908691, z: 0.00059890747}
--- !u!1 &1858462252 --- !u!1 &1858462252
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -4543,6 +4587,7 @@ Transform: ...@@ -4543,6 +4587,7 @@ Transform:
- {fileID: 6517492369237765336} - {fileID: 6517492369237765336}
- {fileID: 6517492368633367083} - {fileID: 6517492368633367083}
- {fileID: 6517492369280401615} - {fileID: 6517492369280401615}
- {fileID: 1475102663}
m_Father: {fileID: 6517492368474291627} m_Father: {fileID: 6517492368474291627}
m_RootOrder: 2 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......
...@@ -32,6 +32,7 @@ public class ShoulderVibrate : MonoBehaviour ...@@ -32,6 +32,7 @@ public class ShoulderVibrate : MonoBehaviour
{ {
if (carRigid.velocity.magnitude * 3.6f > minSpeed && shoulderOn == 1) if (carRigid.velocity.magnitude * 3.6f > minSpeed && shoulderOn == 1)
{ {
print("vibrate");
transform.Rotate(transform.forward,(UnityEngine.Random.Range(-1.5f, 1.5f) ) * (power + speedMultiply * carRigid.velocity.magnitude) * Time.deltaTime); transform.Rotate(transform.forward,(UnityEngine.Random.Range(-1.5f, 1.5f) ) * (power + speedMultiply * carRigid.velocity.magnitude) * Time.deltaTime);
} }
......
...@@ -8,9 +8,10 @@ public class Side : MonoBehaviour ...@@ -8,9 +8,10 @@ public class Side : MonoBehaviour
// Start is called before the first frame update // Start is called before the first frame update
/*
private void OnCollisionEnter(Collision other) private void OnCollisionEnter(Collision other)
{ {
print("hi");
if (other.transform.root.tag == "Player") if (other.transform.root.tag == "Player")
{ {
other.transform.root.GetComponent<ShoulderVibrate>().shoulderOn = 1; other.transform.root.GetComponent<ShoulderVibrate>().shoulderOn = 1;
...@@ -31,9 +32,38 @@ public class Side : MonoBehaviour ...@@ -31,9 +32,38 @@ public class Side : MonoBehaviour
private void OnCollisionStay(Collision collider) private void OnCollisionStay(Collision collider)
{ {
// Debug.Log("col"); // Debug.Log("col");
print(collider.transform.name);
if (collider.transform.root.tag == "Player") if (collider.transform.root.tag == "Player")
{ {
collider.transform.root.GetComponent<ShoulderVibrate>().shoulderOn = 1; collider.transform.root.GetComponent<ShoulderVibrate>().shoulderOn = 1;
} }
} }
*/
private void OnTriggerEnter(Collider other)
{
print(other.transform.name);
if (other.transform.root.tag == "Player")
{
other.transform.root.GetComponent<ShoulderVibrate>().shoulderOn = 1;
}
}
private void OnTriggerExit(Collider other)
{
print(other.transform.name);
if (other.transform.root.tag == "Player")
{
other.transform.root.GetComponent<ShoulderVibrate>().shoulderOn = 0;
}
}
private void OnTriggerStay(Collider other)
{
print(other.transform.name);
print(other.transform.name);
if (other.transform.root.tag == "Player")
{
other.transform.root.GetComponent<ShoulderVibrate>().shoulderOn = 1;
}
}
} }
\ No newline at end of file
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