Beispiel #1
0
        public BallReplayData(BaseBall ball)
        {
            Ball = ball;

            Position = Ball.transform.position;
            Rotation = Ball.transform.rotation;
        }
Beispiel #2
0
        private void CreatePoolBalls()
        {
            for (int i = 0; i < BallDataContexts.Length; i++)
            {
                if (BallDataContexts[i].BallPrefab == null)
                {
                    throw new Exception("'BallPrefab' cannot be null.");
                }

                if (BallDataContexts[i].Transform == null)
                {
                    throw new Exception("'Transform' cannot be null.");
                }

                BaseBall ball = Instantiate <BaseBall>(BallDataContexts[i].BallPrefab, BallDataContexts[i].Transform.position, BallDataContexts[i].Transform.rotation);
                ball.transform.parent = transform;


                Balls.Add(ball);
            }
        }