| | 1 | | using DCL; |
| | 2 | | using DCL.Components; |
| | 3 | | using DCL.Controllers; |
| | 4 | | using DCL.Helpers; |
| | 5 | | using DCL.Models; |
| | 6 | | using System.Collections; |
| | 7 | | using System.Collections.Generic; |
| | 8 | | using UnityEngine; |
| | 9 | |
|
| | 10 | | /// <summary> |
| | 11 | | /// This component describes the lock status of the Entity in the builder in world. |
| | 12 | | /// Builder in World send a message to kernel to change the value of this component in order to lock/unlock it |
| | 13 | | /// </summary> |
| | 14 | | public class DCLLockedOnEdit : BaseDisposable |
| | 15 | | { |
| | 16 | | [System.Serializable] |
| | 17 | | public class Model : BaseModel |
| | 18 | | { |
| | 19 | | public bool isLocked; |
| | 20 | |
|
| 0 | 21 | | public override BaseModel GetDataFromJSON(string json) { return Utils.SafeFromJson<Model>(json); } |
| | 22 | | } |
| | 23 | |
|
| 153 | 24 | | public DCLLockedOnEdit() { model = new Model(); } |
| | 25 | |
|
| 25 | 26 | | public override int GetClassId() { return (int) CLASS_ID.LOCKED_ON_EDIT; } |
| | 27 | |
|
| | 28 | | public void SetIsLocked(bool value) |
| | 29 | | { |
| 0 | 30 | | Model model = (Model) this.model; |
| 0 | 31 | | model.isLocked = value; |
| 0 | 32 | | } |
| | 33 | |
|
| | 34 | | public override IEnumerator ApplyChanges(BaseModel baseModel) |
| | 35 | | { |
| 50 | 36 | | RaiseOnAppliedChanges(); |
| 50 | 37 | | return null; |
| | 38 | | } |
| | 39 | | } |