public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        ParticleScaler scaler = (ParticleScaler)target;

        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("-- 파티클 스케일 변경 툴 --");
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("ScalingMode가 Hierarchy로 되어있어야 Scale 변경이 원활하게 됩니다.");
        EditorGUILayout.LabelField("처음 한번만 실행하면 됩니다.");

        if (GUILayout.Button("Hierarchy로 변경"))
        {
            scaler.ParticleScalingModeChange();
        }

        EditorGUILayout.Space();
        EditorGUILayout.Space();

        scaler.scaleFactor = EditorGUILayout.FloatField("파티클 크기", scaler.scaleFactor);

        if (GUILayout.Button("파티클 스케일 변경"))
        {
            scaler.ParticleScaleChange();
        }
    }
Exemplo n.º 2
0
 static public int ScaleByTransform_s(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             UnityEngine.ParticleSystem a1;
             checkType(l, 1, out a1);
             System.Single a2;
             checkType(l, 2, out a2);
             ParticleScaler.ScaleByTransform(a1, a2);
             return(0);
         }
         else if (argc == 3)
         {
             UnityEngine.GameObject a1;
             checkType(l, 1, out a1);
             System.Single a2;
             checkType(l, 2, out a2);
             System.Boolean a3;
             checkType(l, 3, out a3);
             ParticleScaler.ScaleByTransform(a1, a2, a3);
             return(0);
         }
         return(error(l, "No matched override function to call"));
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 public void PlayAnimationTrigger(CharacterParams param)
 {
     this.StopAnimation();
     base.gameObject.SetActive(true);
     if (this._target == CharacterTarget.CharacterCenter)
     {
         this._PlayAnimation = base.PlayAnimation(param.characterCenterTarget, param.RootToCenterDistance());
     }
     else if (this._target == CharacterTarget.CharacterFaceCenter)
     {
         this._PlayAnimation = base.PlayAnimation(param.characterFaceCenterTarget, param.RootToCenterDistance());
     }
     else if (this._target == CharacterTarget.CharacterRoot)
     {
         this._PlayAnimation = base.PlayAnimation(param.transform, param.RootToCenterDistance());
     }
     else
     {
         this._PlayAnimation = base.PlayAnimation(null, param.RootToCenterDistance());
     }
     this.CharacterFollowingInitializeInternal(param);
     this.cachedCharacter = param;
     base.StartCoroutine(this._PlayAnimation);
     this._scale = this.cachedCharacter.effectScale;
     base.transform.localScale  = Vector3.one;
     base.transform.localScale *= this._scale;
     foreach (ParticleSystem particles in this._particleSystems)
     {
         ParticleScaler.Scale(particles, this._scale, true, null);
     }
 }
Exemplo n.º 4
0
 private void Light()
 {
     if (this._fuel < Time.time)
     {
         GameStats.LitWeapon.Invoke();
         LocalPlayer.Inventory.DefaultLight.StashLighter();
         Transform transform = (!this._weaponFireSpawn) ? base.transform : this._weaponFireSpawn.transform;
         this._weaponFire = (GameObject)UnityEngine.Object.Instantiate(this._weaponFirePrefab, transform.position, transform.rotation);
         this._weaponFire.transform.parent = transform;
         if (!this._weaponFire.activeSelf)
         {
             this._weaponFire.gameObject.SetActive(true);
         }
         this._fireParticleScale = this._weaponFire.GetComponentInChildren <ParticleScaler>();
         this._firelight         = this._weaponFire.GetComponentInChildren <Light>();
         this._fireAudioEmitter  = this._weaponFire.GetComponent <FMOD_StudioEventEmitter>();
         base.GetComponent <Renderer>().sharedMaterial = this._burningMat;
         this._fuel      = this._burnDuration;
         this._startTime = Time.time;
         this._state     = BurnableItem.States.Burning;
         this._attacking = false;
         LocalPlayer.Inventory.IsWeaponBurning = true;
         FMODCommon.PlayOneshot("event:/fire/fire_built_start", transform);
     }
 }
