//物体到达目的地后四散消失的特效
    private IEnumerator GoAway()
    {
        List <Vector3> itm_Yie = new List <Vector3>();

        for (int j = 0; j < gameObjects.Length; j++)
        {
            yield return(null);

            itm_Yie.Add(gameObjects[j].transform.position + new Vector3(Random.Range(-0.2f, 0.2f), 0, Random.Range(-0.3f, 0.2f)));
        }
        for (float i = 0; i < 0.5f; i += 0.005f)
        {
            for (int j = 0; j < gameObjects.Length; j++)
            {
                if (gameObjects[j] == inster.transform)
                {
                    continue;
                }
                gameObjects[j].transform.position = Vector3.Lerp(gameObjects[j].transform.position, itm_Yie[j], i);
                gameObjects[j].localScale         = (0.1f - 0.2f * i) * Vector3.one;
            }
            yield return(null);
        }
        Destroy(inster);
        Event_OnStepOver?.Invoke();
        yield return(new WaitForSeconds(WaitTime));

        Event_OnWaitTimeOver?.Invoke();
    }
    IEnumerator Alwa()
    {
        Event_OnStepOver?.Invoke();
        yield return(new WaitForSeconds(WaitTime));

        ForGroupHaveDone = false;
        Event_OnWaitTimeOver?.Invoke();
    }
示例#3
0
    IEnumerator UILineGo()
    {
        for (int i = 0; i < UIlineGroups.Length; i++)
        {
            UIlineGroups[i].EnegyHasCome = true;
            while (!UIlineGroups[i].ForGroupHaveDone)
            {
                yield return(null);
            }
        }
        foreach (var item in UIlineGroups)
        {
            item.EnegyHasCome       = false;
            item.thisimg.fillAmount = 0;
            Destroy(item);
        }
        Event_OnStepOver?.Invoke();
        yield return(new WaitForSeconds(WaitTime));

        Event_OnWaitTimeOver?.Invoke();
    }