Exemple #1
0
    void createFireAncestor()
    {
        float      xCurveOffset, zCurveOffset;
        float      xCurveMagnitude = 0.015f;
        float      zCurveMagnitude = 0.015f;
        GameObject prefab          = layerPrefabCW;

        for (int i = 0; i < layersCount; i++)
        {
            xCurveOffset = Mathf.Sin((float)i / (float)layersCount * (Mathf.PI * 3f)) * (xCurveMagnitude * (float)i);
            zCurveOffset = Mathf.Cos((float)i / (float)layersCount * (Mathf.PI * 3f)) * (zCurveMagnitude * (float)i);

            if ((i % 2) == 0)
            {
                Debug.Log("Odd so using CCW " + i);
                prefab = layerPrefabCCW;
            }
            else
            {
                prefab = layerPrefabCW;
            }

            GameObject      newLayer           = Instantiate(prefab, new Vector3(i * xOffset + xCurveOffset, i * ySpacing, i * zOffset + zCurveOffset), Quaternion.Euler(0.0f, i * 15f, 0.0f), faParent.transform) as GameObject;
            LayerController newLayerController = newLayer.GetComponentInChildren <LayerController> ();
            layerControllers.Add(newLayerController);
        }

//		Debug.Log ("Layers = " + layers );
    }
    private void LayerChange()
    {
        LayerController layerController = gameObject.AddComponent <LayerController>();

        layerController.SetLayer(this.gameObject, this.gameObject);
        Destroy(layerController);
    }
Exemple #3
0
 void Start()
 {
     m_gameManager     = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>();
     m_gameWin         = GameObject.FindGameObjectWithTag("UI").GetComponent <GameWin>();
     m_layerController = m_gameManager.GetComponent <LayerController>();
     m_launch          = GetComponent <AudioSource>();
 }
Exemple #4
0
    public Layer(Short2 size, LayerController layerUi)
    {
        this.size    = size;
        this.layerUi = layerUi;

        RenderLayer();
    }
Exemple #5
0
 public void OnLayerChanged(LayerController layer)
 {
     if (OnLayerChangedEvent != null)
     {
         OnLayerChangedEvent(layer);
     }
 }
Exemple #6
0
 public override void Run(Altaxo.Graph.GUI.GraphController ctrl)
 {
     ctrl.EnsureValidityOfCurrentLayerNumber();
     if (null != ctrl.ActiveLayer)
     {
         LayerController.ShowDialog(ctrl.ActiveLayer);
     }
 }
Exemple #7
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "LayerTrigger")
     {
         lc = other.GetComponent <LayerController>();
         sprite.sortingLayerName = lc.thisLayer;
     }
 }
Exemple #8
0
 private void EhMenuGraphLayer_OnClick(object sender, System.EventArgs e)
 {
     EnsureValidityOfCurrentLayerNumber();
     if (null != this.ActiveLayer)
     {
         LayerController.ShowDialog(this.ActiveLayer);
     }
 }
Exemple #9
0
    protected virtual void Start()
    {
        m_rigidbody       = GetComponent <Rigidbody>();
        m_gameManager     = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>();
        m_audioManager    = GameObject.FindGameObjectWithTag("Audio").GetComponent <AudioManager>();
        m_layerController = m_gameManager.GetComponent <LayerController>();

        m_animator = GetComponentInChildren <Animator>();
    }
Exemple #10
0
    public void SelectLayer(LayerController layerUi)
    {
        var layer = FindLayer(layerUi);

        if (layer != null)
        {
            selectedLayer = FindLayer(layerUi);
        }
    }
Exemple #11
0
    public void DeleteLayer(LayerController layerUi)
    {
        var layer = FindLayer(layerUi);

        if (layer != null)
        {
            layers.Remove(layer);
        }
    }
