private IEnumerator TaskExp() { Debug.Log("TaskExp"); //yield return new WaitForSeconds(2f); var clone = expGroup; // GameObject.Instantiate(expGroup); clone.parent = expGroup.parent; clone.localPosition = expGroup.localPosition; clone.transform.localScale = Vector2.one; //iTween.Stop(clone.gameObject); //expGroup.gameObject.SetActive(false); //iTween.ScaleTo(clone.gameObject, new Vector2(0.2f, 0.2f), 0.2f); clone.DOScale(0.2f, 0.2f); yield return(new WaitForSeconds(0.2f)); var headbar = UIEngine.GetComtrol <HeadBarFloating>(); var rect = headbar.ExpWolrdRect; var p = rect.center; //iTween.MoveTo(clone.gameObject, p, 0.2f); clone.DOMove(p, 0.2f); yield return(new WaitForSeconds(0.2f)); HeadBarFloating.instance.Star += expParam; HeadBarFloating.instance.ScaleExp(); }
private IEnumerator TaskGold() { Debug.Log("TaskGold"); //yield return new WaitForSeconds(2f); var clone = goldGroup; //GameObject.Instantiate(goldGroup); clone.parent = goldGroup.parent; clone.localPosition = goldGroup.localPosition; clone.transform.localScale = Vector2.one; iTween.Stop(clone.gameObject); //goldGroup.gameObject.SetActive(false); //iTween.ScaleTo(clone.gameObject, new Vector2(0.2f, 0.2f), 0.2f); clone.DOScale(0.2f, 0.2f); yield return(new WaitForSeconds(0.2f)); var headbar = UIEngine.GetComtrol <HeadBarFloating>(); var rect = headbar.GoldWolrdRect; var p = rect.center; //iTween.MoveTo(clone.gameObject, p, 0.2f); clone.DOMove(p, 0.2f); yield return(new WaitForSeconds(0.2f)); HeadBarFloating.instance.Gold += goldParam; HeadBarFloating.instance.ScaleGold(); AudioManager.PlaySe("gain-gold"); }