Ejemplo n.º 1
0
 public void OnPoolSpawned()
 {
     if (!_activeByDefault)
     {
         return;
     }
     _active  = true;
     _current = _targetAnimators.RandomElement();
     _current.Play();
 }
Ejemplo n.º 2
0
 public void OnSystemUpdate(float dt)
 {
     if (!_loop)
     {
         return;
     }
     if (_current != null && !_current.IsPlaying)
     {
         _current = _targetAnimators.RandomElement();
         _current.Play();
     }
 }
Ejemplo n.º 3
0
 public void LevelTrigger(ILevelTrigger origin)
 {
     if (_trigger == TriggerTargetTypes.None)
     {
         return;
     }
     if (_current == null)
     {
         _current = _targetAnimators.RandomElement();
         _current.Play();
     }
     else
     {
         _current = null;
     }
 }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
 public void OnPoolDespawned()
 {
     _current = null;
     _active  = false;
 }