Example #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);
        }
Example #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);
         }
     }
 }
 internal void Initialize(FrontObject obj)
 {
     Object = obj;
     InnerInitialize();
 }
Example #4
0
 // Start is called before the first frame update
 void Start()
 {
     buttonRef = GetComponent <UnityEngine.UI.Button>();
     buttonRef.onClick.AddListener(ClickHandler);
     frontObject = GetComponent <FrontObject>();
 }
Example #5
0
 private void ViewObjectRemovedHandler(string id, FrontObject obj)
 {
     RemoveComponentOfObject(obj);
 }
Example #6
0
 // Start is called before the first frame update
 void Start()
 {
     inputFieldRef.onSubmit.AddListener(OnSubmitHandler);
     buttonRef.onClick.AddListener(SubmitValue);
     frontObject = GetComponent <FrontObject>();
 }