public void SetMaxValue(int maxValue) { if (this.maxValue == maxValue) { return; } this.maxValue = maxValue; if (toggles.Count < maxValue) { int dif = maxValue - toggles.Count; for (int i = 0; i < dif; i++) { toggles.Add(pool.GetPooledObject()); } } if (maxValue < toggles.Count) { for (int i = 0; i < toggles.Count - maxValue; i++) { var toggle = toggles[toggles.Count - 1]; toggles.Remove(toggle); toggle.gameObject.SetActive(false); } } }
protected override void _Active(Attack attack, List <string> targetTags) { Vector3 dir = dst.position - src.position; Bullet bullet = bulletPool.GetPooledObject(); bullet.transform.position = src.transform.position; bullet.Shooted(dir, speed, life, attack, targetTags); }
public void Float(string context, Vector3 position) { Initialize(); Text text = pool.GetPooledObject(); text.gameObject.SetActive(true); text.text = context; text.transform.position = position; effect?.Effect(text); }