예제 #1
0
 private void OnEnable()
 {
     billboard                = (DirectionalBillboard)target;
     settings                 = DirectionBillboardSettings.GetSerializedSettings();
     spDirectionList          = serializedObject.FindProperty("directions");
     spWaitTime               = serializedObject.FindProperty("waitTime");
     spLoop                   = serializedObject.FindProperty("loop");
     spReset                  = serializedObject.FindProperty("resetFrameWhenChangeDirection");
     EditorApplication.update = Update;
 }
예제 #2
0
        public static SettingsProvider CreateMyCustomSettingsProvider()
        {
            var provider = new SettingsProvider("Preferences/Directional Sprite Preference", SettingsScope.User)
            {
                label      = "Directional Sprite Preference",
                guiHandler = (searchContext) =>
                {
                    var settings = DirectionBillboardSettings.GetSerializedSettings();
                    EditorGUILayout.PropertyField(settings.FindProperty("currentDirection"), new GUIContent("Forward Position"));
                    settings.ApplyModifiedProperties();
                },
                keywords = new HashSet <string>(new[] { "Billboard", "Directional Sprite", "Current Direction" })
            };

            return(provider);
        }