UnityEditor.AnimationClipInfoProperties.GetEvent C# (CSharp) Method

GetEvent() public method

public GetEvent ( int index ) : AnimationEvent
index int
return AnimationEvent
        public AnimationEvent GetEvent(int index)
        {
            AnimationEvent event2 = new AnimationEvent();
            SerializedProperty property = this.Get("events");
            if ((property != null) && property.isArray)
            {
                if (index < property.arraySize)
                {
                    event2.floatParameter = property.GetArrayElementAtIndex(index).FindPropertyRelative("floatParameter").floatValue;
                    event2.functionName = property.GetArrayElementAtIndex(index).FindPropertyRelative("functionName").stringValue;
                    event2.intParameter = property.GetArrayElementAtIndex(index).FindPropertyRelative("intParameter").intValue;
                    event2.objectReferenceParameter = property.GetArrayElementAtIndex(index).FindPropertyRelative("objectReferenceParameter").objectReferenceValue;
                    event2.stringParameter = property.GetArrayElementAtIndex(index).FindPropertyRelative("data").stringValue;
                    event2.time = property.GetArrayElementAtIndex(index).FindPropertyRelative("time").floatValue;
                    return event2;
                }
                Debug.LogWarning("Invalid Event Index");
            }
            return event2;
        }