Skip to content

Commit ee771d7

Browse files
Merge pull request #15 from karimfarahat/AhmedMustafa40-15637
Fixed fruit position
2 parents edc4ce7 + d12dbf3 commit ee771d7

7 files changed

Lines changed: 93 additions & 13 deletions

File tree

Project 2/Assets/Scenes/SampleScene.unity

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,36 @@ RectTransform:
757757
m_AnchoredPosition: {x: 0, y: 0}
758758
m_SizeDelta: {x: 0, y: 0}
759759
m_Pivot: {x: 0, y: 0}
760+
--- !u!1 &498196849
761+
GameObject:
762+
m_ObjectHideFlags: 0
763+
m_CorrespondingSourceObject: {fileID: 0}
764+
m_PrefabInstance: {fileID: 0}
765+
m_PrefabAsset: {fileID: 0}
766+
serializedVersion: 6
767+
m_Component:
768+
- component: {fileID: 498196850}
769+
m_Layer: 0
770+
m_Name: FruitPosOut
771+
m_TagString: Untagged
772+
m_Icon: {fileID: 0}
773+
m_NavMeshLayer: 0
774+
m_StaticEditorFlags: 0
775+
m_IsActive: 1
776+
--- !u!4 &498196850
777+
Transform:
778+
m_ObjectHideFlags: 0
779+
m_CorrespondingSourceObject: {fileID: 0}
780+
m_PrefabInstance: {fileID: 0}
781+
m_PrefabAsset: {fileID: 0}
782+
m_GameObject: {fileID: 498196849}
783+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
784+
m_LocalPosition: {x: -20.8, y: -1.82, z: 7.32}
785+
m_LocalScale: {x: 1, y: 1, z: 1}
786+
m_Children: []
787+
m_Father: {fileID: 0}
788+
m_RootOrder: 19
789+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
760790
--- !u!1 &566610934
761791
GameObject:
762792
m_ObjectHideFlags: 0
@@ -945,6 +975,7 @@ MonoBehaviour:
945975
pineapple: {fileID: 1659812597}
946976
fruitPos: {fileID: 1153133982}
947977
fruitPosG: {fileID: 1476895269}
978+
fruitPosOut: {fileID: 498196849}
948979
--- !u!1 &639813133
949980
GameObject:
950981
m_ObjectHideFlags: 0
@@ -2966,7 +2997,7 @@ RectTransform:
29662997
m_PrefabAsset: {fileID: 0}
29672998
m_GameObject: {fileID: 2035810166}
29682999
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
2969-
m_LocalPosition: {x: 0, y: 0, z: 2}
3000+
m_LocalPosition: {x: 0, y: 0, z: -1}
29703001
m_LocalScale: {x: 1, y: 1, z: 1}
29713002
m_Children:
29723003
- {fileID: 1685737090}
@@ -2975,7 +3006,7 @@ RectTransform:
29753006
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
29763007
m_AnchorMin: {x: 0.5, y: 0}
29773008
m_AnchorMax: {x: 0.5, y: 0}
2978-
m_AnchoredPosition: {x: 0, y: 1}
3009+
m_AnchoredPosition: {x: 0, y: 36}
29793010
m_SizeDelta: {x: 160, y: 30}
29803011
m_Pivot: {x: 0.5, y: 0}
29813012
--- !u!114 &2035810168

Project 2/Assets/Scripts/CollisionNeedle.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class CollisionNeedle : MonoBehaviour
2121
public GameObject pineapple;
2222
public GameObject fruitPos;
2323
public GameObject fruitPosG;
24+
public GameObject fruitPosOut;
2425
// Start is called before the first frame update
2526
void Start()
2627
{
@@ -50,9 +51,47 @@ public void openPanel(string title, string desc, GameObject fruit)
5051

5152
}
5253
}
54+
public void closePanel ()
55+
{
56+
if(guava.transform.position == fruitPosG.transform.position)
57+
{
58+
guava.transform.position = fruitPosOut.transform.position;
59+
60+
}else if(apple.transform.position == fruitPos.transform.position) {
61+
62+
apple.transform.position = fruitPosOut.transform.position;
63+
}
64+
else if (pineapple.transform.position == fruitPos.transform.position)
65+
{
66+
67+
pineapple.transform.position = fruitPosOut.transform.position;
68+
}
69+
else if (milk.transform.position == fruitPos.transform.position)
70+
{
71+
72+
milk.transform.position = fruitPosOut.transform.position;
73+
}
74+
else if (mango.transform.position == fruitPos.transform.position)
75+
{
76+
77+
mango.transform.position = fruitPosOut.transform.position;
78+
}
79+
else if (blackberry.transform.position == fruitPos.transform.position)
80+
{
81+
82+
blackberry.transform.position = fruitPosOut.transform.position;
83+
}
84+
else
85+
{
86+
87+
orange.transform.position = fruitPosOut.transform.position;
88+
}
89+
90+
}
5391
public void spinAgain()
5492
{
5593
panel.SetActive(false);
94+
closePanel();
5695
}
5796

