public void InitiatePartBody() { if (partBody != null) { bonusStrength = partBody.bonusStrength; bonusConstitution = partBody.bonusConstitution; bonusAgility = partBody.bonusAgility; gestation = partBody.gestation; gameObject.name = partBody.name; typePart = partBody.typePart; SpriteRenderer renderer = GetComponent <SpriteRenderer>(); renderer.sprite = partBody.spritePart; if (typePart == Enum.Type.Head) { renderer.sortingOrder = 4; } else if (typePart == Enum.Type.Member) { renderer.sortingOrder = 2; } else if (typePart == Enum.Type.Body) { renderer.sortingOrder = 0; } } }
public IPlayer GetPlayer(Enum.Type playerType) { switch (playerType) { case Enum.Type.Newbie: return(new Newbie()); case Enum.Type.ProPlayer: return(new Proplayer()); default: throw new NotSupportedException(); } }