Inheritance: MonoBehaviour
Esempio n. 1
0
        private async void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var pos = e.GetPosition(this);

            var ef = new RippleEffect();

            ef.Center    = new Point(pos.X / this.ActualWidth, pos.Y / this.ActualHeight);
            ef.Magnitude = 0.1;
            ef.Frequency = 20;
            this.Effect  = ef;

            DoubleAnimation da = new DoubleAnimation();

            da.To           = 0;
            da.Duration     = TimeSpan.FromMilliseconds(2000);
            da.FillBehavior = FillBehavior.HoldEnd;

            Storyboard sb = new Storyboard();

            Storyboard.SetTarget(da, this);
            Storyboard.SetTargetProperty(da, new PropertyPath("Effect.Frequency"));
            sb.Children.Add(da);
            sb.Begin();

            await Task.Delay(2000);

            ef.Magnitude = 0;
            ef.Frequency = 0;
        }
Esempio n. 2
0
        // Snow Prevention


        public SveklaPulsar()
        {
            InitializeComponent();
            frame = new Bitmap(SIZE, SIZE);

            t          = new Timer();
            t.Interval = (int)(1000 / FPS);
            t.Tick    += (Object o, EventArgs e) =>
            {
                UpdateFrame();
            };

            effect = new RippleEffect(SIZE, SIZE);

            this.MouseDown += (Object o, MouseEventArgs e) =>
            {
                Splash(e.Location.X, e.Location.Y, ClickSplashRadius);
                dragging = true;
            };
            this.MouseUp += (Object o, MouseEventArgs e) =>
            { dragging = false; };
            this.MouseMove += (Object o, MouseEventArgs e) =>
            {
                if (dragging)
                {
                    Point lc = Translate(e.Location);
                    Splash(e.Location.X, e.Location.Y, DragSplashRadius);
                }
            };

            ClickSplashRadius = 20;
            DragSplashRadius  = 10;
        }
Esempio n. 3
0
    // Start is called before the first frame update
    void Start()
    {
        playerGO = GameObject.Find(Constants.PLAYER_GO_ID);

        RE         = GetComponent <RippleEffect>();
        RE.enabled = false;
    }
Esempio n. 4
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        droplets    = new Droplet[3];
        droplets[0] = new Droplet();
        droplets[1] = new Droplet();
        droplets[2] = new Droplet();

        gradTexture            = new Texture2D(2048, 1, TextureFormat.Alpha8, false);
        gradTexture.wrapMode   = TextureWrapMode.Clamp;
        gradTexture.filterMode = FilterMode.Bilinear;
        for (var i = 0; i < gradTexture.width; i++)
        {
            var x = 1.0f / gradTexture.width * i;
            var a = waveform.Evaluate(x);
            gradTexture.SetPixel(i, 0, new Color(a, a, a, a));
        }
        gradTexture.Apply();

        material           = new Material(shader);
        material.hideFlags = HideFlags.DontSave;
        material.SetTexture("_GradTex", gradTexture);

        UpdateShaderParameters();
    }
Esempio n. 5
0
 // Start is called before the first frame update
 void Start()
 {
     camera1       = Camera.main;
     rippleEffect  = FindObjectOfType <RippleEffect>();
     betterJumping = GetComponent <BetterJumping>();
     Debug.Log("Movement Start");
 }
        // Snow Prevention
        public SveklaPulsar()
        {
            InitializeComponent();
            frame = new Bitmap(SIZE, SIZE);

            t = new Timer();
            t.Interval = (int)(1000 / FPS);
            t.Tick += (Object o, EventArgs e) =>
                {
                    UpdateFrame();
                };

            effect = new RippleEffect(SIZE, SIZE);

            this.MouseDown += (Object o, MouseEventArgs e) =>
            {
                Splash(e.Location.X, e.Location.Y, ClickSplashRadius);
                dragging = true;
            };
            this.MouseUp += (Object o, MouseEventArgs e) =>
            { dragging = false; };
            this.MouseMove += (Object o, MouseEventArgs e) =>
            {
                if (dragging)
                {
                    Point lc = Translate(e.Location);
                    Splash(e.Location.X, e.Location.Y, DragSplashRadius);
                }
            };

            ClickSplashRadius = 20;
            DragSplashRadius = 10;
        }
        public RipplePictureBox()
        {
            effect   = new RippleEffect();
            dragging = false;

            timer          = new Timer();
            timer.Interval = (int)(1000 / FPS);
            timer.Tick    += (@s, a) => UpdateFrame();

            MouseDown += (@s, a) =>
            {
                Splash(a.Location.X, a.Location.Y, ClickSplashRadius);
                dragging = true;
            };
            MouseUp   += (@s, a) => { dragging = false; };
            MouseMove += (@s, a) =>
            {
                if (dragging)
                {
                    Splash(a.Location.X, a.Location.Y, DragSplashRadius);
                }
            };

            ClickSplashRadius = 10;
            DragSplashRadius  = 5;

            timer.Start();
            timer.Enabled = true;
        }