Exemple #12
0
        static WinFormsGraphController()
        {
            _emptyReadOnlyList = new List <IHitTestObject>().AsReadOnly();

            // register here editor methods
            LayerController.RegisterEditHandlers();
            XYPlotLayer.PlotItemEditorMethod     = new DoubleClickHandler(EhEditPlotItem);
            TextGraphic.PlotItemEditorMethod     = new DoubleClickHandler(EhEditPlotItem);
            TextGraphic.TextGraphicsEditorMethod = new DoubleClickHandler(EhEditTextGraphics);
        }
Exemple #13
0
 public LayerQueue(LayerController[]  layerControllerArray)
 {
     capacity=layerControllerArray.Length;
     lcArray=sortList (layerControllerArray);
     for (int i = 0; i < lcArray.Length; i++) {
         lcArray[i].deactivate();
     }
     activeLayersCount     = 0     ;
     redoLayersCount       = 0     ;
     initializedFirstLayer = false ;
 }
Exemple #14
0
        public AnatomyContextWindowManager(SceneViewController sceneViewController, AnatomyController anatomyController, LayerController layerController, AnatomyFinder anatomyFinder, AnatomyTaskManager anatomyTaskManager)
        {
            this.sceneViewController = sceneViewController;
            this.anatomyController   = anatomyController;
            this.anatomyController.SelectedAnatomy.SelectedAnatomyChanged += anatomyController_SelectedAnatomyChanged;
            this.anatomyFinder      = anatomyFinder;
            this.layerController    = layerController;
            this.anatomyTaskManager = anatomyTaskManager;

            liveThumbnailController             = new LiveThumbnailController("ContextWindows_", new IntSize2(ThumbRenderSize, ThumbRenderSize), sceneViewController);
            liveThumbnailController.MaxPoolSize = 1;
        }
Exemple #15
0
    public void OnLayerDraged(LayerController layer)
    {
        layer.DeleteFlag = Vector2.Distance(layer.CurrentPosition, DeleteIconRect.anchoredPosition) < 100;

        var index = layers.IndexOf(layer);

        layers.Sort(new LayerController.VerticalPositionComparer());
        if (layers.IndexOf(layer) != index)
        {
            LayerTabFitter.Fit(layers.ToArray());
        }
    }
Exemple #16
0
    public Layer FindLayer(LayerController layerUi)
    {
        foreach (var layer in layers)
        {
            if (layer.Index == layerUi.Index)
            {
                return(layer);
            }
        }

        return(null);
    }
Exemple #17
0
 public virtual void BuildLayer(LayerController prevLayer, LayerController nextLayer)
 {
     tiles = new Dictionary <Coordinate2D, TileController>();
     for (int i = 0; i < layerHeight; i++)
     {
         for (int j = 0; j < layerWidth; j++)
         {
             GameObject tc = GameObject.Instantiate(tileControllerPrefab, parentObjectForTiles);
             tc.name = "Tile " + j + "/" + i;
             tiles.Add(Coordinate2D.Is(j, i), tc.GetComponent <TileController>());
         }
     }
 }
Exemple #18
0
        /// <summary>
        /// Initializes a new instance of the LayerControlPanel class with a layer controller
        /// </summary>
        /// <param name="controller">The layer controller to bind to this layer control panel</param>
        public LayerControlPanel(LayerController controller)
        {
            _layerControls = new List <LayerControl>();

            ClearAllControls();

            if (_controller?.Frame != null)
            {
                SetController(controller);
            }

            InitializeComponent();
        }
Exemple #19
0
        public void Should_Be_Ok_When_Posting()
        {
            var fakes                      = new FakeContext("LayerControllerTest");
            var fakeLayerService           = fakes.FakeLayerService().Object;
            List <LayerViewModel> expected = fakes.Get <LayerViewModel>();
            var controller                 = new LayerController(fakeLayerService);

            foreach (var item in expected)
            {
                var result = controller.Post(item);

                Assert.NotNull(result);
                Assert.IsType <CreatedAtActionResult>(result);
            }
        }
