Exemplo n.º 1
0
    public void Update(CharacterProperty target)
    {
        if (mState == EffectState.INACTIVE)
        {
            mState     = EffectState.ACTIVE;
            mStartTime = Time.time;
            OnActive(target);
        }

        if (mState == EffectState.ACTIVE)
        {
            if ((Time.time - mStartTime) <= mDuration)
            {
                Execute(target);
            }
            else
            {
                mState = EffectState.TIMEOUT;
            }
        }

        if (mState == EffectState.TIMEOUT)
        {
            OnTimeout(target);
            mState = EffectState.FINISHED;
        }

        if (mState == EffectState.CANCELED)
        {
            OnCanceled(target);
            mState = EffectState.FINISHED;
        }
    }
Exemplo n.º 2
0
        public void StartEffect_PowerSkid(ParticleSystemRoss.EffectInfo info)
        {
            Particle.ParticleInfo pInfo = new Particle.ParticleInfo();
            pInfo.type          = ParticleType.kParticle_PowerSkid;
            pInfo.hasGravity    = false;
            pInfo.isAnimated    = true;
            pInfo.numAnimFrames = 5;
            pInfo.rotationStart = info.rotation;
            pInfo.velocity      = Utilities.CGPointMake(info.velocity.x, info.velocity.y);
            for (int i = 0; i < 5; i++)
            {
                pInfo.texture[i] = (ParticleSystemRoss.Instance()).GetTexture(ParticleTextureType.kParticleTexture_PowerSkidDustPuff1
                                                                              + i);
            }

            pInfo.timeBetweenAnimFrames[0] = 0.04f;
            pInfo.timeBetweenAnimFrames[1] = 0.04f;
            pInfo.timeBetweenAnimFrames[2] = 0.07f;
            pInfo.timeBetweenAnimFrames[3] = 0.09f;
            pInfo.timeBetweenAnimFrames[4] = 0.11f;
            pInfo.startPosition            = info.startPosition;
            pInfo.alphaStart = 0.5f;
            pInfo.scaleStart = 1;
            pInfo.scaleSpeed = 0.01f;
            Particle particle = (ParticleSystemRoss.Instance()).GetNextFreeParticleP1(ParticleList.t_BeforePlayer, "powerskid");

            if (particle != null)
            {
                particle.Launch_AnimatedParticle(pInfo);
            }

            state = EffectState.e_Inactive;
        }
Exemplo n.º 3
0
        public void Initialize(Action completedAction)
        {
            ms_Instance = this;

            m_InitializeCompletedAction = completedAction;

            m_EffectStates = new EffectState[(int)VFXConfig.VFXType.Count];
            for (int iEffect = 0; iEffect < m_EffectStates.Length; iEffect++)
            {
                EffectState iterEffectState = new EffectState();
                iterEffectState.InstantiateCount    = 0;
                iterEffectState.InstantiatePool     = new Stack <VFXEffectInstance>();
                iterEffectState.PopCompletedActions = new Queue <Action <VFXEffectInstance> >();
                m_EffectStates[iEffect]             = iterEffectState;
            }

            m_AssetHelper = new VFXAddressableEffectHelper();

            m_AssetHelper.Initialize();

            if (VFXConstants.PRELOAD_ALL_EFFECTS)
            {
                m_InitializingEffectCount = m_EffectStates.Length;
                for (int iEffect = 0; iEffect < m_EffectStates.Length; iEffect++)
                {
                    LoadEffectAsync((VFXConfig.VFXType)iEffect, OnInitializedEffect);
                }
            }
            else
            {
#pragma warning disable 0162
                m_InitializeCompletedAction?.Invoke();
#pragma warning restore 0162
            }
        }
