public static HPDeltaNum Create(Vector3 spawnPos, int value, Color?col = null, float fontSize = 80f) { HPDeltaNum hpdn = (Instantiate(Resources.Load <GameObject>(PREFAB_PATH), spawnPos, Quaternion.identity)).GetComponent <HPDeltaNum>(); hpdn.initValues(value, col, fontSize); return(hpdn); }
public IEnumerator addToHealth(int value, Color?col = null) { deltaHealth += value; HPSpeed = Mathf.Clamp(Math.Abs(deltaHealth), currState.maxHealth / 5, currState.maxHealth) * 2; HPDeltaNum.Create(HPDelta_POS, value, col); isUpdatingHealth = true; yield return(DELTA_ZERO); }
public void incrementValue(int offset) { ORB_VALUE newVal = isDigit() ? (ORB_VALUE)Mathf.Clamp(getIntValue() + offset, 0, 9) : currState.value; if (newVal != currState.value) { Vector3 deltaNumSpawn = new Vector3(trans.position.x * 5 - 55f, trans.position.y * 5, 2f); HPDeltaNum.Create(deltaNumSpawn, offset); changeValue(newVal); } }