Ejemplo n.º 1
0
    public static void Show(HorizontalZoneEditor zone)
    {
        var dialog = Create(MenuManager.Instance.horizontalZoneSettingsPrefab);

        dialog.zone = zone;
        dialog.nameInputField.text = zone.Name;
        dialog.colorButton.GetComponent <Image>().color = zone.Color;
        dialog.colorIdx = Array.FindIndex(Colors, (color) => color.Equals(zone.Color));

        dialog.ownerTakeAwayPermissionDropdown.AddOptions(new List <string>(Permission.permissionTypeNames));
        dialog.ownerDropOntoPermissionDropdown.AddOptions(new List <string>(Permission.permissionTypeNames));
        dialog.ownerViewPermissionDropdown.AddOptions(new List <string>(Permission.permissionTypeNames));

        dialog.othersTakeAwayPermissionDropdown.AddOptions(new List <string>(Permission.permissionTypeNames));
        dialog.othersDropOntoPermissionDropdown.AddOptions(new List <string>(Permission.permissionTypeNames));
        dialog.othersViewPermissionDropdown.AddOptions(new List <string>(Permission.permissionTypeNames));


        dialog.ownerTakeAwayPermissionDropdown.value = ((byte)zone.OwnerTakeAwayPermissionType);
        dialog.ownerDropOntoPermissionDropdown.value = ((byte)zone.OwnerDropOntoPermissionType);
        dialog.ownerViewPermissionDropdown.value     = ((byte)zone.OwnerViewPermissionType);

        dialog.othersTakeAwayPermissionDropdown.value = ((byte)zone.OthersTakeAwayPermissionType);
        dialog.othersDropOntoPermissionDropdown.value = ((byte)zone.OthersDropOntoPermissionType);
        dialog.othersViewPermissionDropdown.value     = ((byte)zone.OthersViewPermissionType);
        dialog.flipCardsWhenDroppedToggle.isOn        = zone.FlipCardsWhenDropped;
    }
Ejemplo n.º 2
0
 public void copyProperties(HorizontalZoneEditor zone)
 {
     zone.OwnerTakeAwayPermissionType  = this.OwnerTakeAwayPermissionType;
     zone.OthersTakeAwayPermissionType = this.OthersTakeAwayPermissionType;
     zone.OwnerViewPermissionType      = this.OwnerViewPermissionType;
     zone.OthersViewPermissionType     = this.OthersViewPermissionType;
     zone.FlipCardsWhenDropped         = this.FlipCardsWhenDropped;
     zone.OwnerDropOntoPermissionType  = this.OwnerDropOntoPermissionType;
     zone.OthersDropOntoPermissionType = this.OthersDropOntoPermissionType;
 }
Ejemplo n.º 3
0
    public override void OnMenuItemClicked(ContextMenuItem menuItem)
    {
        if (menuItem.id == 2)
        {
            HorizontalZoneEditor cloned = Instantiate(this);

            copyProperties(cloned);

            cloned.transform.position = new Vector3(0, 0, 0f);
            clonedZones.Add(cloned);
        }
        if (menuItem.id == 1)
        {
            //Settings
            HorizontalZoneSettings.Show(this);
        }
        else
        {
            base.OnMenuItemClicked(menuItem);
        };
    }