public void UpdateTime()
    {
        if (active_animation_name == null || active_animation_name.Length == 0)
        {
            active_animation_name = pack_player.data.GetFirstAnimClipName();
        }

        float real_time_scale = Application.isPlaying ? local_time_scale : 0.0f;
        float time_delta      = (Time.deltaTime * real_time_scale);

        if (!should_play)
        {
            time_delta = 0.0f;
        }

        if (compositeClipActive())
        {
            var comp_data = pack_asset.composite_player.composite_clips;
            if (comp_data.ContainsKey(composite_anim))
            {
                pack_asset.composite_player.update(time_delta, pack_player, should_loop);
            }
        }
        else
        {
            pack_player.isLooping = should_loop;
            pack_player.isPlaying = true;
            pack_player.stepTime(time_delta);
        }

        pack_player.syncRenderData();
    }
예제 #2
0
    public void UpdateTime()
    {
        if (active_animation_name == null || active_animation_name.Length == 0)
        {
            active_animation_name = pack_player.data.GetFirstAnimClipName();
        }


        float time_delta = (Time.deltaTime * local_time_scale);

        if (!should_play)
        {
            time_delta = 0.0f;
        }

        pack_player.isLooping = should_loop;
        pack_player.isPlaying = true;
        pack_player.stepTime(time_delta);
        pack_player.syncRenderData();
    }
예제 #3
0
    // Update the composite clip animation step
    public void update(float delta_step, CreaturePackPlayer pack_player, bool should_loop)
    {
        var sublist  = composite_clips[active_name];
        var pre_time = pack_player.getRunTime("");

        if (!should_loop)
        {
            if ((pre_time >= sublist[active_idx].end_frame) &&
                (active_idx >= (sublist.Count - 1)))
            {
                return;
            }
        }

        pack_player.isLooping = true;
        pack_player.isPlaying = true;
        pack_player.stepTime(delta_step);

        var post_time = pack_player.getRunTime("");

        if ((post_time < pre_time) || (post_time > sublist[active_idx].end_frame))
        {
            var  old_idx         = active_idx;
            var  new_idx         = (active_idx + 1) % sublist.Count;
            bool advance_to_next = true;
            if (!should_loop && (new_idx <= old_idx))
            {
                advance_to_next = false;
            }

            if (advance_to_next)
            {
                active_idx = new_idx;
                setupForSubClip(pack_player, active_idx, active_name);
            }
            else
            {
                pack_player.setRunTime(sublist[active_idx].end_frame, "");
            }
        }
    }