Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wiki:football_explore [2022/08/01 16:56] – [State Machine] admin | wiki:football_explore [2022/08/01 17:29] (current) – [Football Minigame] admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | --- // | ||
| + | |||
| + | ====== Football Minigame ====== | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | <file | Finsihed Minigame > | ||
| + | This is the finished Minigame for football side minigame in Explore Module! | ||
| + | </ | ||
| ====== Prototyping ====== | ====== Prototyping ====== | ||
| Line 6: | Line 15: | ||
| - | <file | > | + | <file | Prototyping |
| This is the prototype scene of football side minigame, The target of this side minigame people can interact and play it without trying to score. | This is the prototype scene of football side minigame, The target of this side minigame people can interact and play it without trying to score. | ||
| This time I'll using auto/ | This time I'll using auto/ | ||
| Line 142: | Line 151: | ||
| </ | </ | ||
| - | |||
| - | <code CSharp | Full Script> | ||
| - | | ||
| - | |||
| - | public void playParticle() => particle.Play(); | ||
| - | |||
| - | public void footBallDetected() => ballDetected = true; | ||
| - | |||
| - | public void footBallLossDetection() | ||
| - | { | ||
| - | ballDetected = false; | ||
| - | } | ||
| - | |||
| - | private void OnDrawGizmos() | ||
| - | { | ||
| - | Transform cone = coneGizmo.transform; | ||
| - | |||
| - | Gizmos.color = Color.red; | ||
| - | Gizmos.DrawWireCube(cone.transform.position, | ||
| - | |||
| - | |||
| - | //float x = UnityEngine.Random.Range(cone.transform.position.x, | ||
| - | //float z = UnityEngine.Random.Range(cone.transform.position.z, | ||
| - | |||
| - | //float randX = UnityEngine.Random.Range(-rangeX, | ||
| - | //float randZ = UnityEngine.Random.Range(-rangeZ, | ||
| - | |||
| - | // | ||
| - | //float xZ = cone.transform.position.x + (int)Math.Round((decimal)randX) / 2; | ||
| - | //float zZ = cone.transform.position.z + (int)Math.Round((decimal)randZ) / 2; | ||
| - | // | ||
| - | } | ||
| - | |||
| - | public void resetBall() | ||
| - | { | ||
| - | ball.transform.position = ballResetPosition.position; | ||
| - | |||
| - | //Stop Moving/ | ||
| - | ball.GetComponent< | ||
| - | |||
| - | //Stop rotating | ||
| - | ball.GetComponent< | ||
| - | |||
| - | createCone(); | ||
| - | } | ||
| - | |||
| - | public bool getFootBallStatus() | ||
| - | { | ||
| - | return ballDetected; | ||
| - | } | ||
| - | |||
| - | private List< | ||
| - | [Button] | ||
| - | public void createCone() | ||
| - | { | ||
| - | if (newItemList != null) | ||
| - | { | ||
| - | foreach (var item in newItemList) | ||
| - | { | ||
| - | Destroy(item); | ||
| - | } | ||
| - | } | ||
| - | |||
| - | for (int i = 0; i < 6; i++) | ||
| - | { | ||
| - | Transform cone = coneGizmo.transform; | ||
| - | |||
| - | float randX = UnityEngine.Random.Range(-rangeX, | ||
| - | float randZ = UnityEngine.Random.Range(-rangeZ, | ||
| - | |||
| - | float x = cone.transform.position.x + (int)Math.Round((decimal)randX) / 2; | ||
| - | float z = cone.transform.position.z + (int)Math.Round((decimal)randZ) / 2; | ||
| - | |||
| - | var newPos = new Vector3(x, cone.transform.position.y, | ||
| - | |||
| - | var newItem = Instantiate(conePrefab, | ||
| - | newItem.transform.SetParent(cone); | ||
| - | newItem.transform.position = newPos; | ||
| - | |||
| - | newItemList.Add(newItem); | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | |||