} // end NoviceVillage public void Initialize() { m_mainCanvas = new MainCanvas(); m_mainAudio = new MainAudio(); m_mainCamera = new MainCamera(); ObjectTool.InstantiateGo("npc_transmitter", ResourcesTool.LoadPrefab("npc_transmitter"), null, new UnityEngine.Vector3(0, 0, 10), new UnityEngine.Vector3(0, 270, 0), UnityEngine.Vector3.one).AddComponent<NPC_Transmitter2>(); m_characterManager.factory.CreateMainCharacter(new UnityEngine.Vector3(0, 0, 0)); m_characterManager.factory.CreateNPC("901001", new UnityEngine.Vector3(20, 0, 0)); m_characterManager.factory.CreateNPC("902001", new UnityEngine.Vector3(20, 0, 10)); m_characterManager.factory.CreateNPC("903001", new UnityEngine.Vector3(20, 0, 20)); m_characterManager.factory.CreateNPC("904001", new UnityEngine.Vector3(10, 0, 20)); m_characterManager.factory.CreateNPC("904002", new UnityEngine.Vector3(0, 0, 20)); m_characterManager.factory.CreateNPC("904003", new UnityEngine.Vector3(-10, 0, 20)); m_characterManager.factory.CreateNPC("904004", new UnityEngine.Vector3(-20, 0, 20)); m_characterManager.factory.CreateNPC("904005", new UnityEngine.Vector3(-20, 0, 10)); m_characterManager.factory.CreateNPC("904006", new UnityEngine.Vector3(-20, 0, 0)); m_characterManager.factory.CreateNPC("904007", new UnityEngine.Vector3(-20, 0, -10)); m_characterManager.factory.CreateNPC("904008", new UnityEngine.Vector3(-20, 0, -20)); m_characterManager.factory.CreateNPC("904009", new UnityEngine.Vector3(-10, 0, -20)); m_characterManager.factory.CreateNPC("904010", new UnityEngine.Vector3(0, 0, -20)); m_characterManager.factory.CreateNPC("905001", new UnityEngine.Vector3(10, 0, -20)); m_characterManager.factory.CreateNPC("905002", new UnityEngine.Vector3(20, 0, -20)); m_characterManager.factory.CreateNPC("905003", new UnityEngine.Vector3(20, 0, -10)); m_characterManager.factory.CreateNPC("906001", new UnityEngine.Vector3(30, 0, 0)); m_characterManager.factory.CreateNPC("906002", new UnityEngine.Vector3(0, 0, 30)); m_characterManager.factory.CreateNPC("906003", new UnityEngine.Vector3(-30, 0, 0)); m_mainAudio.PlayBackgroundMusic("fight_scene_bgm"); if (null == mainCharacter) { DebugTool.LogError("NoviceVillage CreateMainCharacter is null!!"); return; } // end if m_mainCamera.SetTarget(mainCharacter); mainCharacter.fsm.PerformTransition("wait"); uiPanelFSM.PerformTransition(new UIFightPanel()); } // end Initialize
private void GraphMain_PaintSurface(object sender, SkiaSharp.Views.Desktop.SKPaintSurfaceEventArgs e) { MainSurface = e.Surface; MainCanvas = MainSurface.Canvas; if (clearRefreshCounter > ClearRefreshRate) { clearRefreshCounter = 0; refresh = true; } clearRefreshCounter++; if (refresh) { MainCanvas.Clear(SKColors.Transparent); refresh = false; } if (displayArray1 != null && displayArray1.Length > 0) { MainCanvas.DrawPoints(PointMode1, displayArray1, GraphPaint1); } }
private void SetTextureBitmap(WriteableBitmap textureBitmap = null) { if (timer.IsEnabled == true) { IsDefaultVectorL = true; } if (IsTextureFill == false) { //AnotherTextureFillRadioButtonClick = false; widthBitmap = Globals.DefaultBitmapWidth; heightBitmap = Globals.DefaultBitmapHeight; PictureWriteableBitmap = new WriteableBitmap(widthBitmap, heightBitmap, 96, 96, PixelFormats.Bgra32, null); var colInfo = FillColorComboBox.SelectedItem as ColorInfo; Paint.FillBitmap(PictureWriteableBitmap, colInfo.color); } else { //AnotherTextureFillRadioButtonClick = true; PictureWriteableBitmap = textureBitmap; widthBitmap = PictureWriteableBitmap.PixelWidth; heightBitmap = PictureWriteableBitmap.PixelHeight; } RemoveGrid(MainCanvas); writeableBitmap = new WriteableBitmap(PictureWriteableBitmap); writeableBitmapColor = new SimpleColor[heightBitmap, widthBitmap]; PictureBitmapColor = new SimpleColor[heightBitmap, widthBitmap]; Paint.ReadColorsFromBitmap(PictureWriteableBitmap, PictureBitmapColor); Paint.ReadColorsFromBitmap(writeableBitmap, writeableBitmapColor); triangleFillingMode.writeableBitmap = writeableBitmap; triangleFillingMode.PictureBitmapColor = PictureBitmapColor; triangleFillingMode.writeableBitmapColor = writeableBitmapColor; MainCanvas.Width = widthBitmap; MainCanvas.Height = heightBitmap; this.MaxHeight = heightBitmap + 4 * Globals.GridMargin; image = new Image { Source = writeableBitmap, IsHitTestVisible = false, Width = widthBitmap, Height = heightBitmap }; Panel.SetZIndex(image, Globals.BitmapZIndex); MainCanvas.Children.Add(image); MainCanvas.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); MainCanvas.Arrange(new Rect(0, 0, MainCanvas.DesiredSize.Width, MainCanvas.DesiredSize.Height)); SetNormalVectorBitmap(NormalWriteableBitmap); GenerateGrid(MainCanvas); GenerateTimerPathList(); }
/// <summary> /// Initialize component of main window /// </summary> public MainWindow() { try { this.DataContext = this; InitializeComponent(); MainCanvas.Focus(); MainCanvas.MouseUp += OnMouseUp; MainCanvas.MouseMove += PolygonDrag; MainCanvas.MouseLeftButtonDown += MyMouseDownHandler; SaveButton.Command = new SaveCommand(); polygonesList.Command = new ShapesCommand(); this.Title = "Untitled.xml"; polygonesList.ItemsSource = polygons; MainCanvas.KeyUp += KeyboardDragging; Closing += new System.ComponentModel.CancelEventHandler((object sender, System.ComponentModel.CancelEventArgs e) => { Save(); if (!close) { e.Cancel = true; } }); } catch (Exception ex) { throw new ArgumentException(ex.ToString()); } }
/// <summary> /// 选择墙纸 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void WallPapersList_ItemClick(object sender, ItemClickEventArgs e) { foreach (var item in WallPapersList.Items) { (((WallPapersList.ContainerFromItem(item) as GridViewItem).ContentTemplateRoot as RelativePanel).Children[1] as Rectangle).Visibility = Visibility.Collapsed; } (((WallPapersList.ContainerFromItem(e.ClickedItem) as GridViewItem).ContentTemplateRoot as RelativePanel).Children[1] as Rectangle).Visibility = Visibility.Visible; //创建墙纸 _wall_paperUI = new WallPaperUI() { Editing = true, Height = 100, Width = 100, Image = null, X = 150, Y = 150 }; MainCanvas.Invalidate(); CanvasDevice device = CanvasDevice.GetSharedDevice(); var img = await CanvasBitmap.LoadAsync(device, new Uri(e.ClickedItem.ToString())); if (img != null) { if (_wallpapers != null) { (_wall_paperUI as WallPaperUI).Width = img.Size.Width; (_wall_paperUI as WallPaperUI).Height = img.Size.Height; (_wall_paperUI as WallPaperUI).Image = img; MainCanvas.Invalidate(); } } ; }
/// <summary> /// Clear the graph if not empty /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuReset_Click(object sender, RoutedEventArgs e) { if (!MainCanvas.IsEmpty()) { MessageBoxResult result = MessageBox.Show("Would you like to save the current graph before openning a new one?", "Current graph is not saved!", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning); if (result == MessageBoxResult.Yes) { SaveToFile(); } else if (result == MessageBoxResult.No) { MainCanvas.Children.Clear(); graph = new CanvasGraph(); } else if (result == MessageBoxResult.Cancel) { // do nothing } } else { MainCanvas.Children.Clear(); graph = new CanvasGraph(); } }
void initNextLevelColor() { MainCanvas mainCanvasScript = gameObject.GetComponent <MainCanvas>(); //init next level anim int nextLevel = PlayerPrefs.GetInt("NextLevel"); if (nextLevel == 86) { nextLevel--; nextLevelAnimator = GameObject.Find((nextLevel).ToString()).GetComponent <Animator>(); nextLevelAnimator.SetBool("isNextLevel", false); //init next level color nextLevelImage = GameObject.Find(nextLevel.ToString()).GetComponent <Image>(); nextLevelImage.color = Color.yellow; //init scroll rect target scrollRectTarget = GameObject.Find(nextLevel.ToString()).GetComponent <RectTransform>(); mainCanvasScript.SnapTo(scrollRectTarget); } else { nextLevelAnimator = GameObject.Find(nextLevel.ToString()).GetComponent <Animator>(); nextLevelAnimator.SetBool("isNextLevel", true); //init next level color nextLevelImage = GameObject.Find(nextLevel.ToString()).GetComponent <Image>(); nextLevelImage.color = Color.green; //init scroll rect target scrollRectTarget = GameObject.Find(nextLevel.ToString()).GetComponent <RectTransform>(); mainCanvasScript.SnapTo(scrollRectTarget); } }
private void GraphMain_PaintSurface(object sender, SkiaSharp.Views.Desktop.SKPaintSurfaceEventArgs e) { MainSurface = e.Surface; MainCanvas = MainSurface.Canvas; if (refresh) { MainCanvas.Clear(SKColors.Black); refresh = false; } // draw eraser MainCanvas.DrawRect(currentX, 0, 40, graphMain.CanvasSize.Height, ErasePaint); if (ClearFlag) { //MainCanvas.Clear(SKColors.Transparent); ClearFlag = false; if (displayArray1 != null && displayArray1.Length > 0) { MainCanvas.DrawPoints(PointMode2, displayArray1, GraphPaint1); } } else { if (displayArray1 != null && displayArray1.Length > 0) { MainCanvas.DrawPoints(PointMode1, displayArray1, GraphPaint1); } } }
/// <summary> /// Run a complete detection on a new image. /// </summary> private void RunDetection() { // clear the label Description.Text = "---"; // show the spinner Spinner.Visibility = Visibility.Visible; // detect what's in the image (var cat, var dog) = DetectScene(imagePath); // build the description var description = cat > dog ? "Cat" : "Dog"; description += $" detected - cat confidence: {cat * 100:0}%"; description += $", dog confidence: {dog * 100:0}%"; // show the description Description.Text = description; // hide the spinner Spinner.Visibility = Visibility.Hidden; // tell the canvas to redraw itself MainCanvas.InvalidateVisual(); }
private void DrawBoundingBoxes() { foreach (var curve in curves) { MainCanvas.DrawBoundingBox(curve); } }
/// <summary> /// Run a complete face detection on a new image. /// </summary> private async Task RunFaceDetection() { // show the spinner Spinner.Visibility = Visibility.Visible; // clear any existing face rectangles var toDelete = new List <UIElement>(MainCanvas.Children.OfType <System.Windows.Shapes.Rectangle>()); foreach (var element in toDelete) { MainCanvas.Children.Remove(element); } // detect all faces in image faces = await DetectFaces(image); // draw face rectangles on the canvas foreach (var face in faces) { DrawFaceRectangle(face); } // hide the spinner Spinner.Visibility = Visibility.Hidden; // tell the canvas to redraw itself MainCanvas.InvalidateVisual(); }
/// <summary> /// PC窗体大小改变时,保证居中显示 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void Current_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e) { var height = ApplicationView.GetForCurrentView().VisibleBounds.Height; var width = ApplicationView.GetForCurrentView().VisibleBounds.Width; if (UWPPlatformTool.IsMobile) { border.Width = this.Width = width; border.Height = this.Height = height; } else { border.Width = width; border.Height = height; this.Height = height * 3 / 4; this.Width = this.Height * 3 / 4; } tab1.Width = tab2.Width = tab3.Width = tab4.Width = tab5.Width = this.Width / 5; SetCanvas(); MainCanvas.Invalidate(); await Task.Delay(10); SetCanvas(); MainCanvas.Invalidate(); }
private void Command_NewCanvas(object sender, ExecutedRoutedEventArgs e) { NewCanvasWindow cnw = new NewCanvasWindow(); cnw.ShowDialog(); if (cnw.WindowResult) { ClearCanvas(); MainVM.FileName = cnw.NewCanvasVM.FileName; MainVM.CanvasHeightMM = cnw.NewCanvasVM.Height; MainVM.CanvasWidthMM = cnw.NewCanvasVM.Width; MainVM.SelectedPrinter = cnw.NewCanvasVM.SelectedPrinter; MainVM.SelectedPaperSizes = cnw.NewCanvasVM.SelectedPaperSizes; MainVM.IdGrupa = cnw.NewCanvasVM.SelectedDbGroups.id_grupa; // FIX - wybranie papieru z listy var item = ComboboxPapers.Items.OfType <PaperSize>().FirstOrDefault(x => x.PaperName == cnw.NewCanvasVM.SelectedPaperSizes.PaperName); var index = ComboboxPapers.Items.IndexOf(item); ComboboxPapers.SelectedIndex = index; MainCanvas.UpdateLayout(); } }
private IEnumerator GetBundle() { WWW request = WWW.LoadFromCacheOrDownload(assetBundleLink, 0); while (!request.isDone) { ProgressSlider.value = request.progress; string persentateTemp = "" + request.progress * 100; string[] strArray = persentateTemp.Split(char.Parse(".")); PersentageText.text = strArray[0] + "%"; yield return(null); } if (request.error == null) { assetBundle = request.assetBundle; LoadingCanvas.SetActive(false); MainCanvas.SetActive(true); Debug.Log("Success!!!"); } else { Debug.Log("Error" + request.error); } yield return(null); }
private void Awake() { ButtonPrefab = Resources.Load <ButtonUI>("Button"); ProgressbarPrefab = Resources.Load <SliderUI>("Progressbar"); MainCanvas = FindObjectOfType <Canvas>(); MainPanel = MainCanvas.GetComponentInChildren <LayoutGroup>(); }
private void Awake() { if (main == null) { DontDestroyOnLoad(gameObject); main = this; } else if (main != this) { Destroy(gameObject); } GameObject.Find("PlayButton").TryGetComponent(out playButon); GameObject.Find("PauseButton").TryGetComponent(out pauseButton); GameObject.Find("ResumeButton").TryGetComponent(out resumeButton); GameObject.Find("OptionsButton").TryGetComponent(out optionsButton); GameObject.Find("QuitButton").TryGetComponent(out quitButton); GameObject.Find("ReturnButton").TryGetComponent(out returnButton); GameObject.Find("DieButton").TryGetComponent(out dieButton); GameObject.Find("PlayAgainButton").TryGetComponent(out retryButton); GameObject.Find("QuitToMainButton").TryGetComponent(out noRetryButton); GameObject.Find("ResumeSubButton").TryGetComponent(out resumeSubButton); GameObject.Find("QuitToMainSubButton").TryGetComponent(out quitToMainSubButton); mainMenuGroup = GameObject.Find("MainMenu"); pauseMenuGroup = GameObject.Find("PauseMenu"); gameplayGroup = GameObject.Find("Gameplay"); optionsGroup = GameObject.Find("OptionsMenu"); gameOverGroup = GameObject.Find("GameOver"); quitSubPanel = GameObject.Find("QuitSub"); }
void Awake() { mCanvas = Resources.Load <GameObject>("Prefab/Canvas"); mBrickInst = Resources.Load <GameObject>("Prefab/brick"); mCanvas = GameObject.Instantiate(mCanvas); Canvas canvas = mCanvas.GetComponent <Canvas>(); canvas.worldCamera = mainCamera; int col = 5; int raw = 5; MainCanvas mc = mCanvas.GetComponent <MainCanvas>(); mc.SetLayout(raw, col, 8, 8); GameObject brick = null; for (int i = 0; i < raw; ++i) { for (int j = 0; j < col; ++j) { brick = GameObject.Instantiate(mBrickInst); RectTransform rc = brick.GetComponent <RectTransform>(); mc.AddBrick(rc, i, j); } } }
private void DrawSkeletons() { foreach (var curve in curves) { MainCanvas.DrawSkeleton(curve); } }
private void DrawWeights() { foreach (var curve in curves) { MainCanvas.DrawWeights(curve); } }
public void createTourRafale(int level) //Cette fonction permet de créer une tour Rafale d'un niveau dépendant de s'il y a eu une fusion avant son exécution ou non. { cible_script = (MainCanvas)transform.parent.gameObject.GetComponent(typeof(MainCanvas)); GameObject nouvelleTour_rafale = Instantiate(tour_rafale[level - 1]) as GameObject; //On crée la tour Rafale contenue dans le tableau à la case level-1 (pour correspondre au tableau qui commence à 0) nouvelleTour_rafale.transform.position = new Vector3(cible_script.Place_click.transform.position.x, 2.5f, cible_script.Place_click.transform.position.z); //On place la tour aux coordonnées de la tuile cliquée Tour nouvelleTour = nouvelleTour_rafale.GetComponent <Tour>(); //On crée un gameobject dans lequel on met la tour que l'on a crée juste avant nouvelleTour.panelAmelio = UIamelio; nouvelleTour.type = "rafale"; //On attribue le type Rafale à la tour que l'on vient de créer nouvelleTour.level = level; //On attribue un niveau à la tour que l'on vient juste de créer à partir. Ce niveau dépend de s'il y a eu une fusion ou non place_script.creation_script.plateauTour[place_script.xRow, place_script.yCol] = nouvelleTour; //On accède au script de la tuile PUIS au script de la création du plateau (où sont les variables de positions des tuiles et des tours) PUIS à la position des tours pour attribuer les coordonnées de la nouvelle tour if (!(level >= 3)) //Si le niveau de la tour créée n'est pas supérieur ou égal au niveau maximum alors on vérifie si une fusion est possible { checkFusionSup(nouvelleTour, "rafale", level); //On vérifie si une fusion est possible à partir de la nouvelle tour avec des tours de son type et de son niveau } else if (level == 3) //Si la tour créée est de niveau maximum on vérifie si une fusion est possible avec d'autres tours différentes et de niveau maximum { checkFusionSupL(nouvelleTour, level); //On vérifie si une fusion est possible à partir de la nouvelle tour avec des tours de son type et de son niveau } nouvelleTour.place_tour = place_touch; this.gameObject.SetActive(false); }
/// <summary> /// Run a complete face detection on a new image. /// </summary> private async Task RunFaceDetection() { // show the spinner Spinner.Visibility = Visibility.Visible; // clear any existing face rectangles and labels var toDelete = new List <UIElement>(); foreach (var element in MainCanvas.Children.OfType <UIElement>()) { if (element is System.Windows.Shapes.Rectangle || element is Label) { toDelete.Add(element); } } foreach (var element in toDelete) { MainCanvas.Children.Remove(element); } // detect all faces in image celebrities = await DetectCelebrities(image); // draw face rectangles on the canvas foreach (var celebrity in celebrities) { DrawFaceRectangle(celebrity); } // hide the spinner Spinner.Visibility = Visibility.Hidden; // tell the canvas to redraw itself MainCanvas.InvalidateVisual(); }
private void canvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (!IsSelectable) { return; } MainCanvas.CaptureMouse(); //Capture mouse to receive events even if the pointer is outside the control //Start dragging: _draggingState.StartDragging(WpfCanvasScoreRenderer.ConvertPoint(e.GetPosition(MainCanvas))); //Check if element under cursor is staff element: FrameworkElement element = e.OriginalSource as FrameworkElement; if (element == null) { return; } if (!Renderer.OwnershipDictionary.ContainsKey(element)) { return; } //Set selected element: Select(Renderer.OwnershipDictionary[element]); }
/// <summary> /// Initializes this UI Frame. Initialization consists of initializing both the Panel and Window layers. /// Although literally all the cases I've had to this day were covered by the "Window and Panel" approach, /// I made it virtual in case you ever need additional layers or other special initialization. /// </summary> public virtual void Initialize() { if (panelLayer == null) { panelLayer = gameObject.GetComponentInChildren <PanelUILayer>(true); if (panelLayer == null) { Debug.LogError("[UI Frame] UI Frame lacks Panel Layer!"); } else { panelLayer.Initialize(); } } if (windowLayer == null) { windowLayer = gameObject.GetComponentInChildren <WindowUILayer>(true); if (panelLayer == null) { Debug.LogError("[UI Frame] UI Frame lacks Window Layer!"); } else { windowLayer.Initialize(); windowLayer.RequestScreenBlock += OnRequestScreenBlock; windowLayer.RequestScreenUnblock += OnRequestScreenUnblock; } } graphicRaycaster = MainCanvas.GetComponent <GraphicRaycaster>(); }
private void GraphMain_PaintSurface(object sender, SkiaSharp.Views.Desktop.SKPaintSurfaceEventArgs e) { MainSurface = e.Surface; MainCanvas = MainSurface.Canvas; if (refresh) { MainCanvas.Clear(SKColors.Transparent); refresh = false; } // draw eraser parameter1Array = parameter1List.ToArray(); MainCanvas.DrawPoints(PointMode1, parameter1Array, GraphPaint1); parameter2Array = parameter2List.ToArray(); MainCanvas.DrawPoints(PointMode1, parameter2Array, GraphPaint2); parameter3Array = parameter3List.ToArray(); MainCanvas.DrawPoints(PointMode1, parameter3Array, GraphPaint3); parameter4Array = parameter4List.ToArray(); MainCanvas.DrawPoints(PointMode1, parameter4Array, GraphPaint4); parameter5Array = parameter5List.ToArray(); MainCanvas.DrawPoints(PointMode1, parameter5Array, GraphPaint5); //MainCanvas.DrawRect(currentX + xStepSize, 0, 40, graphMain.CanvasSize.Height, ErasePaint); firstValueCounter++; }
private void MainCanvas_PointerPressed(object sender, PointerRoutedEventArgs e) { if (!IsSelectable) { return; } MainCanvas.CapturePointer(e.Pointer); //Capture mouse to receive events even if the pointer is outside the control //Start dragging: _draggingState.StartDragging(UWPCanvasScoreRenderer.ConvertPoint(e.GetCurrentPoint(MainCanvas).Position)); //Check if element under cursor is staff element: FrameworkElement element = e.OriginalSource as FrameworkElement; if (element == null) { return; } if (!Renderer.OwnershipDictionary.ContainsKey(element)) { return; } //Set selected element: Select(Renderer.OwnershipDictionary[element]); }
private void Shape11btn_Click(object sender, RoutedEventArgs e) { DrawingCanvas.SetValue(VisibilityProperty, System.Windows.Visibility.Visible); MainCanvas.SetValue(VisibilityProperty, System.Windows.Visibility.Hidden); DrawingCanvas.Children.Clear(); DrawingCanvas.Children.Add(ShapeCanvas(11)); }
void MainCanvas_MouseWheel(object sender, MouseWheelEventArgs e) { const double ScaleRate = 1.1; Point mouseAtMainCanvas = e.GetPosition(MainCanvas); Point mouseAtScrollViewer = e.GetPosition(MainScrollViewer); ScaleTransform st = MainCanvas.LayoutTransform as ScaleTransform; if (e.Delta > 0 && st.ScaleX < 64) { st.ScaleX = st.ScaleY = st.ScaleX * ScaleRate; } else if (st.ScaleX > 0.2) { st.ScaleX = st.ScaleY = st.ScaleX / ScaleRate; } MainScrollViewer.ScrollToHorizontalOffset(0); MainScrollViewer.ScrollToVerticalOffset(0); UpdateLayout(); Vector offset = MainCanvas.TranslatePoint(mouseAtMainCanvas, MainScrollViewer) - mouseAtScrollViewer; MainScrollViewer.ScrollToHorizontalOffset(offset.X); MainScrollViewer.ScrollToVerticalOffset(offset.Y); UpdateLayout(); e.Handled = true; }
// Use this for initialization void Start() { MainCanvas.s_instance = this; this.ChangePhase(Phase.Title); this.tapSE = GetComponent <AudioSource>(); }
private void DrawExtrema() { foreach (var curve in curves) { MainCanvas.DrawExtrema(curve); } }
private void DrawCurves() { foreach (var curve in curves) { MainCanvas.DrawCurve(curve, drawingOptions.Precision); } }
/** * ゲーム画面の呼び出し */ public void startCanvas(){ // TODO C#移植 エントリーポイントっぽいところ #if _UNITY_CONVERT_ #else canvas = new MainCanvas(); canvas.mainapp = this; Display.setCurrent(canvas); new Thread(canvas).start(); #endif #if __COM_TYPE__ #else // this.p = null; #endif }
public GUIObject(Action<GUIObject> readyCallback = null) { _readyCallback = readyCallback; _isReady = false; _mc = MainCanvas.Get(); _box = new GameObject("", typeof(RectTransform)); _box.name = typeof(GUIObject).ToString(); _box.transform.SetParent(_mc.canvas().transform, false); _triggerHandler = _box.AddComponent<GUITriggerHandler>(); EventTrigger eventTrigger = _box.AddComponent<EventTrigger>(); foreach (EventTriggerType type in Enum.GetValues(typeof(EventTriggerType))) { EventTrigger.Entry entry = new EventTrigger.Entry(); entry.eventID = type; entry.callback.AddListener(_triggerHandler.handler(type)); eventTrigger.triggers.Add(entry); } _children = new SortedDictionary<string, GUIObject>(Utilities.StringComparer.Get()); _name = ""; _id = Serialization.generateUUID(_box); Debug.Log("id: " + _id); GOCallback cb = _box.AddComponent<GOCallback>(); cb.startCallback = (go) => { _gameobjectInit(); GameObject.Destroy(go.GetComponent<GOCallback>()); }; }
// Use this for initialization void Awake() { main = this; root = new CanvasElement(transform); }