| | 1 | | using DCL.Components; |
| | 2 | | using DCL.Controllers; |
| | 3 | | using DCL.Helpers; |
| | 4 | | using DCL.Models; |
| | 5 | | using System.Collections; |
| | 6 | | using System.Collections.Generic; |
| | 7 | | using UnityEngine; |
| | 8 | |
|
| | 9 | | namespace DCL |
| | 10 | | { |
| | 11 | | public class UUIDComponent : BaseComponent |
| | 12 | | { |
| | 13 | | [System.Serializable] |
| | 14 | | public class Model : BaseModel |
| | 15 | | { |
| | 16 | | public string type; |
| | 17 | | public string uuid; |
| | 18 | |
|
| 0 | 19 | | public override BaseModel GetDataFromJSON(string json) { return Utils.SafeFromJson<Model>(json); } |
| | 20 | |
|
| | 21 | | public CLASS_ID_COMPONENT GetClassIdFromType() |
| | 22 | | { |
| 69 | 23 | | switch (type) |
| | 24 | | { |
| | 25 | | case OnPointerDown.NAME: |
| 21 | 26 | | return CLASS_ID_COMPONENT.UUID_ON_DOWN; |
| | 27 | | case OnPointerUp.NAME: |
| 8 | 28 | | return CLASS_ID_COMPONENT.UUID_ON_UP; |
| | 29 | | case OnClick.NAME: |
| 21 | 30 | | return CLASS_ID_COMPONENT.UUID_ON_CLICK; |
| | 31 | | case OnPointerHoverEnter.NAME: |
| 13 | 32 | | return CLASS_ID_COMPONENT.UUID_ON_HOVER_ENTER; |
| | 33 | | case OnPointerHoverExit.NAME: |
| 6 | 34 | | return CLASS_ID_COMPONENT.UUID_ON_HOVER_EXIT; |
| | 35 | | } |
| | 36 | |
|
| 0 | 37 | | return CLASS_ID_COMPONENT.UUID_CALLBACK; |
| | 38 | | } |
| | 39 | | } |
| | 40 | |
|
| | 41 | | public override IEnumerator ApplyChanges(BaseModel newModel) |
| | 42 | | { |
| 0 | 43 | | this.model = newModel ?? new UUIDComponent.Model(); |
| 0 | 44 | | return null; |
| | 45 | | } |
| | 46 | |
|
| 0 | 47 | | public override int GetClassId() { return (int) CLASS_ID_COMPONENT.UUID_CALLBACK; } |
| | 48 | | } |
| | 49 | | } |