小怪受击身体变红特效代码

private bool ColorIng = false;
private SkinnedMeshRenderer primaryRenderer;
    IEnumerator HitColor()
    {
        if (ColorIng)
            yield break;
        ColorIng = true;
        Color t = primaryRenderer.material.color;
        primaryRenderer.material.color = Color.red;
        
        yield return new WaitForSeconds(0.2f);
        primaryRenderer.material.color = t;
        ColorIng = false;
    }

 

posted @ 2015-04-27 16:06  大表哥的笔记  阅读(405)  评论(0编辑  收藏  举报