Пример #1
0
        protected override void Awake()
        {
            base.Awake();

            if (surfaceMaterial == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(surfaceMaterial));
            }

            surfaceMeshFilter = contentParent.GetComponent <MeshFilter>();
            if (surfaceMeshFilter == null)
            {
                SpecialDebugMessages.LogComponentNotFoundError(this, nameof(MeshFilter), contentParent.gameObject);
            }
            surfaceMeshRenderer = contentParent.GetComponent <MeshRenderer>();
            if (surfaceMeshRenderer == null)
            {
                SpecialDebugMessages.LogComponentNotFoundError(this, nameof(MeshRenderer), contentParent.gameObject);
            }
            gridController = contentParent.GetComponent <GridController>();
            if (gridController == null)
            {
                SpecialDebugMessages.LogComponentNotFoundError(this, nameof(GridController), contentParent.gameObject);
            }

            surfaceMeshRenderer.material = Instantiate(surfaceMaterial);
        }
Пример #2
0
 /// <summary>
 /// Checks the component's setup and initializes it
 /// </summary>
 private void Awake()
 {
     appBarPlacer = GetComponent <AppBarPlacer>();
     if (appBarPlacer == null)
     {
         SpecialDebugMessages.LogComponentNotFoundError(this, nameof(AppBarPlacer), gameObject);
     }
 }
Пример #3
0
 /// <summary>
 /// Initializes the component by getting the reference to the visualization
 /// </summary>
 private void Awake()
 {
     visualization = GetComponent <Visualization>();
     if (visualization == null)
     {
         SpecialDebugMessages.LogComponentNotFoundError(this, nameof(Visualization), gameObject);
     }
 }
Пример #4
0
 private void Initialize()
 {
     display = GetComponent <DataDisplay <DataType> >();
     if (display == null)
     {
         SpecialDebugMessages.LogComponentNotFoundError(this, nameof(DataDisplay <DataType>), gameObject);
     }
 }
Пример #5
0
 public override void Setup(NetworkRoomData content)
 {
     button = GetComponent <Interactable>();
     if (button == null)
     {
         SpecialDebugMessages.LogComponentNotFoundError(this, nameof(Interactable), gameObject);
     }
     base.Setup(content);
 }
Пример #6
0
        /// <summary>
        /// Called if the user starts a gesture on the object
        /// Creates a copy based on the given prefab and initializes the copy
        /// </summary>
        /// <param name="eventData">The event data of the gesture</param>
        public void OnPointerDown(MixedRealityPointerEventData eventData)
        {
            GameObject currentPointerTarget = eventData.Pointer.Result.CurrentPointerTarget;

            // only do this if we are out of selection mode, otherwise this is in conflict with the selection gesture
            if (!IssueSelectionManager.Instance.SelectionModeActive
                //clicking the edit or delete button shouldn't spawn a card
                && currentPointerTarget.GetComponent <EditButton>() == null && currentPointerTarget.GetComponent <DeleteButton>() == null)
            {
                // pass instantiation data to the copy so that other clients also know which issue is contained in the created copy
                object[] instantiationData;
                if (localDataDisplay.Content.Source == DataSource.REQUIREMENTS_BAZAAR)
                {
                    instantiationData = new object[1];
                }
                else if (localDataDisplay.Content.Source == DataSource.GITHUB)
                {
                    instantiationData    = new object[2];
                    instantiationData[1] = localDataDisplay.Content.ProjectId;
                }
                else
                {
                    Debug.LogError("Unexpected source: " + localDataDisplay.Content.Source, gameObject);
                    return;
                }

                instantiationData[0] = localDataDisplay.Content.Id; // same for ReqBaz and GitHub

                // create the copy, get the relevant components and set them up
                ResourceManager.Instance.SceneNetworkInstantiate(copyObject, transform.position, transform.rotation,
                                                                 (obj) =>
                {
                    copyInstance  = obj;
                    handlerOnCopy = copyInstance?.GetComponentInChildren <ObjectManipulator>();
                    IssueDataDisplay remoteDataDisplay = copyInstance?.GetComponent <IssueDataDisplay>();
                    if (handlerOnCopy == null || remoteDataDisplay == null)
                    {
                        if (handlerOnCopy == null)
                        {
                            SpecialDebugMessages.LogComponentNotFoundError(this, nameof(ObjectManipulator), copyInstance);
                        }
                        if (remoteDataDisplay == null)
                        {
                            SpecialDebugMessages.LogComponentNotFoundError(this, nameof(IssueDataDisplay), copyInstance);
                        }
                        PhotonNetwork.Destroy(copyInstance);
                    }
                    else
                    {
                        remoteDataDisplay.Setup(localDataDisplay.Content);
                        handlerOnCopy.OnPointerDown(eventData);
                    }
                },
                                                                 instantiationData);
            }
        }