Esempio n. 8
0
        private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            // var ef = new SwirlEffect();
            // ef.Center = new Point(0.5, 0.5);
            // ef.TwistAmount = 50;
            // this.Effect = ef;

            var ef = new RippleEffect();

            ef.Center    = new Point(0.5, 0.5);
            ef.Magnitude = 0.1;
            ef.Frequency = 100;
            this.Effect  = ef;

            DoubleAnimation da = new DoubleAnimation();

            da.To           = 0;
            da.Duration     = TimeSpan.FromMilliseconds(3000);
            da.FillBehavior = FillBehavior.HoldEnd;

            Storyboard sb = new Storyboard();

            Storyboard.SetTarget(da, this);
            Storyboard.SetTargetProperty(da, new PropertyPath("Effect.Frequency"));
            sb.Children.Add(da);
            sb.Begin();

            await Task.Delay(3000);

            ef.Magnitude = 0;
            ef.Frequency = 0;
            this.Effect  = null;
        }
Esempio n. 9
0
        public Button()
        {
            _backgroundRect = RectangleF.Zero;

            _rippleEffect = new RippleEffect();

            TextColor    = XColor.White;
            CornerRadius = 2;
        }
Esempio n. 10
0
    protected virtual void Awake()
    {
        tapButton = GetComponent <Button>();
        tapButton.onClick.RemoveAllListeners();
        tapButton.onClick.AddListener(OnButtonTap);

        ripplesExplosion = Camera.main.GetComponent <RippleEffect>();

        GameManager.GameEventBus.On <GameOverEvent>(OnGameOverEvent);
    }
 private void AddEffect()
 {
     me.SceneMgr.BeginInvoke(new Action(() =>
     {
         effect           = new RippleEffect();
         effect.Amplitude = 0.1;
         effect.Frequency = 180;
         effect.Phase     = 0;
         meHeavy.HeavyWeightGeometry.Effect = effect;
     }));
 }
Esempio n. 12
0
    public void PerformRippleEffect(Vector3 wpos)
    {
        GameObject camera = GameObject.FindGameObjectWithTag("MainCamera");

        if (camera)
        {
            Vector3      spos = camera.GetComponent <Camera>().WorldToViewportPoint(wpos);
            RippleEffect fx   = camera.GetComponent <RippleEffect>();
            fx.Emit(spos.x, 1 - spos.y);
        }
    }
    private void Start()
    {
        cam          = Camera.main;
        coll         = GetComponent <CollisionDetector>();
        rb           = GetComponent <Rigidbody2D>();
        sr           = GetComponent <SpriteRenderer>();
        animator     = GetComponent <Animator>();
        player       = GetComponent <PlayerStats>().GetPlayer();
        rippleObject = FindObjectOfType <RippleEffect>();

        controller = GetComponent <CharacterController2D>();
        controller.setPlayerStats(player);
    }