Exemple #20
0
    void poofPoofer(int index, int direction, float value)
    {
        LayerController layerController = layerControllers[index];

        poofer = layerController.pooferCW;
        if (direction == 1)
        {
            poofer = layerController.pooferCCW;
        }

        int emit = Mathf.RoundToInt(value * emissionRate);

        poofer.Emit(emit);

        layerController.poofPoofer();
    }
Exemple #21
0
        /// <summary>
        /// Sets the layer controller for this LayerControlPanel instance
        /// </summary>
        /// <param name="controller">The controller for this LayerControlPanel</param>
        public void SetController(LayerController controller)
        {
            _controller = controller;

            _controller.LayerCreated            += OnLayerCreated;
            _controller.LayerRemoved            += OnLayerRemoved;
            _controller.LayerMoved              += OnLayerMoved;
            _controller.FrameChanged            += OnFrameChanged;
            _controller.ActiveLayerIndexChanged += OnActiveLayerIndexChanged;
            _controller.LayerNameUpdated        += OnLayerNameUpdated;

            if (_controller.Frame != null)
            {
                ReloadLayers();
            }
        }
Exemple #22
0
    public LayerController[] getVisibleLayersCurrentLayerFirst()
    {
        LayerController[] ret = new LayerController[getVisibleLayerCount()];
        int layerId           = currentLayerId;

        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = lcArray[layerId];
            layerId++;
            if (layerId == capacity)
            {
                layerId = 0;
            }
        }
        return(ret);
    }
Exemple #23
0
        public void Should_Be_Ok_When_GetById(int id)
        {
            var fakes            = new FakeContext("LayerControllerTest");
            var fakeLayerService = fakes.FakeLayerService().Object;
            var expected         = fakeLayerService.Get(id);
            var controller       = new LayerController(fakeLayerService);

            var result       = controller.Get(id);
            var actionResult = result as OkObjectResult;

            Assert.IsType <OkObjectResult>(actionResult);
            var actual = actionResult.Value as LayerViewModel;

            Assert.NotNull(actual);
            Assert.Equal(expected, actual, new LayerViewModelIDComparer());
        }
Exemple #24
0
        void treeMouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                // Select the clicked node
                tree.SelectedNode = tree.GetNodeAt(e.X, e.Y);

                ContextMenuStrip menu = treemenu;
                if (tree.SelectedNode != null)
                {
                    // Menu selection if elses.. for each node type there is a if else branch
                    // TODO! shoot myself for creating such structure..
                    if (tree.SelectedNode.Tag != null)
                    {
                        if (tree.SelectedNode.Tag is ContainerController)
                        {
                            menu = containerMenu;
                        }
                        else if (tree.SelectedNode.Tag is LayerController)
                        {
                            LayerController lc = (LayerController)tree.SelectedNode.Tag;
                            if (!lc.alreadyInUse())
                            {
                                menu = layerMenu;
                            }
                            else
                            {
                                menu = basicMenu;
                            }
                        }
                        else if (tree.SelectedNode.Tag is FieldController)
                        {
                            menu = basicMenu;
                        }
                        else if (tree.SelectedNode.Tag is PolygonController)
                        {
                            menu = basicMenu;
                        }
                        else if (tree.SelectedNode.Tag is TextController)
                        {
                            menu = basicMenu;
                        }
                    }
                }
                menu.Show(tree, e.Location);
            }
        }
Exemple #25
0
        private void createLayer(object sender, EventArgs e)
        {
            TreeNode selected = tree.SelectedNode;

            if (selected.Tag is ContainerController)
            {
                // model
                ContainerController parent = (ContainerController)selected.Tag;
                LayerController     node   = new LayerController(new Layer());
                parent.add(node);

                // ui
                TreeNode added = selected.Nodes.Add(node.getName());
                added.Tag = node;
                selected.Expand();
            }
        }
