UnityEditor.AnimationClipInfoProperties.AddEvent C# (CSharp) Method

AddEvent() public method

public AddEvent ( float time ) : void
time float
return void
        public void AddEvent(float time)
        {
            SerializedProperty property = this.Get("events");
            if ((property != null) && property.isArray)
            {
                property.InsertArrayElementAtIndex(property.arraySize);
                property.GetArrayElementAtIndex(property.arraySize - 1).FindPropertyRelative("functionName").stringValue = "NewEvent";
                property.GetArrayElementAtIndex(property.arraySize - 1).FindPropertyRelative("time").floatValue = time;
            }
        }