Exemplo n.º 1
0
    //This will iterate through the clips and forcedly call their ProcessFrame,
    //providing more data (like the current global Timeline time) so that the clip can handle bullets before and past its actual duration
    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
    {
        double timelineCurrentTime = (playable.GetGraph().GetResolver() as PlayableDirector).time;
        int    inputCount          = playable.GetInputCount();

        for (int i = 0; i < inputCount; i++)
        {
            ScriptPlayable <PathWalkerBehaviour> inputPlayable = (ScriptPlayable <PathWalkerBehaviour>)playable.GetInput(i);
            PathWalkerBehaviour input = inputPlayable.GetBehaviour();
            input.MixerProcessFrame(inputPlayable, info, playerData, timelineCurrentTime);
        }
    }
Exemplo n.º 2
0
    // public override void OnInspectorGUI()
    // {
    //     serializedObject.Update();

    //     EditorGUILayout.PropertyField(serializedObject.FindProperty("path"));
    //     EditorGUILayout.PropertyField(serializedObject.FindProperty("enemyDefinition"));
    //     EditorGUILayout.PropertyField(serializedObject.FindProperty("patternDefinition"));
    //     EditorGUILayout.PropertyField(serializedObject.FindProperty("xScale"));
    //     EditorGUILayout.PropertyField(serializedObject.FindProperty("yScale"));

    //     serializedObject.ApplyModifiedProperties();
    // }

    public void OnSceneGUI(SceneView sceneView)
    {
        if (path != null && path.length != 0)
        {
            PathWalkerClip      c = target as PathWalkerClip;
            PathWalkerBehaviour b = c.template;

            Handles.color = Color.magenta;
            float nOfPoints = 10f * duration;
            for (int i = 0; i < nOfPoints; i++)
            {
                float t  = i / 10f;//= (float)i * .1f * nOfPoints;
                float t1 = (i + 1) / 10f;
                //Debug.Log("Point: " + i + " has t=" + t + " and t1=" + t1);
                Handles.SphereHandleCap(0, lanePos + b.GetOffsetFromLaneStart(t), Quaternion.identity, .5f, EventType.Repaint);
                Handles.DrawDottedLine(lanePos + b.GetOffsetFromLaneStart(t),
                                       lanePos + b.GetOffsetFromLaneStart(t1),
                                       3f);
            }
        }
    }