public void Init(Transform dependence, string msg, Color textColor, FlyNumerDirection flyDir = FlyNumerDirection.side,int size = 42) { base.Init(); cam = MainController.Instance.MainCamera; this.dependence = dependence; incFlyingNumbers.Init(msg, textColor, flyDir, size, OnDead); }
public void Init(string msg,Color textColor, FlyNumerDirection flyDir = FlyNumerDirection.side,int size = 42,Action OnDead = null) { base.Init(); this.OnDead = OnDead; text.text = msg; text.fontSize = size; text.color = textColor; subInit(flyDir); }
public void Init(string txt, Color textColor, Sprite spr, FlyNumerDirection flyDir = FlyNumerDirection.side, int size = 42, Action OnDead = null) { base.Init(); this.OnDead = OnDead; text.text = txt; text.fontSize = size; text.color = textColor; image.sprite = spr; subInit(flyDir); }
public void Init(string msg,Color textColor, FlyNumerDirection flyDir = FlyNumerDirection.side,int size = 42,Action OnDead = null) { base.Init(); this.OnDead = OnDead; if (image != null) image.enabled = false; text.text = msg; text.fontSize = size; text.color = textColor; if (subText != null) { subText.gameObject.SetActive(false); } subInit(flyDir); }
private void subInit(FlyNumerDirection flyDir) { anim = GetComponent<Animator>(); switch (flyDir) { case FlyNumerDirection.side: if (UnityEngine.Random.Range(0, 100) > 50) { anim.SetTrigger(keyLeft); } else { anim.SetTrigger(keyRight); } break; case FlyNumerDirection.non: anim.SetTrigger(keyNone); break; } }
public void Init(string txt, Color textColor, Sprite spr , FlyNumerDirection flyDir = FlyNumerDirection.side, int size = 42, Action OnDead = null) { base.Init(); this.OnDead = OnDead; text.text = txt; text.fontSize = size; text.color = textColor; if (spr == null) { image.enabled = false; } else { image.enabled = true; image.sprite = spr; } if (subText != null) { subText.gameObject.SetActive(false); } subInit(flyDir); }