Skip to content

Commit

Permalink
Rotate Meteor + fix position bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SUPEZ committed Jan 22, 2021
1 parent 840b4a1 commit 206536e
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 66 deletions.
4 changes: 2 additions & 2 deletions Prototype/Assets/Prefabs/goodSmile2.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1111747923641672}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1.519425, y: 1.4104863, z: 0}
m_LocalPosition: {x: 1.519425, y: 1.426, z: 0}
m_LocalScale: {x: 0.2, y: 0.2, z: 0.20000002}
m_Children:
- {fileID: 4575707645286520}
Expand All @@ -85,7 +85,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1977251435392318}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: -3}
m_LocalScale: {x: 3, y: 3, z: 3}
m_Children: []
m_Father: {fileID: 4256888377001252}
Expand Down
2 changes: 1 addition & 1 deletion Prototype/Assets/Scenes/Play.unity
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ MonoBehaviour:
goodSmile: {fileID: 1111747923641672, guid: 7d181943fa45fee4d934b0f420862447, type: 2}
score: {fileID: 2067009725}
cntScore: 0
randomGold: 0
GoldBoundsMultiplier: 10
semaphoreForSpawn: 1
semaphoreForSpeed: 1
--- !u!4 &809035884
Expand Down
37 changes: 32 additions & 5 deletions Prototype/Assets/Scripts/CntrlSmile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class CntrlSmile : MonoBehaviour

private float speed, tilt;
private Vector3 target;
private Vector3 rotateOrientation;
private int localScore = 0;
private int randomAngerActivator;

