private void Start()
        {
            var controllers = GetComponents <HandController>();

            foreach (var controller in controllers)
            {
                if (controller.device_type == DeviceType)
                {
                    _handController = controller;
                }
            }

            _throwHandler = gameObject.GetComponentsInChildren <ThrowHandler>()
                            .FirstOrDefault(handler => handler.DeviceType == DeviceType);

            if (_throwHandler == null)
            {
                _throwHandler            = gameObject.AddComponent <ThrowHandler>();
                _throwHandler.DeviceType = DeviceType;
            }
        }
Example #2
0
        void Start()
        {
            var controllers = GetComponents <HandController>();

            foreach (var controller in controllers)
            {
                if (controller.device_type == DeviceType)
                {
                    _handController = controller;
                }
            }

            _lineRendererMaterial = Resources.Load <Material>("LineMaterial");

            //TODO: Which gameobject should have these line renderers?
            if (_showInitialTrajectory)
            {
                _initialTrajectoryLineRenderer = InitializeLineRenderer(new GameObject(), _initialTrajectoryColor);
            }
            if (_showAssistedTrajectory)
            {
                _assistedTrajectoryLineRenderer = InitializeLineRenderer(new GameObject(), _assistedTrajectoryColor);
            }
        }