コード例 #1
0
 private void DrawTanks(Graphics g, GameObjectDrawer gameObjectDrawer)
 {
     foreach (var tank in _tanks)
     {
         gameObjectDrawer.DrawGameObject(g, tank);
     }
 }
コード例 #2
0
        public static TDrawerWindow Create <TDrawerWindow>([NotNull] GameObject[] targets, [NotNull] IInspector inspector, Action doOnClosed = null) where TDrawerWindow : DrawerToWindow
        {
            var drawers = DrawerGroup.Create(inspector);
            var members = drawers.Members;

            DrawerArrayPool.InsertAt(ref members, 0, GameObjectDrawer.Create(targets, drawers, inspector), false);
            drawers.SetMembers(members);
            return(Create <TDrawerWindow>(drawers, doOnClosed));
        }
コード例 #3
0
ファイル: Form.cs プロジェクト: SanGreen74/AquariumWork
        public Form(Size size)
        {
            size -= new Size(50, 150);
            Size  = size;

            _buttonLocationX = size.Width - 2 * _buttonDefaultSize.Width;

            _aquarium    = new Aquarium(size);
            _drawer      = new GameObjectDrawer();
            _fishFactory = new FishFactory(_aquarium);

            DoubleBuffered = true;
            SetImagesSettings();
            Init();
        }
コード例 #4
0
        public Rect Draw(Rect position)
        {
                        #if UNITY_EDITOR
            if (Platform.EditorMode)
            {
                bool headerHeightDetermined = true;
                var  actualDrawnPosition    = EditorGUIDrawer.AssetHeader(position, editor, ref headerHeightDetermined);

                                #if UNITY_2018_3_OR_NEWER
                if (isPrefab)
                {
                    const float padding       = 3f;
                    const float doublePadding = padding + padding;

                    position.y     += position.height - OpenInPrefabModeButtonHeight + padding;
                    position.height = OpenInPrefabModeButtonHeight - doublePadding;

                    DrawGUI.Active.ColorRect(position, InspectorUtility.Preferences.theme.AssetHeaderBackground);

                    position.x     += padding;
                    position.width -= doublePadding;

                    // UPDATE: even if prefab is being drawn in grayed out color
                    // due to being inactive, draw the open prefab button without
                    // being grayed out, to make it clear that it remains usable.
                    var guiColorWas = GUI.color;
                    var setColor    = guiColorWas;
                    setColor.a = 1f;
                    GUI.color  = setColor;
                    if (GUI.Button(position, OpenPrefabButtonLabel))
                    {
                        DrawGUI.UseEvent();
                        GameObjectDrawer.OpenPrefab(targets[0]);
                    }

                    GUI.color = guiColorWas;

                    actualDrawnPosition.height += OpenInPrefabModeButtonHeight;
                }
                                #endif

                return(actualDrawnPosition);
            }
                        #endif
            DrawGUI.Runtime.GameObjectHeader(position, targets[0]);
            return(position);
        }
コード例 #5
0
 public TanksGame(GameObjectDrawer gameObjectDrawer)
 {
     _gameObjectDrawer = gameObjectDrawer;
 }