Ejemplo n.º 1
0
 private void Load()
 {
     foreach (var element in m_Current)
     {
         CuiManager.Create().Load(element);
     }
 }
Ejemplo n.º 2
0
    public void Paste()
    {
        if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.V) && clipboardBuffer != null)
        {
            foreach (var element in clipboardBuffer)
            {
                var cui            = CuiManager.Create();
                var pixelComponent = element.Components.OfType <RectPixelComponent>().FirstOrDefault();
                if (pixelComponent != null)
                {
                    element.Components.Remove(pixelComponent);
                }

                cui.Load(element);

                if (pixelComponent == null)
                {
                    element.Components.Add(pixelComponent);
                    var rTransform = cui.GetComponent <RectTransformComponent>();
                    rTransform.SetPixelLocalPosition(pixelComponent.Position);
                    rTransform.SetPixelSize(pixelComponent.Size);
                }
            }
        }
    }