Exemplo n.º 5
0
 private void Light()
 {
     if (this._fuel < Time.time)
     {
         GameStats.LitWeapon.Invoke();
         LocalPlayer.Inventory.DefaultLight.StashLighter();
         InventoryItemView component = this._inventoryMirror.transform.parent.GetComponent <InventoryItemView>();
         Transform         transform = (!this._weaponFireSpawn) ? base.transform : this._weaponFireSpawn.transform;
         this._weaponFire = (GameObject)UnityEngine.Object.Instantiate(this._weaponFirePrefab, transform.position, transform.rotation);
         this._weaponFire.transform.parent = transform;
         if (!this._weaponFire.activeSelf)
         {
             this._weaponFire.gameObject.SetActive(true);
         }
         this._fireParticleScale = this._weaponFire.GetComponentInChildren <ParticleScaler>();
         this._firelight         = this._weaponFire.GetComponentInChildren <Light>();
         this._fireAudioEmitter  = this._weaponFire.GetComponent <FMOD_StudioEventEmitter>();
         base.GetComponent <Renderer>().sharedMaterial = this._burningMat;
         this._fuel = ((this._state != BurnableCloth.States.PutOutLighting) ? this._burnDuration : this._putOutFuel);
         if (component.ActiveBonus == WeaponStatUpgrade.Types.BurningWeaponExtra)
         {
             this._extraBurn = true;
             this._fuel     *= 3f;
         }
         else
         {
             this._extraBurn = false;
         }
         this._state = BurnableCloth.States.Burning;
         this._player.IsWeaponBurning = true;
         this._attacking       = false;
         component.ActiveBonus = (WeaponStatUpgrade.Types)(-1);
         FMODCommon.PlayOneshot("event:/fire/fire_built_start", transform);
     }
 }
Exemplo n.º 6
0
 private void Start()
 {
     this.ParticleScaler = this.FlamesScale.GetComponent <ParticleScaler>();
     this.Fuel           = 120f;
     if (!this.Lit)
     {
         base.enabled = false;
     }
 }
