コード例 #1
0
    void DisplayGoals(List <AccessibilityGoal> data, AccessibilityGoal.GoalType goalType)
    {
        if (data.Count <= 0)
        {
            return;
        }
        for (int i = 0; i < data.Count; i++)
        {
            if (data[i].goalType == goalType)
            {
                GUIStyle titleName = new GUIStyle(EditorStyles.label);
                GUIStyle newStyle  = new GUIStyle(EditorStyles.toolbarButton);

                titleName.normal.textColor = Color.white;
                titleName.alignment        = TextAnchor.LowerLeft;
                titleName.fontStyle        = FontStyle.Bold;
                titleName.wordWrap         = true;

                if (highContrastMode)
                {
                    GUI.backgroundColor = Color.green;
                }
                data[i].isComplete  = EditorGUILayout.ToggleLeft("Completed", data[i].isComplete);
                GUI.backgroundColor = Color.gray;

                GUILayout.Label(data[i].name, titleName);

                if (!data[i].notRelevant)
                {
                    GUILayout.Box(data[i].description, EditorStyles.helpBox);
                    newStyle.normal.textColor = Color.white;
                }

                EditorGUILayout.BeginHorizontal();
                if (highContrastMode)
                {
                    GUI.backgroundColor = Color.green;
                }

                if (GUILayout.Button("Learn More...", newStyle))
                {
                    Application.OpenURL(data[i].url);
                }
                GUI.backgroundColor = Color.gray;

                if (highContrastMode)
                {
                    GUI.backgroundColor = Color.red;
                }
                data[i].notRelevant = EditorGUILayout.Toggle("Not Relevant for this game ", data[i].notRelevant);
                GUI.backgroundColor = Color.gray;
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
            }
        }
    }
コード例 #2
0
    Vector3 CountTotalsByType(List <AccessibilityGoal> data, AccessibilityGoal.GoalType type)
    {
        Vector3 output = new Vector3();

        for (int i = 0; i < data.Count; i++)
        {
            output.x++;
            if (data[i].goalType == type)
            {
                output.y++;
                if (data[i].isComplete || data[i].notRelevant)
                {
                    output.z++;
                }
            }
        }
        return(output);
    }