Ejemplo n.º 1
0
        public void DrawTrajectory(BubbleTrajectory trajectory)
        {
            _lineRendererA.enabled = true;
            _lineRendererB.enabled = false;

            DrawTrajectory(trajectory, _lineRendererA);
        }
Ejemplo n.º 2
0
        public void DrawTrajectories(BubbleTrajectory trajectoryA, BubbleTrajectory trajectoryB)
        {
            _lineRendererA.enabled = true;
            _lineRendererB.enabled = true;

            DrawTrajectory(trajectoryA, _lineRendererA);
            DrawTrajectory(trajectoryB, _lineRendererB);
        }
Ejemplo n.º 3
0
        private void DrawTrajectory(BubbleTrajectory trajectory, LineRenderer lineRenderer)
        {
            var points = trajectory.Points;

            lineRenderer.positionCount = points.Count;

            var index = 0;

            foreach (var point in points)
            {
                lineRenderer.SetPosition(index, point.Value);

                index++;
            }
        }
Ejemplo n.º 4
0
        public override void Enter()
        {
            Bubble.gameObject.layer = LayerMask.NameToLayer("Untouchable");
            _trajectoryA            = new BubbleTrajectory();
            _trajectoryB            = new BubbleTrajectory();
            _startingPosition       = Bubble.transform.position;

            _inputService        = Context.Instance.InputService;
            _angularDisplacement = Context.Instance.Settings.AngularDisplacement;
            _pullingDistance     = Context.Instance.Settings.PullingDistance;
            _maxSpeed            = Context.Instance.Settings.BubbleMaxSpeed;
            _minForce            = Context.Instance.Settings.MinForce;

            Bubble.transform.SetParent(null);
            Bubble.Rigidbody.bodyType = RigidbodyType2D.Static;
        }