Пример #1
0
        public override void EditProperty(EditHelp helper, SerializedProperty property)
        {
            helper.StartHelp(m_helpText);

            EditorGUILayout.Slider(property, m_minimum, m_maximum, m_label);
            helper.EndHelp();
        }
Пример #2
0
        public virtual void EditProperty(EditHelp helper, SerializedProperty property)
        {
            helper.StartHelp(m_helpText);

            EditorGUILayout.PropertyField(property, new GUIContent(m_label));

            helper.EndHelp();
        }
Пример #3
0
        public override void EditProperty(EditHelp helper, SerializedProperty property)
        {
            string contextHelp;

            try
            {
                contextHelp = m_enumHelpLines[property.enumValueIndex];
            }
            catch (System.IndexOutOfRangeException)
            {
                contextHelp = "ERROR: Due to version incompatibilities, you need to re-set this value";
            }
            helper.StartHelp(m_helpText + "\n\n" + contextHelp);
            EditorGUILayout.PropertyField(property, new GUIContent(m_label));
            helper.EndHelp();
        }
Пример #4
0
        public override void EditProperty(EditHelp helper, SerializedProperty property)
        {
            helper.StartHelp(m_helpText);
            EditorGUILayout.BeginVertical();
            foldoutVisible = EditorGUILayout.Foldout(foldoutVisible, new GUIContent(m_label));
            if (foldoutVisible)
            {
                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(10);
                EditorGUILayout.BeginVertical(GUILayout.ExpandWidth(true));
                for (int i = 0; i < property.arraySize; ++i)
                {
                    SerializedProperty childProperty = property.GetArrayElementAtIndex(i);
                    EditorGUILayout.BeginHorizontal(GUI.skin.box);
                    string propertyName = string.Format("{0} {1}", m_itemName, i);
                    EditorGUILayout.PropertyField(childProperty, new GUIContent(propertyName), true);;

                    if (GUILayout.Button("Del", GUILayout.ExpandWidth(false)))
                    {
                        property.DeleteArrayElementAtIndex(i);
                    }


                    EditorGUILayout.EndHorizontal();
                }
                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                if (GUILayout.Button("Add", GUILayout.ExpandWidth(false)))
                {
                    property.arraySize = property.arraySize + 1;
                }
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndVertical();
            helper.EndHelp();
        }
Пример #5
0
    public void OnEnable()
    {
        m_editHelp = new EditHelp();

        m_editHelp.AddPropertyInterface(
            "m_targetTag", new EditHelp.TagPropertyInterface(
                "Tag tag",
                "The tags used to identify possible targets."));

        m_editHelp.AddPropertyInterface(
            "m_switchToClosest", new EditHelp.BoolPropertyInterface(
                "Switch to closest",
                "Whether or not to switch to another target if it is closer than the current target.",
                "TRUE: Turret will continually switch to the closest valid target.",
                "FALSE: Turret will continue to track current target even if another one comes closer."));

        m_switchIfInvalid = new EditHelp.BoolPropertyInterface(
            "Switch if invalid",
            "Whether or not to switch to another target if the current one goes out of range (only valid with an AimerLimits component).",
            "TRUE: Turret will switch to another target if it cannot track the current one.",
            "FALSE: Turret will continue to track current target even if it goes out of bounds.");
        m_editHelp.AddPropertyInterface("m_switchOnInvalid", m_switchIfInvalid);
    }
Пример #6
0
    public void OnEnable()
    {
        m_editHelp = new EditHelp();

        m_editHelp.AddPropertyInterface(
            "m_bulletVelocity", new EditHelp.PropertyInterface(
                "Bullet speed",
                "The speed that the bullet leaves the barrel of the gun at."));

        m_editHelp.AddPropertyInterface(
            "m_bulletPrefab", new EditHelp.PropertyInterface(
                "Bullet prefab",
                "Prefab to get instanced when creating a bullet."));

        m_editHelp.AddPropertyInterface(
            "m_firingPause", new EditHelp.PropertyInterface(
                "Firing Pause",
                "The amount of time (in seconds) to pause between shots."));

        m_editHelp.AddPropertyInterface(
            "m_bulletLifetime", new EditHelp.PropertyInterface(
                "Bullet Lifetime",
                "The amount of time (in seconds) the bullet will exist before being destroyed."));

        m_editHelp.AddPropertyInterface(
            "m_firingCone", new EditHelp.SliderPropertyInterface(
                "Firing cone",
                "This is the angle of the cone in which the bullets will be fired, in degrees.\n" +
                "Good to use if you don't want your turrets to be too accurate.\n" +
                "0 = deadly accurate, 30 = can barely point in the right direction.",
                0, 90.0f));

        m_editHelp.AddPropertyInterface(
            "m_firingAnimation", new EditHelp.PropertyInterface(
                "Firing Animation",
                "An animation to play when the gun fires."));

        m_editHelp.AddPropertyInterface(
            "m_firingMessage", new EditHelp.PropertyInterface(
                "Firing Message",
                "An message that gets sent when the gun fires."));

        m_editHelp.AddPropertyInterface(
            "m_exitPoints", new EditHelp.ArrayPropertyInterface(
                "Projectile Exit Points",
                "Exit points\nYour turrent can have several projectile exit points - one per barrel. Set them up here.\n" +
                "Attributes are:\n" +
                " * Firing Animation : An animation that will get triggered when shooting.\n" +
                " * Firing Offset : The offset that the bullet gets shot from.\n",
                "Exit Point"));

        m_editHelp.AddPropertyInterface(
            "m_checkForObstacles", new EditHelp.BoolPropertyInterface(
                "Check for obstacles",
                "Whether or not to stop shooting when an obstacle is between the turret and its target.\n" +
                "NOTE: inaccurate for highly parabolic shots.",
                "TRUE: Gun will cease firing when an obstacle is in the way.",
                "FALSE: Gun will shoot irrespective of whether an obstacle is in the way."));

        m_obstacleLayers = new EditHelp.PropertyInterface(
            "Obstacle Check Layers",
            "Which layers to include when checking for obstacles in front of the target");

        m_editHelp.AddPropertyInterface("m_obstacleLayers", m_obstacleLayers);
    }
Пример #7
0
    public void OnEnable()
    {
        m_editHelp = new EditHelp();

        m_editHelp.AddPropertyInterface(
            "m_minimumHorizontalAngle", new EditHelp.SliderPropertyInterface(
                "Maximum horizontal angle",
                "Maximum (right hand) limit for aiming.",
                -180.0f, 180.0f));

        m_editHelp.AddPropertyInterface(
            "m_maximumHorizontalAngle", new EditHelp.SliderPropertyInterface(
                "Maximum horizontal angle",
                "Maximum (right hand) limit for aiming.",
                -180.0f, 180.0f));


        m_editHelp.AddPropertyInterface(
            "editor_mirrorHorizontalAngles", new EditHelp.BoolPropertyInterface(
                "Mirror the horizintal limits",
                "Whether or not to mirror the horizontal limits",
                "TRUE: limits are mirrored around zero degrees.",
                "FALSE: limits can be independantly altered."));

        m_editHelp.AddPropertyInterface(
            "m_minimumVerticalAngle", new EditHelp.SliderPropertyInterface(
                "Minimum vertical angle",
                "Maximum (upper) limit for aiming.",
                -90.0f, 90.0f));

        m_editHelp.AddPropertyInterface(
            "m_maximumVerticalAngle", new EditHelp.SliderPropertyInterface(
                "Maximum vertical angle",
                "Maximum (lower) limit for aiming.",
                -90.0f, 90.0f));

        m_editHelp.AddPropertyInterface(
            "editor_mirrorVerticalAngles", new EditHelp.BoolPropertyInterface(
                "Mirror the vertical limits",
                "Whether or not to mirror the vertical limits",
                "TRUE: limits are mirrored around zero degrees.",
                "FALSE: limits can be independantly altered."));

        m_editHelp.AddPropertyInterface(
            "m_limitRange", new EditHelp.BoolPropertyInterface(
                "Limit the range",
                "Whether or not to limit the range of the turret",
                "TRUE: Turret range will be limited.",
                "FALSE: Turret range is unlimited."));

        m_minRange = new EditHelp.PropertyInterface(
            "Minimum Range",
            "Closest an object can be to be aimed at");
        m_editHelp.AddPropertyInterface("m_minimumRange", m_minRange);

        m_maxRange = new EditHelp.PropertyInterface(
            "Maximum Range",
            "Furthest an object can be to be aimed at");
        m_editHelp.AddPropertyInterface("m_maximumRange", m_maxRange);

        m_editHelp.AddPropertyInterface(
            "m_limitTurnSpeed", new EditHelp.BoolPropertyInterface(
                "Limit the turn speed",
                "Whether or not to limit turning speed of the turret",
                "TRUE: Turret turn speed will be limited.",
                "FALSE: Turret turn speed will not be limited."));

        m_turnSpeed = new EditHelp.PropertyInterface(
            "Maximum Turn Speed",
            "Maximum speed the turret can turn in degrees per second.\nFor example: 180 is fast. 5 is slow.");

        m_editHelp.AddPropertyInterface("m_maxTurnSpeed", m_turnSpeed);

        m_editHelp.AddPropertyInterface(
            "m_returnToCentre", new EditHelp.BoolPropertyInterface(
                "Return to Centre",
                "Whether or not to return the turret to the centre when it has no target",
                "TRUE: Turret will return to centre.",
                "FALSE: Turret will stay at its last position."));
    }
Пример #8
0
 public override void EditProperty(EditHelp helper, SerializedProperty property)
 {
     helper.StartHelp(m_helpText);
     property.stringValue = EditorGUILayout.TagField(m_label, property.stringValue);
     helper.EndHelp();
 }
Пример #9
0
 public override void EditProperty(EditHelp helper, SerializedProperty property)
 {
     helper.StartHelp(m_helpText + "\n\n" + (property.boolValue ? m_trueHelp : m_falseHelp));
     EditorGUILayout.PropertyField(property, new GUIContent(m_label));
     helper.EndHelp();
 }