Exemplo n.º 1
0
        public void SelectLocusPoint(LocusPointController locusPointController)
        {
            // Remove previous selection
            DeselectLocusPoint();

            // Toggled the same one
            if (_selectedLocusPoint == locusPointController)
            {
                return;
            }

            // Select new locus point
            _selectedLocusPoint = locusPointController;
            _selectedLocusPoint.Select();

            // Apply angle to locus
            foreach (var partData in locusPointController.data.Configuration)
            {
                var go = RobotController.Instance.GetObjectById(partData.Id);
                switch (partData.Type)
                {
                case "RotaryJoint":
                    go.GetComponent <RotaryJoint>().CurrentAngle = partData.CurrentAngle;
                    break;
                }
            }
        }
Exemplo n.º 2
0
        public void DeselectLocusPoint()
        {
            if (_selectedLocusPoint == null)
            {
                return;
            }

            _selectedLocusPoint.Deselect();
            _selectedLocusPoint = null;
        }