public PetAnim(Transform playerView) { _playerView = playerView; PlayerParts = new PlayerParts(); Suits.Load(); Tails.Load(); Eyes.Load(); Noses.Load(); Paws.Load(); PlayerParts.Body = _playerView.transform.Find("Body").GetComponent <SpriteRenderer>(); PlayerParts.Suit = _playerView.transform.Find("Suit").GetComponent <SpriteRenderer>(); PlayerParts.Paws = _playerView.transform.Find("Paws").GetComponent <SpriteRenderer>(); PlayerParts.Nose = _playerView.transform.Find("Nose").GetComponent <SpriteRenderer>(); PlayerParts.Tail = _playerView.transform.Find("Tail").GetComponent <SpriteRenderer>(); PlayerParts.Eyes = _playerView.transform.Find("Eyes").GetComponent <SpriteRenderer>(); PlayerParts.Pillow = _playerView.transform.Find("Pillow").GetComponent <SpriteRenderer>(); PlayerParts.Shadow = _playerView.transform.Find("Shadow").GetComponent <SpriteRenderer>(); PlayerParts.Crown = _playerView.transform.Find("Crown").GetComponent <SpriteRenderer>(); _mainPartsT = new Transform[] { PlayerParts.Body.transform, PlayerParts.Suit.transform, PlayerParts.Paws.transform, PlayerParts.Nose.transform, PlayerParts.Tail.transform, PlayerParts.Eyes.transform, PlayerParts.Crown.transform, }; }
public void UpdateFace() { View.EyeType = (EyeType)Random.Range((int)EyeType.Blink1, Eyes.Count()); View.NoseType = (NoseType)Random.Range(0, Noses.Count()); }