Пример #7
0
        /// <summary>
        /// Initializes the component and checks its setup
        /// </summary>
        protected override void Awake()
        {
            base.Awake();
            progressBarVisuals = GetComponent <IProgressBarVisuals>();
            if (progressBarVisuals == null)
            {
                SpecialDebugMessages.LogComponentNotFoundError(this, nameof(IProgressBarVisuals), gameObject);
            }

            ContentProvider = new SingleIssuesProvider();
            Title           = "";
        }
Пример #8
0
        protected virtual void Awake()
        {
            Interactable interactable = GetComponent <Interactable>();

            interactable.OnClick.AddListener(KeyPressed);

            keyboard = transform.parent.parent.GetComponent <Keyboard>();
            if (keyboard == null)
            {
                SpecialDebugMessages.LogComponentNotFoundError(this, nameof(Keyboard), transform.parent.gameObject);
            }
        }
Пример #9
0
 public void OnPointerDown(MixedRealityPointerEventData eventData)
 {
     ResourceManager.Instance.SceneNetworkInstantiate(visualizationPrefab, transform.position, transform.rotation, (instance) =>
     {
         boxStateController = instance.GetComponentInChildren <BoundingBoxStateController>();
         if (boxStateController == null)
         {
             SpecialDebugMessages.LogComponentNotFoundError(this, nameof(BoundingBoxStateController), instance);
         }
         boxStateController.BoundingBoxActive = true;
         handler = instance.GetComponentInChildren <ObjectManipulator>();
         handler.OnPointerDown(eventData);
     });
 }
Пример #10
0
        /// <summary>
        /// Checks the component's setup and initializes it
        /// </summary>
        protected override void Awake()
        {
            if (configurationWindow == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(configurationWindow));
            }
            configurationWindowInterface = configurationWindow?.GetComponent <IWindow>();
            if (configurationWindowInterface == null)
            {
                SpecialDebugMessages.LogComponentNotFoundError(this, nameof(IWindow), configurationWindow);
            }

            base.Awake();
        }
Пример #11
0
        private void Awake()
        {
            if (avatarParent == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(avatarParent));
            }
            else
            {
                EnsureAvatarConfigController();
                // deactivate the spine controller
                spineController         = avatarParent.GetComponentInChildren <AvatarSpineController>();
                spineController.enabled = false;
            }

            if (categoryToggles == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(categoryToggles));
            }
            else
            {
                categoryObjectCollection = categoryToggles.gameObject.GetComponent <GridObjectCollection>();
                if (categoryObjectCollection == null)
                {
                    SpecialDebugMessages.LogComponentNotFoundError(this, nameof(GridObjectCollection), gameObject);
                }
            }
            if (categoryButtonPrefab == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(categoryButtonPrefab));
            }
            if (modelSelector == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(modelSelector));
            }
            if (materialSelector == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(materialSelector));
            }
            if (colorSelector == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(colorSelector));
            }

            InitializeCategories();

            modelSelector.ItemSelected    += ModelItemSelected;
            materialSelector.ItemSelected += MaterialItemSelected;
            colorSelector.ItemSelected    += ColorItemSelected;
        }
