| | |
| | | return default(TalentElement);
|
| | | }
|
| | |
|
| | | public float GetPercentBySkillElement(int index, float viewHeight, float offset)
|
| | | {
|
| | | if (skillElements != null && index < skillElements.Count)
|
| | | {
|
| | | var element = skillElements[index];
|
| | | var height = contentSizeDelta.y - Mathf.Abs(element.position.y);
|
| | | var percent = Mathf.Clamp01((height - viewHeight) / (contentSizeDelta.y - viewHeight));
|
| | | return Mathf.Clamp01(percent + (offset / (contentSizeDelta.y - viewHeight)));//偏移
|
| | | }
|
| | | return 1;
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | public void ApplyTalentElement(int index,Vector3 _position)
|
| | | {
|