Ejemplo n.º 1
0
 public override void OnSetEffect(CameraEffectManager _manager)
 {
     base.OnSetEffect(_manager);
     m_Buffer.GetTemporaryRT(ID_TempTexture, -2, -2, 0, FilterMode.Bilinear);
     m_Buffer.Blit(BuiltinRenderTextureType.CurrentActive, ID_TempTexture);
     m_Buffer.SetGlobalTexture(ID_GlobalOpaqueTexture, ID_TempTexture);
 }
Ejemplo n.º 2
0
    public override void OnSetEffect(CameraEffectManager _manager)
    {
        base.OnSetEffect(_manager);
        m_Blur = new PE_Blurs();
        m_Blur.OnSetEffect(_manager);
        m_RenderShader = Shader.Find("Hidden/PostEffect/PE_BloomSpecific_Render");
        if (m_RenderShader == null)
        {
            Debug.LogError("Null Shader Found!");
        }
        GameObject temp = new GameObject("Render Camera");

        temp.transform.SetParentResetTransform(m_Manager.m_Camera.transform);
        m_RenderCamera                  = temp.AddComponent <Camera>();
        m_RenderCamera.clearFlags       = CameraClearFlags.SolidColor;
        m_RenderCamera.backgroundColor  = Color.black;
        m_RenderCamera.orthographic     = m_Manager.m_Camera.orthographic;
        m_RenderCamera.orthographicSize = m_Manager.m_Camera.orthographicSize;
        m_RenderCamera.nearClipPlane    = m_Manager.m_Camera.nearClipPlane;
        m_RenderCamera.farClipPlane     = m_Manager.m_Camera.farClipPlane;
        m_RenderCamera.fieldOfView      = m_Manager.m_Camera.fieldOfView;
        m_RenderCamera.enabled          = false;
        m_RenderTexture                 = RenderTexture.GetTemporary(m_Manager.m_Camera.scaledPixelWidth, m_Manager.m_Camera.scaledPixelHeight, 1);
        m_RenderCamera.targetTexture    = m_RenderTexture;
    }
Ejemplo n.º 3
0
 public override void OnSetEffect(CameraEffectManager _manager)
 {
     base.OnSetEffect(_manager);
     m_Buffer      = new CommandBuffer();
     m_Buffer.name = this.GetType().ToString();
     m_Manager.m_Camera.AddCommandBuffer(m_BufferEvent, m_Buffer);
 }
Ejemplo n.º 4
0
 protected override void Awake()
 {
     base.Awake();
     m_Camera         = Camera.main;
     tf_MainCamera    = m_Camera.transform;
     tf_CameraYawBase = new GameObject("CameraTrans").transform;
     tf_CameraYawBase.SetParentResetTransform(transform);
     tf_CameraOffset = new GameObject("CameraPos").transform;
     tf_CameraOffset.SetParentResetTransform(tf_CameraYawBase);
     m_Effect = m_Camera.GetComponent <CameraEffectManager>();
 }
Ejemplo n.º 5
0
    void FindGameObjects()
    {
        GameObject player = GameObject.FindGameObjectWithTag("Player");

        playerController   = player.GetComponent <PlayerController>();
        playerEnergySystem = player.GetComponent <PlayerEnergySystem>();

        mainCamera        = Camera.main;
        mainEffectManager = mainCamera.GetComponent <CameraEffectManager>();

        asteroidPool = GameObject.FindGameObjectWithTag("Asteroid Pool").GetComponent <ObjectPooler>();
    }
Ejemplo n.º 6
0
    public override void InitEffect(CameraEffectManager _manager)
    {
        base.InitEffect(_manager);
        m_ColorBuffer      = RenderTexture.GetTemporary(m_Manager.m_Camera.pixelWidth, m_Manager.m_Camera.pixelHeight, 0, RenderTextureFormat.RGB111110Float);
        m_ColorBuffer.name = "Main Color Buffer";
        m_DepthBuffer      = RenderTexture.GetTemporary(m_Manager.m_Camera.pixelWidth, m_Manager.m_Camera.pixelHeight, 24, RenderTextureFormat.Depth);
        m_DepthBuffer.name = "Main Depth Buffer";
        m_Manager.m_Camera.SetTargetBuffers(m_ColorBuffer.colorBuffer, m_DepthBuffer.depthBuffer);

        m_DepthTextureBuffer = new CommandBuffer()
        {
            name = "Depth Texture Copy"
        };
        m_OpaqueTextureBuffer = new CommandBuffer()
        {
            name = "Opaque Texture Copy"
        };
        m_Manager.m_Camera.AddCommandBuffer(CameraEvent.AfterForwardOpaque, m_DepthTextureBuffer);
        m_Manager.m_Camera.AddCommandBuffer(CameraEvent.AfterForwardOpaque, m_OpaqueTextureBuffer);
    }
