summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Unit/Action/WaitForActionReachEnd.cs
blob: 771e946b4f88495d3c6ed0dcae46d33a3dbed01a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class WaitForActionReachEnd : IEnumerator
{
	UnitAnimation m_UnitAnimation;
    int m_Layer;

    public WaitForActionReachEnd(UnitAnimation unitAnim, int layer = 0)
	{
		m_UnitAnimation = unitAnim;
        m_Layer = layer;
    }

	public object Current => null;

	public bool MoveNext()
	{
        var layer = m_UnitAnimation.layers[m_Layer];
        return layer.playbackNormalizedTime < 1f;
	}

	public void Reset()
	{
	}
}