Exemple #1
0
    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> ();
    }
Exemple #2
0
//

    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;
    }
Exemple #3
0
 public void SetPPSForBallScript(BallChainMovement ballScript)
 {
     ballScript.SetPPS(forwardPercentagePerSecond, backwardPercentagePerSecond);
 }
Exemple #4
0
	public void SetPPSForBallScript (BallChainMovement ballScript) {
		ballScript.SetPPS(forwardPercentagePerSecond, backwardPercentagePerSecond);
	}