Exemplo n.º 4
0
Arquivo: Emu.cs Projeto: pabru/YCPU
        protected override void Initialize()
        {
            Registry = new ServiceRegistry();

            Registry.Register(m_SpriteBatch = new SpriteBatchExtended(this));
            m_SpriteBatch.Initialize();

            Registry.Register(m_InputManager = new InputManager(Window.Handle));

            m_InputProvider   = new InputProvider(m_InputManager);
            m_DisplayProvider = new DisplayProvider(m_SpriteBatch);

            m_Emulator = new Emulator();
            m_Emulator.Initialize(m_DisplayProvider, m_InputProvider);
            m_Curses    = new Curses(GraphicsDevice, c_ConsoleWidth, c_ConsoleHeight, c_CursesFont, true);
            m_Effect    = new EffectState(m_SpriteBatch.LoadEffectContent("BasicEffect"), SamplerState.PointClamp);
            m_EffectCRT = new EffectState(m_SpriteBatch.LoadEffectContent("CRTEffect"), SamplerState.AnisotropicClamp);

            m_Graphics.PreferredBackBufferWidth  = c_WindowW * 2;
            m_Graphics.PreferredBackBufferHeight = c_WindowH;
            m_Graphics.IsFullScreen = false;
            m_Graphics.ApplyChanges();
            IsMouseVisible = true;

            base.Initialize();

            SystemFunctions.SetFocus(Window.Handle);
        }
 public void Update(GameTime gameTime)
 {
     if (_listMessage.Count == 0)
     {
         State = EffectState.READY;
         return;
     }
     if (State == EffectState.READY)
     {
         _showingEffect.Reset(_listMessage[0]);
         _currentTime = TimeSpan.Zero;
         State = EffectState.SHOWING;
     }
     else if (State == EffectState.SHOWED)
     {
         if (_currentTime > _timeDelay)
         {
             _hidingEffect.Reset(_listMessage[0]);
             State = EffectState.HIDING;
         } else
             _currentTime += gameTime.ElapsedGameTime;
     } else if (State == EffectState.HIDED)
     {
         _listMessage.RemoveAt(0);
         State = EffectState.READY;
     } else if (State == EffectState.SHOWING)
     {
         _showingEffect.Update(gameTime);
     } else if (State == EffectState.HIDING)
     {
         _hidingEffect.Update(gameTime);
     }
 }
 public MessageCenter(Game game)
 {
     _game = game;
     _state = EffectState.READY;
     _showingEffect = new ShowingEffect(this);
     _hidingEffect = new HidingEffect(this);
 }
Exemplo n.º 7
0
        public void StartEffect_DustCloudTrailWithoutPlayer(ParticleSystemRoss.EffectInfo inInfo)
        {
            Particle particle = (ParticleSystemRoss.Instance()).GetNextFreeParticleP1(ParticleList.t_BeforePlayer, "dust cloud trail wo pla");

            if (particle != null)
            {
                Particle.ParticleInfo info = new Particle.ParticleInfo();
                info.isAdditive    = false;
                info.type          = ParticleType.kParticle_Generic;
                info.texture[0]    = null;
                info.startPosition = inInfo.startPosition;
                info.velocity      = inInfo.velocity;
                info.rotationSpeed = 0.2f;
                info.alphaStart    = 0.75f;
                info.alphaSpeed    = 0.02f;
                info.scaleSpeed    = -0.05f;//Globals.g_world.GetRotationScaleForShorts(-1.0f);
                info.scaleStart    = 1.0f;
                particle.Launch_SingleParticle(info);
                particle.SetAtlasAndSubTextureId(Globals.g_world.GetAtlas(AtlasType.kAtlas_ParticlesScene), 0);
                particle.SetRotationScale(Globals.g_world.GetRotationScaleForShorts(45.1f));
                if (Globals.deviceIPad)
                {
                    float rotScale = (Globals.g_world.GetAtlas(AtlasType.kAtlas_ParticlesScene)).GetSubTextureRotationScale(particle.subTextureId);
                    particle.SetRotationScale(rotScale);
                }
                particle.SetIsAdditive(false);
            }

            state = EffectState.e_Inactive;
        }
    public void Stop()
    {
        if (effectState == EffectState.PLAYING)
        {
            effectState = EffectState.STOPPED;

            if (audioSource != null)
            {
                audioSource.Stop();
            }

            if (lightGlow != null && !loop)
            {
                lightGlow.Stop();
            }

            foreach (ParticleSystem particleSystem in particleSystems)
            {
                if (particleSystem != null)
                {
                    particleSystem.Stop();
                }
            }

            //cameraShake.Stop(); //TODO: implement Stop for camera shake
        }
    }