Expand All @@ -29,7 +30,7 @@ private void Start()
void Update()
{
transform.position = Vector3.MoveTowards(transform.position, target, Time.deltaTime * speed);
objectGoodSmile.transform.Rotate(Vector3.back * tilt);
objectGoodSmile.transform.Rotate(rotateOrientation * tilt);
if (localScore % randomAngerActivator == 0 && localScore != 0)
{
isAnger = true;
Expand Down Expand Up @@ -107,6 +108,7 @@ void OnMouseUpAsButton()
gameController.cntScore += 1;
localScore += 1;
}

if (gameController.semaphoreForSpawn == false)
{
gameController.semaphoreForSpawn = true;
Expand All @@ -115,28 +117,53 @@ void OnMouseUpAsButton()
{
gameController.semaphoreForSpeed = true;
}

ChangeTarget();

}

private void ChangeTarget()// смена конечной точки
{
//Координаты
if (gameObject.transform.position.x >= 0 && gameObject.transform.position.y >= 0)
{
target = new Vector3(Random.Range(-10, 1) * 100, Random.Range(-10, 1) * 100, 0);
target = new Vector3(Random.Range(-10f, 1f) * 100f, Random.Range(-10f,-1f) * 100f, 0);
}
else if (gameObject.transform.position.x < 0 && gameObject.transform.position.y >= 0)
{
target = new Vector3(Random.Range(1, 10) * 100, Random.Range(-10, 1) * 100, 0);
target = new Vector3(Random.Range(1f, 10f) * 100f, Random.Range(-10f, -1f) * 100f, 0);
}
else if (gameObject.transform.position.x < 0 && gameObject.transform.position.y < 0)
{
target = new Vector3(Random.Range(1, 10) * 100, Random.Range(1, 10) * 100, 0);
target = new Vector3(Random.Range(1f, 10f) * 100f, Random.Range(1f, 10f) * 100f, 0f);
}
else if (gameObject.transform.position.x >= 0 && gameObject.transform.position.y < 0)
{
target = new Vector3(Random.Range(-10, 1) * 100, Random.Range(1, 10) * 100, 0);
target = new Vector3(Random.Range(-10f, -1f) * 100f, Random.Range(1f, 10f) * 100f, 0);
}
//Поворот
rotateOrientation = RandomRotate();
}

private Vector3 RandomRotate()
{
var randomCnt = Random.Range(1, 6);
switch (randomCnt)
{
case 1:
return Vector3.back;
case 2:
return Vector3.forward;
case 3:
return Vector3.down;
case 4:
return Vector3.up;
case 5:
return Vector3.left;
case 6:
return Vector3.right;
}
return Vector3.zero;
}

private void SoundEffect(AudioSource sourceSound)
Expand Down
58 changes: 29 additions & 29 deletions Prototype/Library/CurrentLayout.dwlt
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ MonoBehaviour:
y: 30
width: 1920
height: 947
m_MinSize: {x: 885, y: 342}
m_MaxSize: {x: 16010, y: 8042}
m_MinSize: {x: 885, y: 492}
m_MaxSize: {x: 16010, y: 14042}
vertical: 0
controlID: 87
controlID: 79
--- !u!114 &4
MonoBehaviour:
m_ObjectHideFlags: 52
Expand Down Expand Up @@ -139,15 +139,15 @@ MonoBehaviour:
y: 607
width: 1561
height: 340
m_MinSize: {x: 100, y: 100}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 22}
m_MinSize: {x: 232, y: 271}
m_MaxSize: {x: 10002, y: 10021}
m_ActualView: {fileID: 17}
m_Panes:
- {fileID: 17}
- {fileID: 22}
- {fileID: 15}
- {fileID: 13}
m_Selected: 1
m_Selected: 0
m_LastSelected: 2
--- !u!114 &7
MonoBehaviour:
Expand Down Expand Up @@ -233,10 +233,10 @@ MonoBehaviour:
y: 0
width: 1561
height: 947
m_MinSize: {x: 610, y: 342}
m_MaxSize: {x: 12010, y: 8042}
m_MinSize: {x: 610, y: 492}
m_MaxSize: {x: 12010, y: 14042}
vertical: 1
controlID: 88
controlID: 80
--- !u!114 &11
MonoBehaviour:
m_ObjectHideFlags: 52
Expand All @@ -261,7 +261,7 @@ MonoBehaviour:
m_MinSize: {x: 610, y: 221}
m_MaxSize: {x: 12010, y: 4021}
vertical: 0
controlID: 89
controlID: 81
--- !u!114 &12
MonoBehaviour:
m_ObjectHideFlags: 52
Expand Down Expand Up @@ -316,7 +316,7 @@ MonoBehaviour:
m_PersistentViewDataDictionary: {fileID: 0}
m_MixersTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 842a0000
m_SelectedIDs:
m_LastClickedID: 10884
m_ExpandedIDs: 12eb343c
m_RenameOverlay:
Expand Down Expand Up @@ -560,20 +560,20 @@ MonoBehaviour:
m_ShowAllHits: 0
m_SearchArea: 1
m_Folders:
- Assets/Scripts
- Assets/Prefabs
m_ViewMode: 1
m_StartGridSize: 64
m_LastFolders:
- Assets/Scripts
- Assets/Prefabs
m_LastFoldersGridSize: -1
m_LastProjectPath: D:\Documents\Prototype\Prototype
m_LockTracker:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 002d0000
m_LastClickedID: 11520
m_ExpandedIDs: 00000000f2290000042c000000ca9a3b
m_SelectedIDs: 722c0000
m_LastClickedID: 11378
m_ExpandedIDs: 00000000f2290000062c000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
Expand Down Expand Up @@ -601,7 +601,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 00000000f2290000042c0000
m_ExpandedIDs: 00000000f2290000062c0000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
Expand Down Expand Up @@ -719,21 +719,21 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 54cefeff84edfeff0403ffff2a77ffffda8affffe4fbffff00000000b62d0000
m_ExpandedIDs: b6e8feff7c57ffff186fffff94cfffffe4fbffff00000000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
m_OriginalName:
m_Name: goodSmile2
m_OriginalName: goodSmile2
m_EditFieldRect:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
m_UserData: 0
m_UserData: -12396
m_IsWaitingForDelay: 0
m_IsRenaming: 0
m_OriginalEventType: 11
m_OriginalEventType: 0
m_IsRenamingFilename: 0
m_ClientGUIView: {fileID: 5}
m_SearchString:
Expand Down Expand Up @@ -768,14 +768,14 @@ MonoBehaviour:
height: 586
m_PersistentViewDataDictionary: {fileID: 0}
m_SceneLighting: 0
lastFramingTime: 745.2723916
lastFramingTime: 574.0630027
m_2DMode: 1
m_isRotationLocked: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: 0.43371198, y: 1.4609175, z: -1.2695312}
m_Target: {x: 3.5501869, y: -0.5706472, z: 0.5675564}
speed: 2
m_Value: {x: 0.43371198, y: 1.4609175, z: -1.2695312}
m_Value: {x: 3.5501869, y: -0.5706472, z: 0.5675564}
m_RenderMode: 2
m_CameraMode:
drawMode: 2
Expand Down Expand Up @@ -807,15 +807,15 @@ MonoBehaviour:
speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 11.114638
m_Target: 12.939974
speed: 2
m_Value: 11.114638
m_Value: 12.939974
m_Ortho:
m_Target: 1
speed: 2
m_Value: 1
m_ShowGlobalGrid: 1
m_LastSceneViewRotation: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226}
m_LastSceneViewRotation: {x: 0.13664041, y: 0.5860591, z: -0.10120575, w: 0.7922258}
m_LastSceneViewOrtho: 0
m_ReplacementShader: {fileID: 0}
m_ReplacementString:
Expand Down
2 changes: 1 addition & 1 deletion Prototype/Library/LastSceneManagerSetup.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sceneSetups:
- path: Assets/Scenes/Main menu.unity
- path: Assets/Scenes/Play.unity
isLoaded: 1
isActive: 1
Binary file modified Prototype/Library/ScriptAssemblies/Assembly-CSharp.dll
Binary file not shown.
Binary file modified Prototype/Library/assetDatabase3
Binary file not shown.
Binary file modified Prototype/Library/metadata/fa/fadd07783bf438e41bd40dc68e79337c
Binary file not shown.
28 changes: 0 additions & 28 deletions Prototype/Library/shadercompiler-UnityShaderCompiler.exe0.log
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,3 @@ Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler

0 comments on commit 206536e

Please sign in to comment.