コード例 #1
0
    public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
    {
        var playable = ScriptPlayable <PostProcessBehaviour> .Create(graph, template);

        PostProcessBehaviour clone = playable.GetBehaviour();

        return(playable);
    }
コード例 #2
0
    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
    {
        int inputCount = playable.GetInputCount();

        for (int i = 0; i < inputCount; i++)
        {
            var playableInput          = (ScriptPlayable <PostProcessBehaviour>)playable.GetInput(i);
            PostProcessBehaviour input = playableInput.GetBehaviour();
            float inputWeight          = playable.GetInputWeight(i);
            if (Mathf.Approximately(inputWeight, 0f))
            {
                continue;
            }
            float normalizedTime = (float)(playableInput.GetTime() / playableInput.GetDuration());
            input.ChangeWeight(normalizedTime);
        }
    }
コード例 #3
0
 void CameraChanged(Camera camera)
 {
     behaviour          = camera.GetComponent <PostProcessBehaviour>() ?? camera.gameObject.AddComponent <PostProcessBehaviour>();
     behaviour.Resource = resource;
 }