Exemplo n.º 7
0
 static public int Clear_s(IntPtr l)
 {
     try {
         ParticleScaler.Clear();
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 8
0
    public static void SetScale(GameObject go, float scale)
    {
        ParticleScaler par = go.GetComponent <ParticleScaler>();

        if (par == null)
        {
            par = go.AddComponent <ParticleScaler>();
        }
        par.SetScaleEffect(scale);
        //par.particleScale = scale;
    }
Exemplo n.º 9
0
    public override void OnInspectorGUI()
    {
        ParticleScaler scaleBeingInspected = target as ParticleScaler;

        base.OnInspectorGUI();

        if (GUILayout.Button("Update Scale"))
        {
            scaleBeingInspected.UpdateScale();
        }
    }
Exemplo n.º 10
0
 private void Burnt()
 {
     if (this._weaponFire)
     {
         UnityEngine.Object.Destroy(this._weaponFire);
         this._weaponFire = null;
     }
     base.GetComponent <Renderer>().sharedMaterial = this._clothDisolveMat;
     this._clothDisolveMat.SetFloat("_BurnAmount", 1f);
     this._fireParticleScale = null;
     this._firelight         = null;
     this._fuel  = this._dissolveDuration;
     this._state = BurnableCloth.States.Dissolving;
 }
Exemplo n.º 11
0
    public void levelUpEffect()
    {
        GameObject o = Instantiate(levelUpPrefab);

        o.transform.position = this.transform.position;
        ParticleScaler s = o.GetComponent <ParticleScaler>();

        s.objectAttachedTo = this.gameObject;
        if (s.levelUpUI != null)
        {
            Text t = s.levelUpUI.transform.Find("Panel").Find("LevelText").GetComponent <Text>();
            t.text = "Level " + this.stats.level;
        }
    }
Exemplo n.º 12
0
    public void questCompletedEffect(Quest q)
    {
        GameObject o = (GameObject)Instantiate(Resources.Load("SpecialEffects/QuestTurnedIn"));

        o.transform.position = this.player.transform.position;
        ParticleScaler s = o.GetComponent <ParticleScaler>();

        s.objectAttachedTo = this.player.gameObject;

        if (s.levelUpUI != null)
        {
            Text t = s.levelUpUI.transform.Find("Panel").Find("QuestName").GetComponent <Text>();
            t.text = "Quest Completed " + q.getName();
        }
    }
Exemplo n.º 13
0
        private void InitializeParticleScaler(GameObject gameObject, float scale)
        {
            ParticleScaler particleScaler = gameObject.GetComponent <ParticleScaler>();

            if (particleScaler == null)
            {
                particleScaler = gameObject.AddComponent <ParticleScaler>();
            }
            if (particleScaler.particleScale != scale)
            {
                particleScaler.particleScale       = scale;
                particleScaler.alsoScaleGameobject = false;
                particleScaler.CheckAndApplyScale();
            }
        }
Exemplo n.º 14
0
 public static void Scale(ParticleSystem particles, float scale, bool includeChildren = true, ParticleScalerOptions options = null)
 {
     ParticleScaler.ScaleSystem(particles, scale, false, options);
     if (includeChildren)
     {
         ParticleSystem[] componentsInChildren = particles.GetComponentsInChildren <ParticleSystem>();
         int num = componentsInChildren.Length;
         while (num-- > 0)
         {
             if (!(componentsInChildren[num] == particles))
             {
                 ParticleScaler.ScaleSystem(componentsInChildren[num], scale, true, options);
             }
         }
     }
 }
Exemplo n.º 15
0
 static public int ScaleSystem_s(IntPtr l)
 {
     try {
         UnityEngine.GameObject a1;
         checkType(l, 1, out a1);
         System.Single a2;
         checkType(l, 2, out a2);
         System.Boolean a3;
         checkType(l, 3, out a3);
         ParticleScalerOptions a4;
         checkType(l, 4, out a4);
         ParticleScaler.ScaleSystem(a1, a2, a3, a4);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 16
0
 void Present_SubWindow()
 {
     EditorGUILayout.BeginVertical(VerticalStyle);
     if (BuildLocalConfig.Ins.Fold_Present_SubWindow = EditorGUILayout.Foldout(BuildLocalConfig.Ins.Fold_Present_SubWindow, "窗口", true))
     {
         if (GUILayout.Button("ScriptTemplateSettings"))
         {
             Utile.XenoTemplateSettingsWindow.ShowWindow();
         }
         else if (GUILayout.Button("AssetImportOption"))
         {
             ShowWindow <AssetImportOptionsWindow>();
         }
         else if (GUILayout.Button("ParticleScaler"))
         {
             ParticleScaler.ShowWindow();
         }
         else if (GUILayout.Button("Pivot"))
         {
             Utile.Window.OpenWindow();
         }
         else if (GUILayout.Button("Feedback"))
         {
             Utile.ConfigWindow.Init();
         }
         else if (GUILayout.Button("Shelf"))
         {
             Utile.ShelfEditor.OpenShelf(0);
         }
         else if (GUILayout.Button("Prefs"))
         {
             Utile.PrefsWindow.Init();
         }
         else if (GUILayout.Button("PackingTag"))
         {
             GetWindow <UIPackingTagWindow>("PackingTag").Show();
         }
         else if (GUILayout.Button("Define"))
         {
             EditorWindow.GetWindow <CustomDefineManager>("Custom Define Manager", true, typeof(SceneView));
         }
     }
     EditorGUILayout.EndVertical();
 }
    protected virtual void StopAnimationInternal()
    {
        if (this._effectAnimation != null && this._effectAnimation.isPlaying)
        {
            this._effectAnimation.Stop();
            this._effectAnimation[this._effectAnimation.clip.name].time = this._effectAnimation[this._effectAnimation.clip.name].length;
        }
        foreach (ParticleController particleController in this._particleControllers)
        {
            particleController.ClearParticle();
        }
        this._isPlaying = false;
        float scale = 1f / this._scale;

        base.transform.localScale = Vector3.one;
        foreach (ParticleSystem particles in this._particleSystems)
        {
            ParticleScaler.Scale(particles, scale, true, null);
        }
    }
 public static void Scale(this ParticleSystem particles, float scale, bool includeChildren = true)
 {
     ParticleScaler.Scale(particles, scale, includeChildren, null);
 }
 public static void ScaleByTransform(this ParticleSystem particles, float scale, bool includeChildren = true)
 {
     ParticleScaler.ScaleByTransform(particles, scale, includeChildren);
 }
 private IEnumerator PlaySkillAnimationInternal(CharacterParams attacker)
 {
     if (attacker != null)
     {
         if (this._cameraMotionId.Length > 0)
         {
             this.SetPosition(attacker.transform, null);
         }
         else
         {
             this.SetPosition(attacker.transform, new Vector3?(attacker.dropItemOffsetPosition));
         }
     }
     this.StopAnimationInternal();
     this._isPlaying        = true;
     this.currentStageColor = Color.black;
     if (this._renderCamera != null)
     {
         this.currentStageColor = this._renderCamera.backgroundColor;
         if (this._hideStage)
         {
             if (this._lightColorChanger != null)
             {
                 this._lightColorChanger.isEnable    = false;
                 this.currentSunLightColor           = this._lightColorChanger.light.color;
                 this._lightColorChanger.light.color = this._hideStageLightColor;
                 this.currentSunLightRotation        = this._lightColorChanger.light.transform.rotation;
                 this._lightColorChanger.light.transform.rotation = Quaternion.Euler(this._hideStageLightEulerAngles);
             }
             if (this._stageObject != null)
             {
                 this._stageObject.SetActive(false);
             }
             this._renderCamera.backgroundColor = this._hideStageBackgroundColor;
         }
     }
     this._effectAnimation.clip.wrapMode = WrapMode.Once;
     this._effectAnimation[this._effectAnimation.clip.name].time = 0f;
     this._effectAnimation.PlayQueued(this._effectAnimation.clip.name, QueueMode.PlayNow);
     if (attacker != null && attacker.GetFindAttackMotion(this._motionIndex))
     {
         attacker.PlayAnimation(CharacterAnimationType.attacks, this._attackAnimationType, this._motionIndex, null, null);
         this.CharacterFollowingInitializeInternal(attacker);
         this.BillboardObjectInitializeInternal(attacker.transform, attacker.RootToCenterDistance());
         this.ParticheControllerInitializeInternal();
     }
     if (this._cameraMotionId.Length == 0)
     {
         this._scale = attacker.effectScale;
         base.transform.localScale  = Vector3.one;
         base.transform.localScale *= this._scale;
         foreach (ParticleSystem particles in this._particleSystems)
         {
             ParticleScaler.Scale(particles, this._scale, true, null);
         }
     }
     if (this._attackAnimationType == SkillType.InheritanceTechnique)
     {
         float motionTime = (!(attacker != null)) ? 0f : attacker.AnimationClipLength;
         float effectTime = this._effectAnimation[this._effectAnimation.clip.name].length;
         float time       = Mathf.Max(motionTime, effectTime);
         while (time > 0f)
         {
             time -= Time.deltaTime;
             if (!this._effectAnimation.isPlaying && this._effectAnimation.gameObject.activeInHierarchy)
             {
                 this._effectAnimation.gameObject.SetActive(false);
             }
             yield return(null);
         }
         this._effectAnimation.gameObject.SetActive(true);
     }
     else
     {
         while (this._effectAnimation.isPlaying)
         {
             yield return(null);
         }
     }
     yield break;
 }
Exemplo n.º 21
0
	private void Awake()
	{
		this.Ps = base.gameObject.GetComponent<ParticleScaler>();
	}
Exemplo n.º 22
0
        void Start()
        {
            CancelInvoke("Start");

            if (m_skillBase == null || m_skillBase.m_actor == null)
            {
                return;
            }

            //m_skillBase = this.transform.root.gameObject.GetComponent<SkillBase>();
            m_actor = m_skillBase.m_actor;


            if (m_actionCellDesc.delayTime > 0)
            {
                Invoke("DoAction", m_actionCellDesc.delayTime);
            }
            else
            {
                DoAction();
            }

            //这个肯定会用预警
            if (0 != m_actionCellDesc.efxWarning.Length)
            {
                //if (m_WarningefxObj != null)
                //{
                //    Destroy(m_WarningefxObj);
                //    m_WarningefxObj = null;
                //}
                if (m_WarningefxObj == null)
                {
                    m_WarningefxObj = Instantiate(
                        CoreEntry.gResLoader.LoadResource(m_actionCellDesc.efxWarning)) as GameObject;
                }
                if (m_WarningefxObj == null)
                {
                    return;
                }
                m_WarningefxObj.SetActive(true);

                //m_efxObj.transform.position = m_skillBase.m_actor.m_transform.position;
                Vector3 pos = m_skillBase.m_actor.transform.position;
                if (m_actionCellDesc.shouldAttachToOwner == false)
                {
                    pos = m_skillBase.transform.position;
                }
                pos    = CoreEntry.gBaseTool.GetGroundPoint(pos);
                pos.y += 0.3f;


                ParticleScaler ScaleComponet = m_WarningefxObj.GetComponent <ParticleScaler>();
                if (ScaleComponet == null)
                {
                    ScaleComponet = m_WarningefxObj.AddComponent <ParticleScaler>();
                }
                // ScaleComponet.particleScale = m_actor.actorCreatureDisplayDesc.sacle ;


                float fbig = 0.10f;   //贴花比实际伤害范围大百分之fbig
                if (DamageTypeID.DTID_FUN == m_actionCellDesc.type)
                {
                    //m_WarningefxObj.transform.localScale = new Vector3(1.0f, 0f, 1.0f) * m_oneDamageInfo.damageNode.funDamage.radius * 2 * (1 + fbig);
                    // ScaleComponet.prevScale = m_oneDamageInfo.damageNode.funDamage.radius * 2 * (1 + fbig);
                    ScaleComponet.particleScale = m_actionCellDesc.damageNode.funDamage.radius * (1 + fbig); //m_oneDamageInfo.damageNode.funDamage.radius * 2 * (1 + fbig);
                                                                                                             //圆形按半径算。所以乘以2
                    if (m_actionCellDesc.damageNode.funDamage.angle == 360)
                    {
                        ScaleComponet.particleScale *= 2.0f;
                    }
                    if (m_actionCellDesc.damageNode.funDamage.angle <= 360)
                    {
                        m_WarningefxObj.transform.position = new Vector3(pos.x, pos.y + 0.1f, pos.z);

                        m_WarningefxObj.transform.forward = m_skillBase.m_actor.transform.forward;
                    }

                    if (m_actionCellDesc.damageNode.rectDamage.offDistance != 0)
                    {
                        m_WarningefxObj.transform.localPosition += m_skillBase.m_actor.transform.forward * m_actionCellDesc.damageNode.rectDamage.offDistance;
                    }

                    //if (m_actionCellDesc.damageNode.rectDamage.offDistanceX != 0)
                    //{
                    //    m_WarningefxObj.transform.localPosition += m_skillBase.m_actor.transform.right * m_actionCellDesc.damageNode.rectDamage.offDistanceX;

                    //}
                }
                else if (DamageTypeID.DTID_RECT == m_actionCellDesc.type)
                {
                    m_WarningefxObj.transform.localScale = new Vector3((1 + fbig) * m_actionCellDesc.damageNode.rectDamage.width, 0f, (1 + fbig) * m_actionCellDesc.damageNode.rectDamage.length);  //new Vector3(1.0f, 0f, 1.0f) * m_actionCellDesc.damageNode.rectDamage.length;  // m_oneDamageInfo.damageNode.funDamage.radius * 2 * (1 + fbig);

                    m_WarningefxObj.transform.forward = m_skillBase.m_actor.transform.forward;

                    m_WarningefxObj.transform.position = pos;

                    if (m_actionCellDesc.damageNode.rectDamage.offDistance != 0)
                    {
                        m_WarningefxObj.transform.localPosition += m_skillBase.m_actor.transform.forward * m_actionCellDesc.damageNode.rectDamage.offDistance;
                    }

                    //if (m_actionCellDesc.damageNode.rectDamage.offDistanceX != 0)
                    //{
                    //    m_WarningefxObj.transform.localPosition += m_skillBase.m_actor.transform.right * m_actionCellDesc.damageNode.rectDamage.offDistanceX;

                    //}
                    //m_WarningefxObj.transform.localPosition -= new Vector3(0, 0,  m_oneDamageInfo.damageNode.rectDamage.length * 0.5f);
                    //m_WarningefxObj.transform.position += m_oneDamageInfo.damageNode.rectDamage.length / 2 * m_skillBase.m_actor.transform.forward;
                }


                //  Invoke("HideDecal", m_actionCellDesc.);
            }
        }
Exemplo n.º 23
0
        public override void ShowSkillScope()
        {
            //伤害计算
            Vector3 pos = m_skillBase.m_actor.transform.position;

            if (null == m_skillBase.m_actor.m_WarningefxObj)
            {
                if (m_skillBase.m_actor.m_WarningefxObj != null)
                {
                    Destroy(m_skillBase.m_actor.m_WarningefxObj);
                    m_skillBase.m_actor.m_WarningefxObj = null;
                }
                float fbig = 0.20f; //贴花比实际伤害范围大百分之fbig
                if (DamageTypeID.DTID_FUN == m_oneDamageInfo.type || !m_bIsAoe)
                {
                    if (m_oneDamageInfo.damageNode.funDamage.angle == 360 || !m_bIsAoe)
                    {
                        m_skillBase.m_actor.m_WarningefxObj = Instantiate(
                            CoreEntry.gResLoader.LoadResource("Effect/skill/remain/fx_yujing_yuanlan")) as GameObject;
                    }
                    else
                    {
                        m_skillBase.m_actor.m_WarningefxObj = Instantiate(
                            CoreEntry.gResLoader.LoadResource("Effect/skill/remain/fx_yujing_shanxinglan")) as GameObject;
                    }

                    if (m_skillBase.m_actor.m_WarningefxObj == null)
                    {
                        return;
                    }

                    ParticleScaler ScaleComponet = m_skillBase.m_actor.m_WarningefxObj.GetComponent <ParticleScaler>();
                    if (ScaleComponet == null)
                    {
                        ScaleComponet = m_skillBase.m_actor.m_WarningefxObj.AddComponent <ParticleScaler>();
                    }

                    if (m_oneDamageInfo.damageNode.funDamage.angle == 360 || !m_bIsAoe)
                    {
                        ScaleComponet.particleScale = m_oneDamageInfo.damageNode.funDamage.radius * 2 * (1 + fbig);
                        m_skillBase.m_actor.m_WarningefxObj.transform.position = new Vector3(pos.x, pos.y + 0.35f, pos.z);
                        m_skillBase.m_actor.m_WarningefxObj.transform.forward  = m_skillBase.m_actor.transform.forward;
                    }
                    else
                    {
                        ScaleComponet.particleScale = m_oneDamageInfo.damageNode.funDamage.radius * (0.83f + fbig);
                        m_skillBase.m_actor.m_WarningefxObj.transform.position = new Vector3(pos.x, pos.y - (0.35f * (ScaleComponet.particleScale / 6f)), pos.z);
                        m_skillBase.m_actor.m_WarningefxObj.transform.forward  = m_skillBase.m_actor.transform.forward;
                    }
                }
                else if (DamageTypeID.DTID_RECT == m_oneDamageInfo.type)
                {
                    m_skillBase.m_actor.m_WarningefxObj = Instantiate(
                        CoreEntry.gResLoader.LoadResource("Effect/skill/remain/fx_yujing_changfanglan")) as GameObject;
                    if (m_skillBase.m_actor.m_WarningefxObj == null)
                    {
                        return;
                    }
                    m_skillBase.m_actor.m_WarningefxObj.transform.localScale = new Vector3(m_oneDamageInfo.damageNode.rectDamage.width * 2f, 0f, m_oneDamageInfo.damageNode.rectDamage.length * 1f);
                    m_skillBase.m_actor.m_WarningefxObj.transform.forward    = m_skillBase.m_actor.transform.forward;
                    m_skillBase.m_actor.m_WarningefxObj.transform.position   = new Vector3(pos.x, pos.y + 0.35f, pos.z);

                    if (m_oneDamageInfo.damageNode.rectDamage.offDistance != 0)
                    {
                        m_skillBase.m_actor.m_WarningefxObj.transform.localPosition += m_skillBase.m_actor.m_WarningefxObj.transform.forward * (m_oneDamageInfo.damageNode.rectDamage.offDistance);
                    }

                    //if (m_oneDamageInfo.damageNode.rectDamage.offDistanceX != 0)
                    //{
                    //    m_skillBase.m_actor.m_WarningefxObj.transform.localPosition += m_skillBase.m_actor.m_WarningefxObj.transform.right * (m_oneDamageInfo.damageNode.rectDamage.offDistanceX);

                    //}
                    //m_skillBase.m_actor.m_WarningefxObj.transform.localPosition -= new Vector3(0, 0,  m_oneDamageInfo.damageNode.rectDamage.length * 0.5f);
                    //m_skillBase.m_actor.m_WarningefxObj.transform.position += m_oneDamageInfo.damageNode.rectDamage.length / 2 * m_skillBase.m_actor.transform.forward;
                }
            }
        }
Exemplo n.º 24
0
        void PrepareDownTime()
        {
            CancelInvoke("PrepareDownTime");
            CoreEntry.gEventMgr.TriggerEvent(GameEvent.GE_BOSS_RISE_TO_SKY_STATED, null);
            //位移恢复
            m_skillBase.m_actor.transform.position -= new Vector3(0, 5, 0);

            if (m_aimActorObject != null)
            {
                m_skillBase.m_actor.transform.position = m_aimActorObject.thisGameObject.transform.position;
            }

            //影子恢复
            m_skillBase.m_actor.ShowBlobShadow();

            //脚底特效
            if (!string.IsNullOrEmpty(m_bossDeathFromSkyDesc.efxPrefab) && m_aimActorObject != null)
            {
                Object oj = CoreEntry.gResLoader.LoadResource(m_bossDeathFromSkyDesc.efxPrefab);
                if (oj != null)
                {
                    GameObject efxObj = Instantiate(oj) as GameObject;
                    SceneEfx   efx    = efxObj.AddComponent <SceneEfx>();
                    efx.Init(m_aimActorObject.thisGameObject.transform.position, 5);
                }
            }

            //预警贴花
            if (!string.IsNullOrEmpty(m_bossDeathFromSkyDesc.efxPrefab) && m_aimActorObject != null)
            {
                if (m_WarningDecel)
                {
                    Vector3 pos = m_skillBase.m_actor.transform.position;
                    m_WarningDecel.SetPositionOnGround(pos);
                    m_WarningDecel.ShowDecal();
                }
                else
                {
                    float      fbig       = 0.20f; //贴花比实际伤害范围大百分之fbig
                    DamageCell damageCell = m_skillBase.GetComponentInChildren <DamageCell>();
                    //DamageCell damageCell = m_skillBase.m_actor.GetComponent<DamageCell>();
                    if (damageCell)
                    {
                        OneDamageInfo damageInfo = damageCell.GetOneDamageInfo();
                        if (null != damageInfo && !string.IsNullOrEmpty(m_bossDeathFromSkyDesc.efxPrefab))
                        {
                            //Vector3 pos = m_skillBase.m_actor.transform.position;

                            m_efxObj = Instantiate(
                                CoreEntry.gResLoader.LoadResource(m_bossDeathFromSkyDesc.efxPrefab)) as GameObject; //(damageInfo.efxWarning)) as GameObject;

                            if (m_efxObj == null)
                            {
                                return;
                            }

                            ParticleScaler ScaleComponet = m_efxObj.GetComponent <ParticleScaler>();
                            if (ScaleComponet == null)
                            {
                                ScaleComponet = m_efxObj.AddComponent <ParticleScaler>();
                            }
                            // ScaleComponet.particleScale = m_actor.actorCreatureDisplayDesc.sacle ;

                            //策划要求缩放里面的例子
                            //ScaleComponet.prevScale = 1.0f;


                            m_efxObj.transform.position = new Vector3(m_skillBase.m_actor.transform.position.x,
                                                                      m_skillBase.m_actor.transform.position.y + 0.2f, m_skillBase.m_actor.transform.position.z);
                            if (DamageTypeID.DTID_FUN == damageInfo.type)
                            {
                                m_efxObj.transform.forward = m_skillBase.m_actor.transform.forward;
                                //m_efxObj.transform.localScale = new Vector3(1.0f, 0f, 1.0f) * damageInfo.damageNode.funDamage.radius * 2 * (1 + fbig);

                                ScaleComponet.particleScale = damageInfo.damageNode.funDamage.radius * 2 * (1 + fbig);
                            }
                            else if (DamageTypeID.DTID_RECT == damageInfo.type)
                            {
                                m_efxObj.transform.forward = m_skillBase.m_actor.transform.forward;
                                //m_efxObj.transform.localScale = new Vector3(1.0f, 0f, 1.0f) * damageInfo.damageNode.funDamage.radius * 2 * (1 + fbig);
                                ScaleComponet.particleScale = damageInfo.damageNode.funDamage.radius * 2 * (1 + fbig);
                            }



                            //Vector3 decalPos = pos + 0.2f * m_skillBase.m_actor.m_transform.up;  //实际贴花位置比原来高0.2米  防止看不到
                            //if (DamageTypeID.DTID_FUN == damageInfo.type)
                            //{
                            //    m_WarningDecel = WarningDecel.CreateSectorDecal(m_bossDeathFromSkyDesc.efxPrefab, decalPos,
                            //         damageInfo.damageNode.funDamage.radius * 2 * (1 + fbig), damageInfo.damageNode.funDamage.angle);
                            //}
                            //else if (DamageTypeID.DTID_RECT == damageInfo.type)
                            //{
                            //    m_WarningDecel = WarningDecel.CreateRectangleDecal(m_bossDeathFromSkyDesc.efxPrefab, decalPos,
                            //             damageInfo.damageNode.rectDamage.width * (1 + fbig), damageInfo.damageNode.rectDamage.length * (1 + fbig));
                            //}
                        }
                    }
                }
            }
        }