Exemple #26
0
        public void ShouldInitialize()
        {
            var yaml = YamlTestFileLoader.Load(@"Zorgtoeslag5.layers.yaml");
            var sut  = new LayerController();

            sut.Initialize(yaml);
            Assert.Equal(sut.LayerConfiguration.Start.Line, sut.LayerConfiguration.End.Line);
            Assert.Equal(sut.LayerConfiguration.Start.Col, sut.LayerConfiguration.End.Col);
            Assert.Equal(sut.LayerConfiguration.Start.Index, sut.LayerConfiguration.End.Index);
            Assert.Equal("1.0", sut.LayerConfiguration.Version);
            Assert.Equal(3, sut.LayerConfiguration.Layers.ToList().Count());
            Assert.Single(sut.LayerConfiguration.Layers.ElementAt(0).Contexts);
            Assert.Equal(3, sut.LayerConfiguration.Layers.ElementAt(1).Contexts.Count());
            Assert.Null(sut.LayerConfiguration.Layers.ElementAt(1).Contexts.ElementAt(0).Language);
            Assert.Equal(LanguageCode.EN, sut.LayerConfiguration.Layers.ElementAt(1).Contexts.ElementAt(1).Language);
            Assert.Equal(LanguageCode.AR, sut.LayerConfiguration.Layers.ElementAt(1).Contexts.ElementAt(2).Language);
            Assert.Single(sut.LayerConfiguration.Layers.ElementAt(2).Contexts);
        }
Exemple #27
0
    public void PlayerInit(GameObject player)
    {
        Transform       parent          = player.transform;
        LayerController layerController = gameObject.AddComponent <LayerController>();

        GameObject obj = Instantiate(king, parent.transform.TransformPoint(0.5f, -0.25f, -5.5f), parent.rotation, parent);

        obj.name = "King";
        obj      = Instantiate(queen, parent.transform.TransformPoint(-0.5f, -0.25f, -5.5f), parent.rotation, parent);
        obj.name = "Queen";
        obj      = Instantiate(bishop, parent.transform.TransformPoint(1.5f, -0.25f, -5.5f), parent.rotation, parent);
        obj.name = "Bishop";
        obj      = Instantiate(bishop, parent.transform.TransformPoint(-1.5f, -0.25f, -5.5f), parent.rotation, parent);
        obj.name = "Bishop";
        obj      = Instantiate(rook, parent.transform.TransformPoint(5.5f, -0.25f, -5.5f), parent.rotation, parent);
        obj.name = "Rook";
        obj      = Instantiate(rook, parent.transform.TransformPoint(-5.5f, -0.25f, -5.5f), parent.rotation, parent);
        obj.name = "Rook";
        for (float i = -4.5f; i < 6; i += 2)
        {
            obj      = Instantiate(archer, parent.transform.TransformPoint(i, -0.25f, -4.5f), parent.rotation, parent);
            obj.name = "Archer";
        }
        for (float i = -5.5f; i < 6; i += 2)
        {
            obj      = Instantiate(swordman, parent.transform.TransformPoint(i, -0.25f, -4.5f), parent.rotation, parent);
            obj.name = "Swordman";
        }
        for (float i = -4.5f; i < -2; i++)
        {
            obj      = Instantiate(knight, parent.transform.TransformPoint(i, -0.25f, -5.5f), parent.rotation, parent);
            obj.name = "Knight";
        }
        for (float i = 4.5f; 2 < i; i--)
        {
            obj      = Instantiate(knight, parent.transform.TransformPoint(i, -0.25f, -5.5f), parent.rotation, parent);
            obj.name = "Knight";
        }

        layerController.SetLayer(player, player);
        Destroy(layerController);
    }
Exemple #28
0
        private void createText(object sender, EventArgs e)
        {
            TreeNode selected = tree.SelectedNode;

            if (selected.Tag is LayerController)
            {
                // model
                LayerController parent = (LayerController)selected.Tag;
                TextController  node   = new TextController(new Text());
                if (!parent.add(node))
                {
                    // failed! TODO
                }

                // ui
                TreeNode added = selected.Nodes.Add(node.getName());
                added.Tag = node;
                selected.Expand();
            }
        }
