private void specializeBCell(BCell bCell, BCell.TYPE newType) { bCell._type = newType; GameObjectManager.setGameObjectState(bCell.recognitionZone, false); GameObjectManager.setGameObjectState(bCell.actionZone, true); updateTypeBar(bCell, newType, 1f, 1f); }
private void updateTypeBar(BCell bCell, BCell.TYPE contactType, float progress, float maximumProgress) { float width = progress / maximumProgress; float height = bCell.recognitionBar.sizeDelta.y; bCell.recognitionBar.sizeDelta = new Vector2(width, height); UnityEngine.UI.Image typeBarImage = bCell.recognitionBar.gameObject.GetComponent <UnityEngine.UI.Image>(); typeBarImage.color = (contactType == BCell.TYPE.BACTERIAL) ? Color.yellow : Color.green; }