// void Start() void Awake() { Debug.Log($"SceneController.Awake: entered, paddle.GetType={paddleGameObject.GetType()}"); // var sphericalPaddle_go = GameObject.Find("spherical_paddle_proto"); // var sphericalPaddle_go = GameObject.Find("SphericalPaddle"); // SphericalPdl = sphericalPaddle_go.GetComponent<SphericalPaddleProto>(); // SphericalPdl = sphericalPaddle_go.GetComponent<SphericalPaddle>(); // SphericalPaddle = GameObject.FindWithTag("SphericalPaddle").GetComponent<SphericalPaddle>(); if (paddleGameObject.GetComponent <SphericalPaddle>() != null) { SphericalPaddle = paddleGameObject.GetComponent <SphericalPaddle>(); paddle = (IPaddle)SphericalPaddle; } if (paddleGameObject.GetComponent <PlanarPaddle>() != null) { PlanarPaddle = paddleGameObject.GetComponent <PlanarPaddle>(); // paddle = (IPaddle) PlanarPaddle; paddle = (IPaddle)PlanarPaddle; // Debug.Log($"SceneController: paddle.DoIt={paddle.DoIt()}"); // Debug.Log($"SceneController: paddle.DoIt={PlanarPaddle.DoIt()}"); } Ball = GameObject.Find("Ball").GetComponent <Ball>(); var brickPlaneGo = GameObject.FindWithTag("BrickPlane"); if (brickPlaneGo != null) { BrickPlane = brickPlaneGo.GetComponent <BrickPlane>(); } // Debug.Log($"SceneController.Awake: entered, SphericalPaddle.GetType()={SphericalPaddle.GetType()}"); }
public GraphBranch(BrickPlane _start, BrickPlane _end, Material _material, string _type, GameObject _lineRendererObject) { start = _start; end = _end; material = _material; type = _type; lineRendererObject = Instantiate(_lineRendererObject, new Vector3(0, 0, 0), Quaternion.identity); line = lineRendererObject.AddComponent <LineRenderer>(); line.material = material; line.widthMultiplier = 0.01f; line.positionCount = 2; }
public Brick(GameObject _brickMesh, GameObject _brickPlaneMesh, Vector3 _position, Quaternion _rotation) { position = _position; rotation = _rotation; idealCurrentPosition = _position; layer = (int)Mathf.Round(_position.y / 0.0725f); brickObject = Instantiate(_brickMesh, position, rotation); for (int i = 0; i < localPlaneList.Length; i++) { localPlaneList[i] = new BrickPlane(_brickPlaneMesh, position, rotation, true, i); } }