Ejemplo n.º 1
0
 protected override void OnEventTriggered(ObjectTransitionEventArgs args)
 {
     base.OnEventTriggered(args);
     switch (_eventMethod)
     {
         case EventMethod.Emit:
             _playground.Emit(emitAmount);
             break;
         case EventMethod.Start:
             _playground.emit = true;
             break;
         case EventMethod.Stop:
             _playground.emit = false;
             break;
     }
 }
Ejemplo n.º 2
0
    protected override void OnEventTriggered(ObjectTransitionEventArgs args)
    {
        base.OnEventTriggered(args);

        var entity = Owner.TargetObject.GetComponent<Entity>();
        if (entity != null)
        {
            bool v;
            if(Owner.FXTransitionMethod == ObjectTransitionFx.TransitionMethod.Activate)
            {
                v = _freezeInAnimationFrame;
            }
            else
            {
                v = _freezeOutAnimationFrame;
            }
            if(entity.EntityAnimator != null)
            entity.EntityAnimator.IsAnimationFrozen = v;
        }

        var renderers = Owner.TargetObject.GetComponentsInChildren<Renderer>(true);
        if (renderers == null)
        {
            Debug.LogError(Owner.name + " Could not find renderer on: " + Owner.TargetObject);
            return;
        }
        foreach (var rend in renderers)
        {
            foreach (var mat in rend.materials)
            {
                _matCache.Add(mat);
            }
        }
        _shouldUpdate = true;
        _currentTime = 0f;
    }
 protected virtual void OnEventTriggered(ObjectTransitionEventArgs args) { }
Ejemplo n.º 4
0
 protected override void OnEventTriggered(ObjectTransitionEventArgs args)
 {
     base.OnEventTriggered(args);
     _source.PlayOneShot(_playClip);
 }