Exemplo n.º 9
0
    //------------------------------------------------------------
    // Effect Action

    void Fadein()
    {
        FilterUpdate(-ElapsedTime());
        if (_screenAlpha <= 0f)
        {
            state = EffectState.Update;
        }
    }
Exemplo n.º 10
0
 private void Idle()
 {
     if (Time.time - _timer >= timeWait)
     {
         curState          = EffectState.MoveTopLeft;
         _transform.parent = null;
     }
 }
Exemplo n.º 11
0
        public HoldEffectBinding(PlaybackContext playbackContext, ObjectReference attachedObject) : base(playbackContext)
        {
            AttachedObject = attachedObject;
            CreateEffect(playbackContext.Playback.Beatmap.GetEffectSettings(Hold.EffectType));

            // Apply object parameters to hold note effect
            EffectState.ApplyObjectParameters(attachedObject);
        }
 public MessageCenter(Game game)
     : base(game)
 {
     _game = game;
     _state = EffectState.READY;
     _showingEffect = new ShowingEffect(this);
     _hidingEffect = new HidingEffect(this);
     _messageFont = SCSServices.Instance.ResourceManager.GetResource<SpriteFont>("Fonts/StatusFont");
 }
Exemplo n.º 13
0
        private Point3DCollection DoSlide(EffectState direction, double progress)
        {
            double slideT = (direction == EffectState.SlideDown)
                                                ?
                            (progress - 0.5) * 2
                                                : 1.0 - (progress * 2);

            return(_bezierFiller.FillMesh(HorizontalPoints, VerticalPoints, slideT));
        }
Exemplo n.º 14
0
 /// <summary>
 /// 効果の除去
 /// </summary>
 /// <param name="_effect">効果の情報</param>
 public void RemoveState(EffectState _effect)
 {
     for (int i = 0; i < BuffEffects.Count; i++)
     {
         if (BuffEffects[i].EffectState == _effect)
         {
             RemoveState(i--);
         }
     }
 }
Exemplo n.º 15
0
    //------------------------------------------------------------
    // public method

    /// <summary> 自動シーケンスによるフェードアウト開始 </summary>
    public void FadeStart(UnityAction action, float time)
    {
        if (IsFadeTime())
        {
            return;
        }
        state           = EffectState.FadeOut;
        _fadeTime       = time;
        _sequenceAction = action;
    }
Exemplo n.º 16
0
    //------------------------------------------------------------
    // Behaviour

    protected override void Awake()
    {
        base.Awake();

        state        = EffectState.FadeIn;
        _screenAlpha = 1f;

        _sequence = new Dictionary <EffectState, Action>();
        _sequence.Add(EffectState.FadeIn, Fadein);
        _sequence.Add(EffectState.FadeOut, FadeOut);
    }
Exemplo n.º 17
0
 private void MoveTopLeft()
 {
     if (Vector3.Distance(EndPos, _transform.position) > 0.01f)
     {
         _transform.position = Vector3.Lerp(_transform.position, EndPos, Time.deltaTime * velocity);
     }
     else
     {
         curState = EffectState.End;
     }
 }
Exemplo n.º 18
0
 // occurs when the effect was run to completion
 private void _rootClockCompleted(object sender, EventArgs e) {
    State = EffectState.Completed;
    _finishEffect_stage1();
 }
Exemplo n.º 19
0
 // occurs when the effect was stopped before completion
 private void _rootClockStateChanged(object sender, EventArgs e) {
    if (_rootClock.CurrentState == ClockState.Stopped) {
       State = EffectState.Stopped;
       _finishEffect_stage1();
    }
 }
