示例#1
0
    public override void OnInspectorGUI()
    {
        Projectile projectile = (Projectile)target;

        base.OnInspectorGUI();

        EditorGUILayout.LabelField("Distance Traveled: " + projectile.DistanceTraveled);

        if (Application.isPlaying && GUILayout.Button("Accelerate"))
        {
            projectile.Accelerate();
        }
    }