Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

OnPlayStateChanged can not be use?

Discussion in 'Timeline' started by yangjianhui8, May 27, 2017.

  1. yangjianhui8

    yangjianhui8

    Joined:
    Nov 28, 2014
    Posts:
    19
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.Playables;

    // A behaviour that is attached to a playable
    public class NewPlayableBehaviour : PlayableBehaviour
    {
    // Called when the owning graph starts playing
    public override void OnGraphStart(Playable playable) {

    }

    // Called when the owning graph stops playing
    public override void OnGraphStop(Playable playable) {

    }

    // Called when the state of the playable is set to Play
    public override void OnBehaviourPlay(Playable playable, FrameData info) {

    }

    public override void OnPlayStateChanged(FrameData info, PlayState newState)
    {


    }
    // Called when the state of the playable is set to Paused
    public override void OnBehaviourPause(Playable playable, FrameData info) {

    }

    // Called each frame while the state is set to Play
    public override void PrepareFrame(Playable playable, FrameData info) {

    }
    }
     
  2. yangjianhui8

    yangjianhui8

    Joined:
    Nov 28, 2014
    Posts:
    19
    Assets/NewPlayableBehaviour.cs(24,26): error CS0115: `NewPlayableBehaviour.OnPlayStateChanged(UnityEngine.Playables.FrameData, UnityEngine.Playables.PlayState)' is marked as an override but no suitable method found to override
     
  3. yangjianhui8

    yangjianhui8

    Joined:
    Nov 28, 2014
    Posts:
    19
  4. yangjianhui8

    yangjianhui8

    Joined:
    Nov 28, 2014
    Posts:
    19
    please let me know if any of it is amiss! thanks:)
     
  5. yangjianhui8

    yangjianhui8

    Joined:
    Nov 28, 2014
    Posts:
    19
    private void OnPlayStateChanged(PlayState newState)
    {
    }
     
  6. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    174