public void SetData(FollowerData follower) { RectTransform rt = (RectTransform) transform; Vector3 scale = rt.localScale; scale.x = 1; rt.localScale = scale; Vector2 pivot = rt.pivot; pivot.x = 1; rt.pivot = pivot; this.follower = (ShopFollower) follower; gameObject.SetActive(true); Vector2 r = ((RectTransform) transform).sizeDelta; r.x = follower.SizeOfSprite.x; r.y = follower.SizeOfSprite.y; ((RectTransform) transform).sizeDelta = r; Vector3 pos = transform.localPosition; pos.x = -54; transform.localPosition = pos; AnimatorOverrideController aoc = (AnimatorOverrideController) GetComponent<Animator>().runtimeAnimatorController; aoc["Idle"] = this.follower.SideIdleAnimation; aoc["Walk Up"] = this.follower.WalkingAnimation; aoc["Random"] = this.follower.RandomAnimation; }
public void OpenShop(ShopFollower shopKeep, Action actionOnSendAway) { this.actionOnSendAway = actionOnSendAway; this.shopKeep = shopKeep; gameObject.SetActive(true); GetComponent <RobustLerper>().StartLerping(); RefreshBuyingList(); SetSellingTab(); }