Esempio n. 14
0
 private void Awake()
 {
     gameManager           = FindObjectOfType <GameManager>();
     soundManager          = FindObjectOfType <SoundManager>();
     handsAnimator         = GetComponentInChildren <Animator>();
     rigidBody             = GetComponent <Rigidbody>();
     cameraParticleSystem  = GetComponentInChildren <ParticleSystem>();
     levelStats            = FindObjectOfType <LevelStats>();
     playerCapsuleCollider = GetComponent <CapsuleCollider>();
     previousPositions     = new List <PositionRecord>();
     rippleCameraEffect    = cameraTransform.GetComponent <RippleEffect>();
     input = new PlayerInput();
 }
        public Stepper()
        {
            _minusRect = RectangleF.Zero;
            _plusRect  = RectangleF.Zero;

            _minusRippleEffect = new RippleEffect
            {
                RippleColor = ColorHelper.GetGraphicsColor(XColor.LightGray, XColor.DarkGray)
            };

            _plusRippleEffect = new RippleEffect
            {
                RippleColor = ColorHelper.GetGraphicsColor(XColor.LightGray, XColor.DarkGray)
            };
        }
    private void Awake()
    {
        oldSpeed = enemySpeed;
        animator = GetComponent <Animator>();
        if (rope_system == null)
        {
            rope_system = GameObject.Find("Rope_System").GetComponent <Rope_System>();
        }
        blink = GetComponent <Blinking_Effect>();
        ropeSystemGetChild = rope_system.gameObject;
        cameraTransform    = Camera.main.GetComponent <Transform>();
        players            = Camera.main.GetComponent <GameManager>().players_Movement;
        moneyDrop          = GetComponent <moneyDrop>();

        shockwave = Camera.main.GetComponent <RippleEffect>();
    }
Esempio n. 17
0
    private void Awake()
    {
        players = Camera.main.GetComponent <GameManager>().players_Movement;

        foreach (GameObject Obj in GameObject.FindGameObjectsWithTag("player"))
        {
            allPlayers.Add(Obj);
        }
        cameraTransform = Camera.main.GetComponent <Transform>();
        //We find the Rope System, the target will be the center of the chain
        if (rope_system == null)
        {
            rope_system = GameObject.Find("Rope_System").GetComponent <Rope_System>();
        }
        sprite = GetComponentInParent <SpriteRenderer>();

        shockwave = Camera.main.GetComponent <RippleEffect>();
    }
Esempio n. 18
0
        protected override IEnumerable <bool> E_Draw()
        {
            RippleEffect.Add_波紋(this.X, this.Y, 60);
            RippleEffect.Add_波紋(this.X, this.Y, 120);
            RippleEffect.Add_波紋(this.X, this.Y, 180);
            RippleEffect.Add_波紋(this.X, this.Y, 360);

            for (int frame = 0; frame < GameConsts.PLAYER_BOMB_FRAME_MAX + 60; frame++)
            {
                this.Crash = DDCrashUtils.Rect(D4Rect.LTRB(
                                                   0,
                                                   0,
                                                   GameConsts.FIELD_W,
                                                   GameConsts.FIELD_H
                                                   ));

                yield return(true);
            }
        }
Esempio n. 19
0
 private void Start()
 {
     _mainCamera         = GetComponentInChildren <Camera>();
     _cameraConfiner     = GetComponentInChildren <CinemachineConfiner>();
     _cinemachine        = GetComponentInChildren <CinemachineVirtualCamera>();
     _cameraRippleEffect = GetComponentInChildren <RippleEffect>();
     _impulse            = GetComponentInChildren <CinemachineImpulseSource>();
     foreach (var script in _cinemachine.GetComponentPipeline())
     {
         if (script is CinemachineFramingTransposer)
         {
             _body = script as CinemachineFramingTransposer;
             break;
         }
     }
     if (_body == null)
     {
         Debug.LogError("Body Con't Find!!!");
     }
 }