Ejemplo n.º 7
0
        /// <summary>
        ///     主角状态改变时触发该方法
        /// </summary>
        protected override void DoStatuChange()
        {
            base.DoStatuChange();

            switch (CurrentStatu)
            {
            case Status.DEATH:
                _footSmokeActive = false;
                _footSmokeEffect.SetActive(false);
                MapMode.Instance.RoleDeath(MeVo.instance.Id);
                break;

            case Status.RUN:
                _footSmokeEffect.transform.position = MeControler.transform.position;
                _footSmokeEffect.transform.rotation = MeControler.transform.rotation;
                _footSmokeEffect.SetActive(true);

                if (!_footSmokeActive)
                {
                    EffectMgr.Instance.ResetParticleSystem(_footSmokeEffect);
                    _footSmokeActive = true;
                }

                if (MapControl.CanPlayHeroArriveStory)
                {
                    PlayHeroArriveStory();
                }

                break;

            case Status.Win:
                CameraEffectManager.ScaleOutCamera(0.05f, MyCamera.MainCameraSize * 0.7f);
                break;

            default:
                _footSmokeActive = false;
                _footSmokeEffect.SetActive(false);
                break;
            }
        }
Ejemplo n.º 8
0
        protected override void DoStatuTransfered()
        {
            base.DoStatuTransfered();
            if (PreStatuNameHash == Status.NAME_HASH_DEATH)
            {
                if (AppMap.Instance.mapParser.MapId == MapTypeConst.WORLD_BOSS) //世界Boss
                {
                    Singleton <BossTips> .Instance.OpenYDView(BossMode.Instance.BossName, 20, Singleton <RoleMode> .Instance.ReLife);
                }
                else if (AppMap.Instance.mapParser.MapId != MapTypeConst.ARENA_MAP &&
                         AppMap.Instance.mapParser.MapId != MapTypeConst.GoldHit_MAP &&
                         AppMap.Instance.mapParser.MapId != MapTypeConst.GoldSilverIsland_MAP)    //普通副本地图时
                {
                    if (SpeechMgr.Instance.IsAssassinSpeech)
                    {
                        SpeechMgr.Instance.PlaySpeech(SpeechConst.AssassinDead);
                    }

                    Singleton <CopyControl> .Instance.OpenCopyFailView((int)CopyFailReason.DEATH);
                }
                else if (AppMap.Instance.mapParser.MapId == MapTypeConst.GoldHit_MAP)
                {
                    Singleton <GoldHitMainView> .Instance.OpenFailPannel();
                }
            }
            else if (PreStatuNameHash == Status.NAME_HASH_STANDUP)
            {
                //显示复活无敌特效
            }
            else if (PreStatuNameHash == Status.NAME_HASH_RUN)
            {
                AutoRoundEffect.SetActive(false);
            }
            else if (PreStatuNameHash == Status.NAME_HASH_Win)
            {
                CameraEffectManager.ScaleInCamera(0.05f, MyCamera.MainCameraSize);
            }

            _autoMoveTime = 0;
        }
 public virtual void InitEffect(CameraEffectManager _manager)
 {
     m_Manager = _manager;
     m_Enabled = true;
 }
Ejemplo n.º 10
0
 void Awake()
 {
     Camera.main.depthTextureMode = DepthTextureMode.None;
     m_Effect      = Camera.main.GetComponent <CameraEffectManager>();
     m_AreaScaning = false;
 }
Ejemplo n.º 11
0
 public override void OnSetEffect(CameraEffectManager _manager)
 {
     base.OnSetEffect(_manager);
     m_GaussianBlur = new PE_Blurs();
     m_GaussianBlur.OnSetEffect(_manager);
 }
