void InsertBlueBall() { GameObject bBall = Instantiate(blueBallPrefab, spawnPoint.transform.position, Quaternion.identity) as GameObject; countBlue++; bBall.name = "Blue" + countBlue; BallChainMovement ballScript = bBall.AddComponent <BallChainMovement> (); ballScript.SetPPS(forwardPercentagePerSecond, backwardPercentagePerSecond); bBall.tag = "Blue"; foreach (GameObject b in ballChain) { //b.GetComponent<BallChainMovement>().moveFlag=false; } // bBall.transform.parent = chain.transform; ballChain.Add(bBall); bBall.transform.parent = balls; // if (ballChain.Count == 1) // { // head = bBall; // bBall.AddComponent<BallChainMovement> (); // Debug.Log ("Head is" + head.name); // } // else // { // bBall.transform.parent=head.transform; // bBall.AddComponent<ChildBallMovement> (); // } // bBall.AddComponent<BallChainMovement> (); }
// void InsertCounterMagicBall() { GameObject cmBall = Instantiate(counterMagicBallPrefab, spawnPoint.transform.position, Quaternion.identity) as GameObject; cmBall.name = "CounterMagic"; BallChainMovement ballScript = cmBall.AddComponent <BallChainMovement> (); ballScript.SetPPS(forwardPercentagePerSecond, backwardPercentagePerSecond); cmBall.tag = "CounterMagic"; foreach (GameObject b in ballChain) { //b.GetComponent<BallChainMovement>().moveFlag=false; } // bBall.transform.parent = chain.transform; ballChain.Add(cmBall); cmBall.transform.parent = balls; }
public void SetPPSForBallScript(BallChainMovement ballScript) { ballScript.SetPPS(forwardPercentagePerSecond, backwardPercentagePerSecond); }
public void SetPPSForBallScript (BallChainMovement ballScript) { ballScript.SetPPS(forwardPercentagePerSecond, backwardPercentagePerSecond); }