Esempio n. 20
0
 protected override void LoadContent()
 {
     // Create a new SpriteBatch, which can be used to draw textures.
     SpriteBatch  = new SpriteBatch(GraphicsDevice);
     GameSettings = new GameSettings(this);
     Textures.LoadContent(Content);
     ParticleEngine    = new ParticleEngine();
     ParticleModifiers = new List <IEmitterModifier>();
     Ripple            = new RippleEffect(GraphicsDevice);
     Bloom             = new BloomEffect(GraphicsDevice);
     ParticleTarget    = new RenderTarget2D(
         GraphicsDevice,
         GraphicsDevice.PresentationParameters.BackBufferWidth,
         GraphicsDevice.PresentationParameters.BackBufferHeight,
         false,
         GraphicsDevice.PresentationParameters.BackBufferFormat,
         DepthFormat.Depth24);
     MainMenuState = new MainMenu(this);
     CurrentState  = MainMenuState;
     Pixel         = new Texture2D(GraphicsDevice, 1, 1, false, SurfaceFormat.Color);
     Pixel.SetData(new[] { Color.White });
 }
    private void Start()
    {
        rippleEffect = Camera.main.GetComponent <RippleEffect>();
        GameObject gameManager = GameObject.Find("GameManager");

        scoreManager = gameManager.GetComponent <ScoreManager>();
        soundManager = gameManager.GetComponent <SoundManager>();
        switch (enemyColor)
        {
        case color.orange:
            yellowAura.gameObject.SetActive(true);
            break;

        case color.blue:
            blueAura.gameObject.SetActive(true);
            break;

        case color.pink:
            pinkAura.gameObject.SetActive(true);
            break;
        }
    }
Esempio n. 22
0
    // ---

    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(this);
        }

        camera = GetComponent <Camera>();

        // --- generate wave/gradient(?) texture

        gradTexture = new Texture2D(2048, 1, TextureFormat.Alpha8, false)
        {
            wrapMode   = TextureWrapMode.Clamp,
            filterMode = FilterMode.Bilinear
        };

        for (var i = 0; i < gradTexture.width; i++)
        {
            var x = 1.0f / gradTexture.width * i;
            var a = waveform.Evaluate(x);
            gradTexture.SetPixel(i, 0, new Color(a, a, a, a));
        }

        gradTexture.Apply();

        // --- create material

        material = new Material(shader)
        {
            hideFlags = HideFlags.DontSave
        };
        material.SetTexture("_GradTex", gradTexture);
    }
Esempio n. 23
0
 private void Awake()
 {
     shockwave = Camera.main.GetComponent <RippleEffect>();
 }
Esempio n. 24
0
    //Esta debe tener el script de ripple como componente

    // Start is called before the first frame update
    void Start()
    {
        camera       = cameraObject.GetComponent <Camera>();
        rippleEffect = camera.GetComponent <RippleEffect>();
    }
Esempio n. 25
0
 private void Awake()
 {
     ripple                 = GetComponent <RippleEffect>();
     ripple.spawnPos        = pos;
     ripple.reflectionColor = tint;
 }
