Ejemplo n.º 1
0
        //private Texture2D stampTexture;
        //private Vector2 swipeAngle = Vector2.zero;
        //private Vector3 localUp = Vector3.up;
        //private Vector3 localLeft = Vector3.left;
        private void Start()
        {
            OriginalSlider = PaintSlider.sprite;
            OriginalSliderBar = PaintSliderBar.sprite;

            MainCamera = GameObject.FindObjectOfType<Camera>();

            Renderer rend = MainCamera.GetComponentInChildren<Renderer>();
            ModelTransform = rend.transform;
            ModelTexture = new Texture2D(GlobalSettings.TextureSize, GlobalSettings.TextureSize);
            Color[] colors = ModelTexture.GetPixels();

            for (int i = 0; i < colors.Length; ++i)
            {
                colors[i] = Color.white;
            }
            ModelTexture.SetPixels(colors);
            ModelTexture.Apply();
            rend.material.mainTexture = ModelTexture;

            Palette = GameObject.FindObjectOfType<ColorPalette>();

            //PaintImage = PaintButton.targetGraphic as Image;
            //OriginalPaintSprite = PaintImage.sprite;

            //RotateImage = RotateButton.targetGraphic as Image;
            //OriginalRotate = RotateImage.sprite;

            //OffsetPoints = new List<Vector3>();
            //OffsetPoints.Add(new Vector3(1, 0, 0));
            //OffsetPoints.Add(new Vector3(-1, 0, 0));
            //OffsetPoints.Add(new Vector3(0, 1, 0));
            //OffsetPoints.Add(new Vector3(0, -1, 0));

            PaintSliderControl.minValue = 1;
            PaintSliderControl.maxValue = IngameSettings.MaxBrushCount;
            PaintSliderControl.value = (IngameSettings.MaxBrushCount / 2);

            EraserSliderControl.minValue = 1;
            EraserSliderControl.maxValue = IngameSettings.MaxBrushCount;
            EraserSliderControl.value = (IngameSettings.MaxBrushCount / 2);

            ToggleEraser(false);
            TogglePaint(true);
        }
 private void Start()
 {
     palette = GameObject.FindObjectOfType<ColorPalette>();
     ads = GameObject.FindObjectOfType<FullScreenAds>();
     dialog = GameObject.FindObjectOfType<DialogBox>();
 }