public void OnPoolSpawned() { if (!_activeByDefault) { return; } _active = true; _current = _targetAnimators.RandomElement(); _current.Play(); }
public void OnSystemUpdate(float dt) { if (!_loop) { return; } if (_current != null && !_current.IsPlaying) { _current = _targetAnimators.RandomElement(); _current.Play(); } }
public void LevelTrigger(ILevelTrigger origin) { if (_trigger == TriggerTargetTypes.None) { return; } if (_current == null) { _current = _targetAnimators.RandomElement(); _current.Play(); } else { _current = null; } }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { label = EditorGUI.BeginProperty(position, label, property); TargetAnimator animator = PropertyDrawerUtility.GetActualObjectForSerializedProperty <TargetAnimator>(fieldInfo, property); if (animator != null) { var contentPosition = EditorGUI.PrefixLabel(position, label); var width = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth *= 0.5f; EditorGUI.PropertyField(contentPosition, property, new GUIContent(animator.Description)); EditorGUIUtility.labelWidth = width; } else { EditorGUI.PropertyField(position, property, label); } //EditorGUI.PropertyField(position, property, animator != null ? new GUIContent(animator.Description) : label); EditorGUI.EndProperty(); }
public void OnPoolDespawned() { _current = null; _active = false; }