Esempio n. 26
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            graphics.GraphicsProfile = GraphicsProfile.HiDef;

            graphics.PreferredBackBufferWidth  = 1920;
            graphics.PreferredBackBufferHeight = 1080;

            IsMouseVisible = true;

            kbm = new KeyboardStateManager(this);

            camera          = new Base3DCamera(this, .5f, 20000);
            camera.Position = new Vector3(0, 0, 0);
            Components.Add(camera);
            Services.AddService(typeof(Base3DCamera), camera);

            skyBox = new BaseSkyBox(this, "Textures/SkyBox/NebulaBlue");
            Components.Add(skyBox);

            bunny               = new Base3DObject(this, "Models/bunny", "Shaders/RenderObjectNotTangentsOrTexCoords");
            bunny.Position      = new Vector3(2, -1.5f, -20);
            bunny.LightPosition = LightPosition;
            Components.Add(bunny);

            cube               = new Base3DObject(this, "Models/cube");
            cube.Position      = new Vector3(0, 0, -10);
            cube.ColorAsset    = "Textures/h2mcpCube";
            cube.BumpAsset     = "Textures/h2mcpCubeNormal";
            cube.LightPosition = LightPosition;
            Components.Add(cube);

            bunnies = new Base3DObject[10];
            for (int s = 0; s < 10; s++)
            {
                bunnies[s]               = new Base3DObject(this, "Models/Bunny");
                bunnies[s].Position      = new Vector3(20 + (s * 12), -1.5f, -10 - (s * 12));
                bunnies[s].ColorAsset    = "Textures/WindmillTopColor";
                bunnies[s].BumpAsset     = "Textures/WindmillTopNormal";
                bunnies[s].LightPosition = LightPosition;
                Components.Add(bunnies[s]);
            }

            landShark          = new Base3DObject(this, "Models/landShark");
            landShark.Position = new Vector3(-20, 0, -10);

            landShark.ColorAsset    = "Textures/Speeder_diff";
            landShark.BumpAsset     = "Textures/Speeder_bump";
            landShark.LightPosition = LightPosition;
            Components.Add(landShark);

            earth               = new Base3DObject(this, "Models/sphere");
            earth.Position      = new Vector3(0, 0, -200);
            earth.ColorAsset    = "Textures/Earth_Diffuse";
            earth.BumpAsset     = "Textures/Earth_NormalMap";
            earth.LightPosition = LightPosition;
            Components.Add(earth);

            ppManager = new PostProcessingManager(this);

            fog         = new FogEffect(this, 50, 100, Color.DarkSlateGray);
            fog.Enabled = false;
            ppManager.AddEffect(fog);

            GodRays         = new CrepuscularRays(this, LightPosition, "Textures/flare", 1500, .99f, .99f, .5f, .12f, .25f);
            GodRays.Enabled = false;
            ppManager.AddEffect(GodRays);

            sun         = new SunEffect(this, LightPosition);
            sun.Enabled = false;
            ppManager.AddEffect(sun);

            bloom         = new BloomEffect(this, 1.25f, 1f, 1f, 1f, .25f, 4f);
            bloom.Enabled = false;
            ppManager.AddEffect(bloom);

            dof         = new DepthOfFieldEffect(this, 5, 30);
            dof.Enabled = false;
            ppManager.AddEffect(dof);

            haze         = new HeatHazeEffect(this, "Textures/bumpmap", false);
            haze.Enabled = false;
            ppManager.AddEffect(haze);

            radialBlur         = new RadialBlurEffect(this, 0.009f);
            radialBlur.Enabled = false;
            ppManager.AddEffect(radialBlur);

            ripple         = new RippleEffect(this);
            ripple.Enabled = false;
            ppManager.AddEffect(ripple);

            sepia         = new SepiaEffect(this);
            sepia.Enabled = false;
            ppManager.AddEffect(sepia);

            greyScale         = new GreyScaleEffect(this);
            greyScale.Enabled = false;
            ppManager.AddEffect(greyScale);

            invert         = new InvertColorEffect(this);
            invert.Enabled = false;
            ppManager.AddEffect(invert);

            colorFilter         = new ColorFilterEffect(this, Color.White, .5f, .5f, .5f);
            colorFilter.Enabled = false;
            ppManager.AddEffect(colorFilter);

            bleach         = new BleachEffect(this, 1);
            bleach.Enabled = false;
            ppManager.AddEffect(bleach);

            scanLines         = new ScanLinesEffect(this, .001f, .001f, 128);
            scanLines.Enabled = false;
            ppManager.AddEffect(scanLines);

            deRezed         = new DeRezedEffect(this, 128);
            deRezed.Enabled = false;
            ppManager.AddEffect(deRezed);
        }
Esempio n. 27
0
 public void StartRippleEffect()
 {
     RE         = GetComponent <RippleEffect>();
     RE.enabled = true;
 }
Esempio n. 28
0
 public RippleEffect RippleEffect()
 {
     if (rippleEffect == null)
         rippleEffect = new RippleEffect();
     return rippleEffect;
 }