5897
private void OnTriggerEnter(Collider other)

Project 2/Assets/Scripts/WheelController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class WheelController : MonoBehaviour
77
public GameObject Wheel;
88
public GameObject Needle;
99

10-
10+
1111
public float genSpeed;
1212
public float subSpeed;
1313
public bool isSpinning = false;

Project 2/Logs/Packages-Update.log

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,13 @@ The following packages were added:
4444
com.unity.textmeshpro@3.0.1
4545
com.unity.timeline@1.3.6
4646
com.unity.ugui@1.0.0
47+
48+
=== Thu Dec 17 04:24:41 2020
49+
50+
Packages were changed.
51+
Update Mode: updateDependencies
52+
53+
The following packages were updated:
54+
com.unity.ide.visualstudio from version 2.0.3 to 2.0.5
55+
com.unity.ide.vscode from version 1.2.2 to 1.2.3
56+
com.unity.test-framework from version 1.1.18 to 1.1.19

Project 2/Packages/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"dependencies": {
33
"com.unity.collab-proxy": "1.3.9",
44
"com.unity.ide.rider": "1.2.1",
5-
"com.unity.ide.visualstudio": "2.0.3",
6-
"com.unity.ide.vscode": "1.2.2",
7-
"com.unity.test-framework": "1.1.18",
5+
"com.unity.ide.visualstudio": "2.0.5",
6+
"com.unity.ide.vscode": "1.2.3",
7+
"com.unity.test-framework": "1.1.19",
88
"com.unity.textmeshpro": "3.0.1",
99
"com.unity.timeline": "1.3.6",
1010
"com.unity.ugui": "1.0.0",

Project 2/Packages/packages-lock.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"url": "https://packages.unity.com"
99
},
1010
"com.unity.ext.nunit": {
11-
"version": "1.0.0",
11+
"version": "1.0.5",
1212
"depth": 1,
1313
"source": "registry",
1414
"dependencies": {},
@@ -24,25 +24,25 @@
2424
"url": "https://packages.unity.com"
2525
},
2626
"com.unity.ide.visualstudio": {
27-
"version": "2.0.3",
27+
"version": "2.0.5",
2828
"depth": 0,
2929
"source": "registry",
3030
"dependencies": {},
3131
"url": "https://packages.unity.com"
3232
},
3333
"com.unity.ide.vscode": {
34-
"version": "1.2.2",
34+
"version": "1.2.3",
3535
"depth": 0,
3636
"source": "registry",
3737
"dependencies": {},
3838
"url": "https://packages.unity.com"
3939
},
4040
"com.unity.test-framework": {
41-
"version": "1.1.18",
41+
"version": "1.1.19",
4242
"depth": 0,
4343
"source": "registry",
4444
"dependencies": {
45-
"com.unity.ext.nunit": "1.0.0",
45+
"com.unity.ext.nunit": "1.0.5",
4646
"com.unity.modules.imgui": "1.0.0",
4747
"com.unity.modules.jsonserialize": "1.0.0"
4848
},
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
m_EditorVersion: 2020.1.12f1
2-
m_EditorVersionWithRevision: 2020.1.12f1 (55b56f0a86e3)
1+
m_EditorVersion: 2020.1.17f1
2+
m_EditorVersionWithRevision: 2020.1.17f1 (9957aee8edc2)

0 commit comments

Comments
 (0)