Skip to content

Commit 70e31e2

Browse files
l0ftywhizzshreyasiyer14
authored andcommitted
Changed the walk button behaviour, and the size slider script.
1 parent 8798755 commit 70e31e2

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

Assets/Prefabs/Spider.prefab

0 Bytes
Binary file not shown.

Assets/Resources/VuforiaConfiguration.asset

100755100644
-36 Bytes
Binary file not shown.
8 Bytes
Binary file not shown.

Assets/Scripts/ModelController.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ public class ModelController : MonoBehaviour {
88
[SerializeField] private float speed;
99
[SerializeField] private int directionOfWalk;
1010
[SerializeField] private Slider scaleSlider;
11+
1112
private float scale;
12-
private bool isWalking = false;
13+
public bool isWalking = false;
1314
// Use this for initialization
1415
void Start () {
1516

@@ -27,10 +28,16 @@ void Update () {
2728
}
2829

2930
public void modifyScale () {
30-
transform.localScale = new Vector3 (scaleSlider.value, scaleSlider.value, scaleSlider.value);
31+
GameObject[] models = GameObject.FindGameObjectsWithTag (gameObject.tag);
32+
foreach (GameObject model in models) {
33+
model.transform.localScale = new Vector3 (scaleSlider.value, scaleSlider.value, scaleSlider.value);
34+
}
3135
}
3236

3337
public void walkAnimStart () {
34-
isWalking = true;
38+
GameObject[] models = GameObject.FindGameObjectsWithTag (gameObject.tag);
39+
foreach (GameObject model in models) {
40+
model.GetComponent<ModelController> ().isWalking = true;
41+
}
3542
}
3643
}

Assets/Scripts/ModelCountController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ void Update()
4242
{
4343
while (count < value)
4444
{
45-
float radius = 0.1f;
45+
float radius = Random.Range(1,5)/12f;
4646
int angle = Random.Range(0, 360);
4747
Vector3 pos = new Vector3(radius * Mathf.Cos(angle), 0, radius * Mathf.Sin(angle));
48-
GameObject newObj = Object.Instantiate(tem, tobj.position + pos, tobj.rotation, tobj);
48+
GameObject newObj = Object.Instantiate(tem, tem.transform.position + pos, tem.transform.rotation, tobj);
4949
newObj.SetActive(true);
5050
count++;
5151
}

QCAR/somedata16

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
AAAAGRhFRmoOIn2/nCy5Qb/I7KT6wh87HAs2KKyHOVIUHkOwFiI+WWXO2ZAS4JEZ3wsA5aeHggzqqdj2hmaH4XGZFTBv3qgWo7q5DF4IJ1D6xjLS56cLxK4LYlLjEabPp64cqznOuZpmmeW9aunUYIHlQbjdwNDuCSmB3ZcDFmktyLFfd7JLSVF1m9AX/URnNSMiu2yS5Vv9o0Y8IGOq7EoxCkRRMVBeXLQsphBT2EqxBndnapsKT/moaueDBfpEFXfMkadXQZ9tyD5DKBVx47NWbg+YZY8aXsFsxDYBALdRXKXXmtQlqRR97jplVzHFR795E4KMWMV8m5bot+0wYKXNj0A=
1+
AAAAGRBycUT5oDobAZbBAdY4ZjrjNdjef3+Vo06FHBhMOU73Tlfh4c3EwHi++dQPAlN1nbPkFAxNYeaVLlFHhNaMHqJvAe26P4RnpOggo6P+5/b2Gog1fFuPvDgvpzN3lIf3FbDH+BivP7lQZ3SR0XQ6TXrmnCjFjnlSn7yAdhfiHQjWQjbeykwBhFR5oB/BTCUxurodnDLBjW+PhkhZcDPCF9o3V1XC6oTlOh31gG2tg4jFCk4NZfJNx4FjMh2LY5Woc/e2+6LocAF16bL1pMMFRwW6rYXdQuAo9gM4pJ5In0He1mMe0O2btpVDxRBJuFGuiwDELP4tiL7qHSGwEXxXX9g=

0 commit comments

Comments
 (0)