Пример #1
0
        private void ObjectAddedHandler(string frontObjectName, FrontObject obj)
        {
            if (frontObjectName != targetObjectName)
            {
                return;
            }
            var component = ComponentConstructor();

            component.Initialize(obj);
            FrontSystem.Components.Add(obj.Identifier, component);
        }
Пример #2
0
 public void RemoveComponentOfObject(FrontObject obj)
 {
     if (Components.TryGet(obj.Identifier, out List <FrontObjectComponent> components))
     {
         var tmpList = new List <FrontObjectComponent>(components);
         foreach (var comp in tmpList)
         {
             comp.Dispose();
             Components.Remove(obj.Identifier, comp);
         }
     }
 }
Пример #3
0
 internal void Initialize(FrontObject obj)
 {
     Object = obj;
     InnerInitialize();
 }
Пример #4
0
 // Start is called before the first frame update
 void Start()
 {
     buttonRef = GetComponent <UnityEngine.UI.Button>();
     buttonRef.onClick.AddListener(ClickHandler);
     frontObject = GetComponent <FrontObject>();
 }
Пример #5
0
 private void ViewObjectRemovedHandler(string id, FrontObject obj)
 {
     RemoveComponentOfObject(obj);
 }
Пример #6
0
 // Start is called before the first frame update
 void Start()
 {
     inputFieldRef.onSubmit.AddListener(OnSubmitHandler);
     buttonRef.onClick.AddListener(SubmitValue);
     frontObject = GetComponent <FrontObject>();
 }