public void CorrectRotationFromHint()
    {
        if (!IsCorrect)
        {
            // Remove reference to this octagon in all other linked octagons
            foreach (var linkedOctagon in linkedOctagons)
            {
                linkedOctagon.GetComponent <OctagonControllerScript>().linkedOctagons.Remove(gameObject);
            }

            image.GetComponent <Image>().sprite = CorrectSprite;
            var color = image.GetComponent <Image>().color;
            image.GetComponent <Image>().color      = new Color(color.r, color.g, color.b, 1);
            background.GetComponent <Image>().color = EnumToColorConverter.SwapBackgroundColor(Enumerations.OctagonColor.Correct);
            foreach (var wall in Walls)
            {
                wall.GetComponent <Image>().color = EnumToColorConverter.SwapBackgroundColor(Enumerations.OctagonColor.Correct);
            }


            gameObject.AddComponent <RotateToSpecificZAngleScript>();
            gameObject.GetComponent <RotateToSpecificZAngleScript>().targetRotation = new Quaternion(
                this.transform.rotation.x,
                transform.rotation.y,
                CorrectRotation,
                transform.rotation.w);

            gameObject.AddComponent <LightIntensifyThenFadeScript>();
            gameObject.GetComponent <LightIntensifyThenFadeScript>().light = light.GetComponent <Light>();
            IsCorrect = true;
        }
    }
Exemple #2
0
    private void SetVisibleColor(GameObject octagonGameObject, OctagonControllerScript octagonGameObjectControllerScriptRef)
    {
        octagonGameObject.transform.Find("Background").GetComponent <Image>().color =
            EnumToColorConverter.SwapBackgroundColor(octagonGameObjectControllerScriptRef.octagonColor);

        var walls = GetWalls(octagonGameObject);

        foreach (var wall in walls)
        {
            wall.GetComponent <Image>().color = EnumToColorConverter.SwapWallColor(octagonGameObjectControllerScriptRef.octagonColor);
        }
    }
Exemple #3
0
        private byte[] getIconCategory(Models.Category category)
        {
            Models.Colors enumColor = Models.Colors.None;
            if (category != null)
            {
                enumColor = category.Color;
            }
            Brush color = EnumToColorConverter.EnumToColor(enumColor);

            string iconPath = System.Windows.Application.Current.TryFindResource("TaskIncompleteIconPath") as string;

            return(getImageBytes(createImageSource(iconPath, color) as DrawingImage));
        }
Exemple #4
0
        private Image getIconCategory(Category category)
        {
            Models.Colors enumColor = Models.Colors.None;
            if (category != null)
            {
                enumColor = category.Color;
            }
            Brush color = EnumToColorConverter.EnumToColor(enumColor);

            string iconPath = Application.Current.TryFindResource("TaskIncompleteIconPath") as string;

            return(createImage(iconPath, color));;
        }
Exemple #5
0
        private Image getIconTask(Models.Task task)
        {
            Models.Colors enumColor = Models.Colors.None;
            if (task.Category != null)
            {
                enumColor = task.Category.Color;
            }
            Brush color = EnumToColorConverter.EnumToColor(enumColor);

            string iconPath = Application.Current.TryFindResource("TaskIncompleteIconPath") as string;

            if (task.IsCompleted)
            {
                iconPath = Application.Current.TryFindResource("TaskCompletedIconPath") as string;
            }

            return(createImage(iconPath, color));
        }