Exemple #29
0
        public AnatomyContextWindow(AnatomyContextWindowManager windowManager, LayerController layerController)
            : base("Medical.GUI.Anatomy.AnatomyContextWindow.layout")
        {
            this.windowManager   = windowManager;
            this.layerController = layerController;

            captionWidget = window.CaptionWidget as Button;

            pinButton = (Button)window.findWidgetChildSkin("PinButton");
            pinButton.MouseButtonClick += new MyGUIEvent(pinButton_MouseButtonClick);

            thumbnailImage       = (ImageBox)window.findWidget("ThumbnailImage");
            captionToBorderDelta = window.Width - captionWidget.getTextRegion().width;
            IntCoord clientCoord = window.ClientCoord;

            windowBottomPaddingSize = window.Height - clientCoord.top - clientCoord.height;

            transparencySlider             = new AnatomyTransparencySlider((ScrollBar)window.findWidget("TransparencySlider"));
            transparencySlider.RecordUndo += transparencySlider_RecordUndo;

            windowStartSize = new IntSize2(window.Width, window.Height);

            centerButton = (Button)window.findWidget("CenterButton");
            centerButton.MouseButtonClick += new MyGUIEvent(centerMenuItem_MouseButtonClick);

            featureButton = (Button)window.findWidget("FeatureButton");
            featureButton.MouseButtonClick += new MyGUIEvent(featureButton_MouseButtonClick);

            Button hideButton = (Button)window.findWidget("HideButton");

            hideButton.MouseButtonClick += new MyGUIEvent(hideButton_MouseButtonClick);

            Button showButton = (Button)window.findWidget("ShowButton");

            showButton.MouseButtonClick += new MyGUIEvent(showButton_MouseButtonClick);

            anatomyFinderButton = (Button)window.findWidget("AnatomyFinder");
            anatomyFinderButton.MouseButtonClick += anatomyFinderButton_MouseButtonClick;

            commandScroller = (ScrollView)window.findWidget("CommandScroller");
        }
Exemple #30
0
    public void OnLayerReleased(LayerController layer)
    {
        DeleteIconHidable.Hide();

        if (layer.DeleteFlag)
        {
            layers.Remove(layer);

            if (OnLayerDeletedEvent != null)
            {
                OnLayerDeletedEvent(layer);
            }
        }

        LayerTabFitter.Fit(layers.ToArray());

        if (OnLayerChangedEvent != null)
        {
            OnLayerChangedEvent(layer);
        }
    }
Exemple #31
0
    public Layer(LayerFile file, Short2 size, LayerController layerUi)
    {
        this.size    = size;
        this.layerUi = layerUi;

        layerUi.Index = file.Index;
        if (file.Hided)
        {
            layerUi.OnHideToggleClicked();
        }
        if (file.Locked)
        {
            layerUi.OnLockToggleClicked();
        }
//		layerUi.Hided = file.Hided;
//		layerUi.Locked = file.Locked;
        content = file.Content;
//		foreach (var pair in file.Content)
//			content.Add(pair.k, pair.c);

        RenderLayer();
    }
 public void OnEnable()
 {
     lc = (LayerController)target;
 }
Exemple #33
0
    public LayerController[] getVisibleLayersCurrentLayerFirst()
    {
        LayerController[] ret=new LayerController[getVisibleLayerCount()];
        int layerId=currentLayerId;

        for (int i = 0; i < ret.Length; i++) {
            ret[i] = lcArray[layerId];
            layerId++;
            if (layerId == capacity)
                layerId = 0;
        }
        return ret;
    }
Exemple #34
0
 private LayerController[] sortList(LayerController[]  layerControllerArray)
 {
     return layerControllerArray.Select(layerController=>layerController)
     .OrderBy(layerController=>layerController.gameObject.transform.position.z)
     .ToArray();;
 }