private void ShowInfo(string name, Sprite image) { SetName(name); SetImage(image); LabelAnimation.Stop(); PlayerImageAnimation.Stop(); LabelAnimation .SetPosition(_infoLabel.transform.localPosition, _labelPosition, true) .Play(); PlayerImageAnimation .SetPosition(_playerImage.transform.localPosition, _playerImagePosition, true) .Play(); }
private void HideInfo() { LabelAnimation.Stop(); PlayerImageAnimation.Stop(); if (transform.position.x < 0) { LabelAnimation.SetPosition(_infoLabel.transform.localPosition, _infoLabel.transform.localPosition + (_infoLabel.transform.right * -1) * _animateDistance, true).Play(); PlayerImageAnimation.SetPosition(_playerImage.transform.localPosition, _playerImage.transform.localPosition + (_infoLabel.transform.right * -1) * _animateDistance, true).Play(); } else { LabelAnimation.SetPosition(_infoLabel.transform.localPosition, _infoLabel.transform.localPosition + (_infoLabel.transform.right) * _animateDistance, true).Play(); PlayerImageAnimation.SetPosition(_playerImage.transform.localPosition, _playerImage.transform.localPosition + (_infoLabel.transform.right) * _animateDistance, true).Play(); } }