Ejemplo n.º 12
0
 public virtual void OnSetEffect(CameraEffectManager _manager)
 {
     m_Manager = _manager;
 }
Ejemplo n.º 13
0
 public override void Run()
 {
     CameraEffectManager.TweenShakeCamera(0f, duration);
     vp_Timer.In(duration, Finish, 1, 0);
 }
Ejemplo n.º 14
0
 public override void OnSetEffect(CameraEffectManager _manager)
 {
     base.OnSetEffect(_manager);
     SetEffect();
 }
Ejemplo n.º 15
0
        /// <summary>
        ///     攻击伤害检测
        /// </summary>
        public bool CheckDamage(Vector3 effectPosition, int index)
        {
            SysSkillBaseVo skillVo = CurrentSkillVo;

            print(skillVo.unikey);
            if (!MeController.Me.IsUsing)
            {
                return(false);
            }
            bool result = false;

            switch (MeController.Me.Type)
            {
            case DisplayType.PET:
                result = DamageCheck.Instance.CheckPetInjured2D(MeController, skillVo, effectPosition,
                                                                _selfTransform.position,
                                                                MeController.Me.CurFaceDire, GetEnemyDisplay(), _currentActionVo.IsBullet, _checkedTime, index,
                                                                AppMap.Instance.mapParser.NeedSyn);
                break;

            case DisplayType.ROLE:
                //主角攻击的伤害检测
                bool needSyn = AppMap.Instance.mapParser.NeedSyn;
                if (MeController.GetMeVo().Id == AppMap.Instance.me.GetVo().Id)
                {
                    result = DamageCheck.Instance.CheckMeInjured2D(MeController, skillVo, effectPosition,
                                                                   _selfTransform.position,
                                                                   MeController.Me.CurFaceDire, GetEnemyDisplay(), _currentActionVo.IsBullet, _checkedTime,
                                                                   index, needSyn);
                    if (result)
                    {
                        CameraEffectManager.NormalAttackShake();
                        if (MeVo.instance.CurMp < MeVo.instance.Mp)
                        {
                            MeVo.instance.CurMp += 1;
                        }
                        PlayBeAttackedSound(skillVo.unikey);     //播放受击音效
                    }
                }
                else
                {
                    //其他玩家攻击的伤害检测
                    var playerVo = MeController.GetMeVoByType <PlayerVo>();
                    result = DamageCheck.Instance.CheckPlayerInjured2D(MeController, skillVo, playerVo, effectPosition,
                                                                       _selfTransform.position,
                                                                       MeController.Me.CurFaceDire, GetEnemyDisplay(), _currentActionVo.IsBullet, _checkedTime, index, needSyn);
                    if (!needSyn && result)
                    {
                        if (playerVo.CurMp < playerVo.Mp)
                        {
                            playerVo.CurMp += 1;
                        }
                    }
                }
                break;

            case DisplayType.MONSTER:     //怪物攻击的碰撞检测
                result = DamageCheck.Instance.MonsterCheckInjured2D(MeController, skillVo, effectPosition, _selfTransform.position,
                                                                    MeController.Me.CurFaceDire, (MeController.Me.GetVo() as MonsterVo), index);
                if (MeController.Me.DefenceEffect != null)
                {
                    MeController.Me.DefenceEffect.transform.position = Vector3.one * 1000;
                }
                break;

            case DisplayType.Trap:
                DamageCheck.Instance.TrapCheckInjured2D(skillVo, effectPosition,
                                                        MeController.Me.CurFaceDire, (MeController.GetMeByType <TrapDisplay>().BoxCollider2D));
                break;
            }
            if (skillVo.shake && MeController.GetMeVo().Id == MeVo.instance.Id)
            {
                CameraEffectManager.ShakeCamera(0, 0.6f); //增加技能震屏效果
            }
            if (result)
            {
                _checkedTime++;
            }
            return(result);
        }
Ejemplo n.º 16
0
 void Awake()
 {
     m_Effect = Camera.main.GetComponent <CameraEffectManager>();
 }
Ejemplo n.º 17
0
 public override void OnSetEffect(CameraEffectManager _manager)
 {
     base.OnSetEffect(_manager);
     mt_CurVP = m_Manager.m_Camera.projectionMatrix * m_Manager.m_Camera.worldToCameraMatrix;
 }