예제 #1
0
    public override void OnInspectorGUI()
    {
        // set our custom inspector up to communicate with the main script and alias that script for brevity
        ScalePlayerToEnvironment spte = (ScalePlayerToEnvironment)target;

        // publish our autoscale option
        spte.autoscale = EditorGUILayout.Toggle("AutoScale", spte.autoscale);
        // tell inspector to hide the scale ratio option if they are autoscaling
        using (new EditorGUI.DisabledScope(spte.autoscale))
        {
            spte.scaleRatio = EditorGUILayout.FloatField("Scale Ratio", spte.scaleRatio);
        }
    }
예제 #2
0
    public override void OnInspectorGUI()
    {
        // set our custom inspector up to communicate with the main script and alias that script for brevity
        ScalePlayerToEnvironment spte = (ScalePlayerToEnvironment)target;

        // Gameobject field for Scaled environment
        spte.scaledEnvironment = (GameObject)EditorGUILayout.ObjectField("Scaled Enviornment", spte.scaledEnvironment, typeof(GameObject), true);

        // Gameobject field for StartLocationsParent
        spte.startLocationsParent = (GameObject)EditorGUILayout.ObjectField("Start Locations Parent", spte.startLocationsParent, typeof(GameObject), true);

        // bool for randomizing start location
        spte.randomStartLocation = EditorGUILayout.Toggle("Random Start Location", spte.randomStartLocation);

        // publish our autoscale option
        spte.autoscale = EditorGUILayout.Toggle("AutoScale", spte.autoscale);
        // tell inspector to hide the scale ratio option if they are autoscaling
        using (new EditorGUI.DisabledScope(spte.autoscale))
        {
            spte.scaleRatio = EditorGUILayout.FloatField("Scale Ratio", spte.scaleRatio);
        }
    }