private void SetSpeedAndColor(BlobSpeedType speedType, Color newColor, BlobStatusType newStatus) { currentSpeed = GetCurrentSpeed(speedType); currentRotationSpeed = GetCurrentRotation(speedType); status = newStatus; var colorType = Camera.main.GetComponent <CameraBehavior>().colorToggle; if (colorType.Equals(ColorDisplayType.Action)) { GetComponent <Renderer>().material.color = newColor; } else if (colorType.Equals(ColorDisplayType.None)) { GetComponent <Renderer>().material.color = normalColor; } else if (colorType.Equals(ColorDisplayType.Gender)) { if (gender.Equals(GenderType.Male)) { GetComponent <Renderer>().material.color = normalColor; } else { GetComponent <Renderer>().material.color = femaleColor; } } }
private float GetCurrentRotation(BlobSpeedType speedType) { switch (speedType) { case BlobSpeedType.Walking: return(rotationSpeed); case BlobSpeedType.Jogging: return(rotationSpeed * jogRotationModifier); case BlobSpeedType.Running: return(rotationSpeed * runRotationModifier); } return(rotationSpeed); }
private float GetCurrentSpeed(BlobSpeedType speedType) { switch (speedType) { case BlobSpeedType.Walking: return(speed); case BlobSpeedType.Jogging: return(speed * jogModifier); case BlobSpeedType.Running: return(speed * runModifier); } return(speed); }