Exemplo n.º 20
0
        public void UpdateTime(int timeP)
        {
            if (EffectState == EffectState.Applied)
            {
                EffectState = EffectState.Updated;
                return;
            }

            if (EffectInfo.Duration == -1)   // One-Tact effect
            {
                EffectState = EffectState.Expired;
                return;
            }
            else if (pr_Duration < timeP)
            {
                EffectState = EffectState.Expired;
            }
            else
                pr_Duration -= timeP;
        }
Exemplo n.º 21
0
        private Point3DCollection DoSpread(EffectState direction, double progress)
        {
            double spreadT = (direction == EffectState.SpreadCompress)
                             	?
                             		progress*2
                             	: 1.0 - ((progress - 0.5)*2);

            // Set Left spread positions
            _bezierFiller.LeftPoint1 = EvaluateSpreadPosition(0, 0, LeftPoint1, spreadT);
            _bezierFiller.LeftPoint2 = EvaluateSpreadPosition(0, 0.333, LeftPoint2, spreadT);
            _bezierFiller.LeftPoint3 = EvaluateSpreadPosition(0, 0.667, LeftPoint3, spreadT);
            _bezierFiller.LeftPoint4 = EvaluateSpreadPosition(0, 1, LeftPoint4, spreadT);

            // Set Right spread positions
            _bezierFiller.RightPoint1 = EvaluateSpreadPosition(1, 0, RightPoint1, spreadT);
            _bezierFiller.RightPoint2 = EvaluateSpreadPosition(1, 0.333, RightPoint2, spreadT);
            _bezierFiller.RightPoint3 = EvaluateSpreadPosition(1, 0.667, RightPoint3, spreadT);
            _bezierFiller.RightPoint4 = EvaluateSpreadPosition(1, 1, RightPoint4, spreadT);

            // Configure mesh
            return _bezierFiller.FillMesh(HorizontalPoints, VerticalPoints, 0);
        }
Exemplo n.º 22
0
        private Point3DCollection DoSlide(EffectState direction, double progress)
        {
            double slideT = (direction == EffectState.SlideDown)
                                ?
                                    (progress - 0.5)*2
                                : 1.0 - (progress*2);

            return _bezierFiller.FillMesh(HorizontalPoints, VerticalPoints, slideT);
        }
Exemplo n.º 23
0
        /// <summary>
        /// Legt den Status des Effekts fest.
        /// </summary>
        /// <param name="state"></param>
        public void SetEffect(EffectState state)
        {
            Win32Api.DwmIsCompositionEnabled(ref aeroSupported);
            if (!aeroSupported)
            { throw new NotSupportedException("Aero not supported from this Windows version."); return; }

            switch (state)
            {
                case EffectState.Active:
                    this.BackColor = Color.Black;
                    glassEnabled = true;
                    break;
                case EffectState.Inactive:
                    this.BackColor = noAeroBackColor;
                    glassEnabled = false;
                    break;
            }
            this.Refresh();
        }
Exemplo n.º 24
0
 protected virtual void Awake()
 {
     rigidBody 					= GetComponent<Rigidbody>() as Rigidbody;
     navMeshAgent 				= GetComponent<NavMeshAgent> () as NavMeshAgent;
     willRendered 				= GetComponent<WillRendered> () as WillRendered;
     Skeleton 					= GetComponent<SkeletonRenderer> () as SkeletonRenderer;
     Render 						= GetComponent<Renderer> () as Renderer;
     EState 						= EffectState.DEFAULT;
     _gm							= GM.Create();
     _flip						= -1;
     isAttack					= false;
     isGrounded					= true;
     _maxHP 						= hp;//@todo
     if (!IsPlayer ())
     {
         navMeshAgent.updateRotation = updateRotation;
         navMeshAgent.enabled 		= false;
     }
 }
Exemplo n.º 25
0
 public Effect(EffectType effectType, EffectState effectState, float x1, float y1)
 {
     this.effectType = effectType;
     this.effectState = effectState;
     offset = new Vector2(x1, y1);
 }