private void ReadyThrow2(masterBallStruct ball) { var myBeamScript = Instantiate(targetingBeamPrefab, Vector3.zero, Quaternion.identity).GetComponent <fielderTargetingLineRenderer>(); myBeamScript.SetUp(ball.myThrowSpeed, ball.myIndex, player.transform, pitcher, (pitcherTarget.position - pitcher.position).normalized); StartCoroutine(ThrowDelay()); }
//Between this and the next comment is entirely setup of variables for the ball list public void AddThisBallToTheList(int Index, int taunt, Transform fielders) { masterBallStruct thisBall = new masterBallStruct(); thisBall.myIndex = Index; thisBall.myTauntLevel = taunt; thisBall.myFielders = new List <Transform>(); thisBall = AssignRemainingVariables(thisBall); thisBall = hUDScript.addBallToTheUI(thisBall); masterBallList.Add(thisBall); }
public masterBallStruct changeBallUISpriteToCorrectColor(masterBallStruct ball, BallResult myResult) { ball.uIObject.GetComponentInChildren <Image>().sprite = BallIconHolder.GetIcon(myResult, ball.myTauntLevel); return(ball); }
public masterBallStruct addBallToTheUI(masterBallStruct ball) { ball.uIObject = Instantiate(ballIconObject, ballIconHolder); ball.uIObject.GetComponentInChildren <Image>().sprite = BallIconHolder.GetIcon(BallResult.UNTHROWN, ball.myTauntLevel); return(ball); }
private masterBallStruct SetType(masterBallStruct thisball) { int myTypeNumber; switch (thisball.myTauntLevel) { case 0: thisball.myType = ballType.STANDARD; return(thisball); case 1: myTypeNumber = Random.Range(0, 3); if (myTypeNumber == 2) { thisball.myType = ballType.ARC; } else { thisball.myType = ballType.STANDARD; } return(thisball); case 2: myTypeNumber = Random.Range(0, 5); if (myTypeNumber == 2 || myTypeNumber == 3) { thisball.myType = ballType.ARC; } else if (myTypeNumber == 4) { thisball.myType = ballType.MULTI; } else { thisball.myType = ballType.STANDARD; } return(thisball); case 3: myTypeNumber = Random.Range(0, 7); if (myTypeNumber == 2 || myTypeNumber == 3) { thisball.myType = ballType.ARC; } else if (myTypeNumber == 4 || myTypeNumber == 5) { thisball.myType = ballType.MULTI; } else if (myTypeNumber == 6) { thisball.myType = ballType.SCATTER; } else { thisball.myType = ballType.STANDARD; } return(thisball); default: myTypeNumber = Random.Range(0, 8); if (myTypeNumber == 2 || myTypeNumber == 3) { thisball.myType = ballType.ARC; } else if (myTypeNumber == 4 || myTypeNumber == 5) { thisball.myType = ballType.MULTI; } else if (myTypeNumber == 6 || myTypeNumber == 7) { thisball.myType = ballType.SCATTER; } else { thisball.myType = ballType.STANDARD; } return(thisball); } }
private masterBallStruct ScatterBallSetup(masterBallStruct thisball) { thisball.myThrowSpeed = 1.2f + (2 / thisball.myTauntLevel + 1); thisball.myReadySpeed = 0.3f + (2 / thisball.myTauntLevel + 1); return(thisball); }
private masterBallStruct StandardBallSetup(masterBallStruct thisball) { thisball.myThrowSpeed = 0.5f + (2 / (thisball.myTauntLevel + 1)); thisball.myReadySpeed = 0.5f + (2 / (thisball.myTauntLevel + 1)); return(thisball); }