Пример #12
0
        /// <summary>
        /// Initializes the component and makes sure that it is set up correctly
        /// </summary>
        private void Awake()
        {
            if (backendLed == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(backendLed));
            }
            if (sharingLed == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(sharingLed));
            }
            if (sharingConnectButtonText == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(sharingConnectButtonText));
            }
            if (backendSettingsMenu == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(backendSettingsMenu));
            }
            else
            {
                backendSettingsMenu.SetActive(false);
            }
            if (backendAddressField == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(backendAddressField));
            }
            else
            {
                backendAddressField.TextChanged += BackendAddressChanged;
            }

            backendLedRenderer = backendLed?.GetComponent <Renderer>();
            sharingLedRenderer = sharingLed?.GetComponent <Renderer>();

            if (backendLedRenderer == null)
            {
                SpecialDebugMessages.LogComponentNotFoundError(this, nameof(Renderer), backendLed);
            }
            if (sharingLedRenderer == null)
            {
                SpecialDebugMessages.LogComponentNotFoundError(this, nameof(Renderer), sharingLed);
            }

            SetLED(backendLedRenderer, false);
            SetSharingServerStatus(false);
        }
Пример #13
0
 /// <summary>
 /// Called if the GameObject is enabled
 /// Registers for the IssueEdited and IssueDeleted Events
 /// </summary>
 private void OnEnable()
 {
     //Get the edit menu from the project tracker
     issueDataDisplay = GetComponent <IssueDataDisplay>();
     if (issueDataDisplay == null)
     {
         SpecialDebugMessages.LogComponentNotFoundError(this, nameof(IssueDataDisplay), gameObject);
     }
     projectTracker = GameObject.FindObjectOfType <ProjectTracker>();
     editMenu       = projectTracker.editIssueMenu;
     if (editMenu != null)
     {
         editMenu.IssueEdited += OnIssueEdited;
     }
     if (projectTracker != null)
     {
         projectTracker.IssueDeleted += OnIssueDeleted;
     }
 }
Пример #14
0
        protected override void Setup()
        {
            base.Setup();
            AppBarPlacer placer = instance.GetComponent <AppBarPlacer>();

            if (placer == null)
            {
                SpecialDebugMessages.LogComponentNotFoundError(this, nameof(AppBarPlacer), instance);
            }
            placer.TargetBoundingBox = targetBoundsControl;
            AppBarActions actions = instance.GetComponent <AppBarActions>();

            if (actions == null)
            {
                SpecialDebugMessages.LogComponentNotFoundError(this, nameof(AppBarActions), instance);
            }
            PhotonView photonView = targetBoundsControl.Target.GetComponent <PhotonView>();

            actions.TargetNetworked = (photonView != null);
        }
        private void Awake()
        {
            localPartController = GetComponent<IConfigurationController>();

            if (observedPart == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(observedPart));
            }
            else
            {
                observedPartController = observedPart.GetComponent<IConfigurationController>();
                if (observedPartController == null)
                {
                    SpecialDebugMessages.LogComponentNotFoundError(this, nameof(IConfigurationController), observedPart);
                }
                else
                {
                    observedPartController.ConfigurationChanged += OnConfigurationChanged;
                }
            }
        }
Пример #16
0
        private void Awake()
        {
            userDisplay = GetComponentInChildren <UserDataDisplay>();
            if (userDisplay == null)
            {
                SpecialDebugMessages.LogComponentNotFoundError(this, nameof(UserDataDisplay), gameObject);
            }
            if (scoreBarPrefab == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(scoreBarPrefab));
            }
            CompetenceBarController cbc = scoreBarPrefab?.GetComponent <CompetenceBarController>();

            if (cbc == null)
            {
                SpecialDebugMessages.LogComponentNotFoundError(this, nameof(CompetenceBarController), scoreBarPrefab);
            }
            if (scoreBarsParent == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(scoreBarsParent));
            }
            if (nameLabel == null)
            {
                SpecialDebugMessages.LogMissingReferenceError(this, nameof(nameLabel));
            }
            if (colors.Length != numberOfScoredProperties)
            {
                Debug.Log("Number of colors for the user score bars does not match number of tracked properties. Change the number of defined colors for the bars to " + numberOfScoredProperties, gameObject);
                return;
            }

            for (int i = 0; i < numberOfScoredProperties; i++)
            {
                GameObject scoreBarInstance      = Instantiate(scoreBarPrefab, scoreBarsParent);
                CompetenceBarController scoreBar = scoreBarInstance.GetComponent <CompetenceBarController>();
                scoreBar.Color = colors[i];
                scoreBarInstance.SetActive(false);
                scoreBars[i] = scoreBar;
            }
        }