Esempio n. 29
0
        private void Main4()
        {
            // *.INIT
            {
                // アプリ固有 >

                RippleEffect.INIT();
                画面分割.INIT();
                画面分割_Effect.INIT();

                // < アプリ固有
            }

            #region Charge To DDTouch

            // memo:
            // ロードされれば DDPictureUtils.Pictures 等に追加されるので、ここで呼ぶだけで良い。
            //TitleMenu.TouchWallDrawerResources();
            // <-- AddAllPicture(); する場合だけの話
            // AddAllPicture(); しない場合を想定して形を合わせる為に DDTouch.Add(TitleMenu.TouchWallDrawerResources); するべき

            // DDCCResource 等のための Touch
            DDTouch.Add(TitleMenu.TouchWallDrawerResources);

            // 個別に設定
            //DDTouch.Add(Ground.I.Picture.XXX);
            //DDTouch.Add(Ground.I.Music.XXX);
            //DDTouch.Add(Ground.I.SE.XXX);

            // 全部設定
            DDTouch.AddAllPicture();
            DDTouch.AddAllMusic();
            DDTouch.AddAllSE();

            #endregion

            //DDTouch.Touch(); // moved -> Logo

            if (DDConfig.LOG_ENABLED)
            {
                DDEngine.DispDebug = () =>
                {
                    DDPrint.SetPrint();
                    DDPrint.SetBorder(new I3Color(0, 0, 0));

                    DDPrint.Print(string.Join(" ",
                                              DDEngine.FrameProcessingMillis,
                                              DDEngine.FrameProcessingMillis_Worst

                                              // デバッグ表示する情報をここへ追加..
                                              ));

                    DDPrint.Reset();
                };
            }

            if (ProcMain.ArgsReader.ArgIs("//D"))             // 引数は適当な文字列
            {
                Main4_Debug();
            }
            else
            {
                Main4_Release();
            }
        }
Esempio n. 30
0
        public BaseDeferredRenderGame() : base()
        {
            graphics = new GraphicsDeviceManager(this);

            graphics.PreparingDeviceSettings += new EventHandler <PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);
            Content.RootDirectory             = "Content";

            inputHandler = new InputHandlerService(this);

            assetManager = new AssetManager(this);

            renderer = new DeferredRender(this);

            rnd = new Random(DateTime.Now.Millisecond);

            //ggr = new GeographicGridRegistrationSystem(this, new Vector3(10, 5, 20), new BoundingBox(-Vector3.One * 2f, Vector3.One * 2f));

            ppManager = new PostProcessingManager(this);

            test         = new TesterEffect(this);
            test.Enabled = false;
            ppManager.AddEffect(test);

            SSAO         = new SSAOEffect(this, .1f, 1f, .5f, 1f);
            SSAO.Enabled = false;
            ppManager.AddEffect(SSAO);

            //stHPe = new STHardPointEffect(this, 25, 30, new Color(48, 89, 122));
            stHPe         = new STHardPointEffect(this, 25, 30, new Color(41, 77, 107), new Color(.125f, .125f, .125f, 1.0f));
            stHPe.Enabled = false;
            ppManager.AddEffect(stHPe);

            sun         = new SunEffect(this, SunPosition);
            sun.Enabled = false;
            ppManager.AddEffect(sun);

            water             = new WaterEffect(this);
            water.waterHeight = -25f;
            water.Enabled     = false;
            ppManager.AddEffect(water);

            dof         = new DepthOfFieldEffect(this, 5, 30);
            dof.Enabled = false;
            ppManager.AddEffect(dof);

            bloom         = new BloomEffect(this, 1.25f, 1f, 1f, 1f, .25f, 4f);
            bloom.Enabled = false;
            ppManager.AddEffect(bloom);

            haze         = new HeatHazeEffect(this, "Textures/bumpmap", false);
            haze.Enabled = false;
            ppManager.AddEffect(haze);

            radialBlur         = new RadialBlurEffect(this, 0.009f);
            radialBlur.Enabled = false;
            ppManager.AddEffect(radialBlur);

            ripple         = new RippleEffect(this);
            ripple.Enabled = false;
            ppManager.AddEffect(ripple);

            fog         = new FogEffect(this, 50, 100, Color.DarkSlateGray);
            fog.Enabled = false;
            ppManager.AddEffect(fog);

            godRays = new CrepuscularRays(this, SunPosition, "Textures/flare", 1500, 1f, .99f, 1f, .15f, .25f);
            //godRays = new CrepuscularRays(this, SunPosition, "Textures/flare", 1500, 1f, .99f, .1f, 0.12f, .25f);
            godRays.Enabled = false;
            ppManager.AddEffect(godRays);
        }
Esempio n. 31
0
 public RippleEffect RippleEffect(RippleEffect rippleEffect)
 {
     this.rippleEffect = rippleEffect;
     return rippleEffect;
 }