void SelectSceneItem()
        {
            float          dis   = DistanceFindUnit;
            int            index = -1;
            SceneItemAgent tar   = null;

            //直接遍历算了
            for (int i = 0; i < Main.Ins.MeteorManager.SceneItems.Count; i++)
            {
                SceneItemAgent item = Main.Ins.MeteorManager.SceneItems[i].gameObject.GetComponent <SceneItemAgent>();
                if (item == null)
                {
                    continue;
                }
                if (!item.CanPickup())
                {
                    continue;
                }
                float d = Vector3.SqrMagnitude(Player.transform.position - item.transform.position);
                if (dis > d)
                {
                    dis   = d;
                    index = i;
                    tar   = item;
                }
            }
            if (index >= 0 && index < Main.Ins.MeteorManager.SceneItems.Count && tar != null)
            {
                Player.TargetItem = tar;
            }
        }
 public void RemoveCollision(SceneItemAgent agent)
 {
     if (agent != null && Collision.ContainsKey(agent))
     {
         Collision.Remove(agent);
     }
 }
示例#3
0
    public static void OnComplete(GameObject obj)
    {
        SceneItemAgent agent  = obj.GetComponent <SceneItemAgent>();
        CFX_AutoRotate rotate = obj.GetComponent <CFX_AutoRotate>();

        GameObject.Destroy(rotate);

        obj.transform.rotation = Quaternion.Euler(0, obj.transform.eulerAngles.y, 0);
        if (agent != null)
        {
            agent.OnStart();
            //agent.SetAsDrop();
            if (agent.ItemInfo != null && agent.ItemInfo.IsFlag())
            {
                agent.SetAutoDestroy(3.0f);//镖物归位
            }
        }
        else
        {
            PickupItemAgent a = obj.GetComponent <PickupItemAgent>();
            if (a != null)
            {
                a.OnStart();
            }
        }
    }
示例#4
0
 public void OnDestroySceneItem(SceneItemAgent item)
 {
     if (!SceneItems.Contains(item))
     {
         return;
     }
     SceneItems.Remove(item);
 }
示例#5
0
 public void OnGenerateSceneItem(SceneItemAgent item)
 {
     if (SceneItems.Contains(item))
     {
         return;
     }
     SceneItems.Add(item);
     item.InstanceId = SceneItemInstanceIdx++;
 }
示例#6
0
 public void OnDestroySceneItem(SceneItemAgent item)
 {
     if (!SceneItems.Contains(item))
     {
         return;
     }
     if (SceneNameHash.ContainsKey(item.name))
     {
         SceneNameHash.Remove(item.name);
     }
     SceneItems.Remove(item);
 }
 //反复计算飞镖伤害问题
 public void OnTriggerEnter(Collider other)
 {
     if (other.transform.root.gameObject.layer == LayerMask.NameToLayer("Scene"))
     {
         SceneItemAgent it = other.GetComponentInParent <SceneItemAgent>();
         if (it != null)
         {
             //Debug.Log("dart attack sceneitemagent");
             if (recordList.Find(m => m.sceneitem.Equals(it)) != null)
             {
                 return;
             }
             it.OnDamage(owner, _attack);
             DamageRecord record = new DamageRecord();
             record.target    = null;
             record.sceneitem = it;
             record.tick      = 0.2f;
             recordList.Add(record);
         }
         GameObject.Destroy(gameObject);
     }
     else
     {
         MeteorUnit unit = other.GetComponentInParent <MeteorUnit>();
         if (unit == null)
         {
             return;
         }
         //同队忽略攻击
         if (unit.SameCamp(owner))
         {
             return;
         }
         //部分关卡角色无阵营
         if (unit == owner)
         {
             return;
         }
         //反复进入.各个骨骼,不同的受击盒.
         if (recordList.Find(m => m.target.Equals(unit)) != null)
         {
             return;
         }
         //Debug.LogError("dart attack start");
         unit.OnAttack(owner, _attack);
         DamageRecord record = new DamageRecord();
         record.target = unit;
         record.tick   = 0.2f;
         recordList.Add(record);
         GameObject.Destroy(gameObject);
         //Debug.LogError("dart attack end");
     }
 }
示例#8
0
 public void OnGenerateSceneItem(SceneItemAgent item)
 {
     if (SceneItems.Contains(item))
     {
         return;
     }
     if (!SceneNameHash.ContainsKey(item.name))
     {
         SceneNameHash.Add(item.name, item);
     }
     SceneItems.Add(item);
     item.InstanceId = SceneItemInstanceIdx++;
 }
示例#9
0
    // Use this for initialization
    void Start()
    {
        SceneItemAgent target = gameObject.AddComponent <SceneItemAgent>();

        target.tag = "SceneItemAgent";
        target.Load(model);
        target.LoadCustom(name, null);//自定义的一些属性,name=damage100
        target.ApplyPost();
        if (target.root != null)
        {
            target.root.gameObject.SetActive(true);
        }
    }
示例#10
0
 void DetectDamage(Collider other)
 {
     if (Owner == null) {
         if (Attacker == null)
             return;
         //角色发射出的特效攻击盒
         SceneItemAgent target = other.gameObject.GetComponentInParent<SceneItemAgent>();
         if (target != null) {
             if (Attacker.ExistDamage(target))
                 return;
             Attacker.Attack(target);
             target.OnDamage(Attacker.mOwner, AttackDef);
         } else {
             MeteorUnit unit = other.gameObject.GetComponentInParent<MeteorUnit>();
             if (unit != null) {
                 if (Attacker.mOwner == unit)
                     return;
                 if (Attacker.mOwner.SameCamp(unit))
                     return;
                 if (Attacker.ExistDamage(unit))
                     return;
                 //Debug.LogError("name:" + name + " hit other:" + other.name);
                 Attacker.Attack(unit);
                 unit.OnAttack(Attacker.mOwner, AttackDef == null ? Attacker.mOwner.CurrentDamage : AttackDef);
             }
         }
         return;
     }
     //角色身体上的攻击盒/武器上的攻击盒
     SceneItemAgent agent = other.gameObject.GetComponentInParent<SceneItemAgent>();
     if (agent != null) {
         if (Owner.ExistDamage(agent))
             return;
         Owner.Attack(agent);
         agent.OnDamage(Owner, AttackDef);
     } else {
         MeteorUnit unit = other.gameObject.GetComponentInParent<MeteorUnit>();
         if (unit != null) {
             if (Owner == unit)
                 return;
             if (Owner.SameCamp(unit))
                 return;
             if (Owner.ExistDamage(unit))
                 return;
             //Debug.LogError("name:" + name + " hit other:" + other.name);
             Owner.Attack(unit);
             unit.OnAttack(Owner, AttackDef == null ? Owner.CurrentDamage : AttackDef);
         }
     }
 }
示例#11
0
    public static void SetSceneItem(string name, string feature, string value)
    {
        GameObject objSelected = Global.Control(name, Loader.Instance.gameObject);

        if (objSelected == null)
        {
            //Debug.LogError(name + " can not find");
            return;
        }
        SceneItemAgent agent = objSelected.GetComponent <SceneItemAgent>();

        if (agent != null)
        {
            agent.SetSceneItem(feature, value);
        }
    }
示例#12
0
    GameObject CreateObj(string des, Transform pos, Vector3 forward)
    {
        GameObject obj = new GameObject(des);

        obj.transform.position   = Vector3.zero;
        obj.transform.rotation   = Quaternion.identity;
        obj.transform.localScale = Vector3.one;
        obj.transform.SetParent(Loader.Instance == null ? null : Loader.Instance.transform);
        obj.transform.position = pos.position + Vector3.up * 50 + forward * 35;
        SceneItemAgent agent = obj.AddComponent <SceneItemAgent>();

        agent.Load(des);
        agent.ApplyPost();
        agent.SetAsDrop();
        MeteorManager.Instance.OnGenerateSceneItem(agent);
        return(obj);
    }
示例#13
0
 //同上
 public bool OnIdle(SceneItemAgent sceneObj)
 {
     if (sceneObj != null)
     {
         LuaFunction func = LuaSvr.mainState.getFunction(sceneObj.name + "_OnIdle");
         if (func != null)
         {
             func.call(sceneObj.InstanceId);
             return(true);
         }
         else
         {
             Debug.LogError("can not find function:" + sceneObj.name + "_OnIdle");
             return(false);
         }
     }
     return(true);
 }
示例#14
0
 //返回,指示场景物体不要在调用此函数,因为脚本里没有相应处理
 public bool OnAttack(SceneItemAgent sceneObj, int characterid, int damage)
 {
     if (sceneObj != null)
     {
         LuaFunction func = LuaSvr.mainState.getFunction(sceneObj.name + "_OnAttack");
         if (func != null)
         {
             func.call(sceneObj.InstanceId, characterid, damage);
             return(true);
         }
         else
         {
             Debug.LogError("can not find function:" + sceneObj.name + "_OnIdle");
             return(false);
         }
     }
     return(true);
 }
示例#15
0
    public static void SetSceneItem(string name, string features, string sub_features, int value)
    {
        if (sceneRoot == null)
        {
            sceneRoot = FindObjectOfType <Loader>();
        }
        GameObject objSelected = Global.Control(name, sceneRoot.gameObject);

        if (objSelected == null)
        {
            //Debug.LogError(name + " can not find");
            return;
        }
        SceneItemAgent agent = objSelected.GetComponent <SceneItemAgent>();

        if (agent != null)
        {
            agent.SetSceneItem(features, sub_features, value);
        }
    }
示例#16
0
    public static void CreateEffect(int id, string effect)
    {
        //if (effect == "GiMaHIT")
        //Debug.LogError("find");
        SceneItemAgent[] agents    = FindObjectsOfType <SceneItemAgent>();
        SceneItemAgent   objEffect = null;

        for (int i = 0; i < agents.Length; i++)
        {
            if (agents[i].InstanceId == id)
            {
                objEffect = agents[i];
                break;
            }
        }
        if (SFXLoader.Instance != null && objEffect != null)
        {
            SFXLoader.Instance.PlayEffect(effect, objEffect.gameObject, true);
        }
    }
示例#17
0
    void OnItemPickuped(GetItemMsg item)
    {
        MeteorUnit unit = U3D.GetUnit((int)item.playerId);

        if (item.type == (int)GetItemType.SceneItem)
        {
            SceneItemAgent sceneItem = U3D.GetSceneItem((int)item.instance);
            if (sceneItem != null)
            {
                sceneItem.OnNetPickuped(unit);
            }
        }
        else if (item.type == (int)GetItemType.PickupItem)
        {
            PickupItemAgent pickup = U3D.GetPickupItem((int)item.instance);
            if (pickup != null)
            {
                pickup.OnNetPickup(unit);
            }
        }
    }
 //Dictionary<SceneItemAgent, List<Collider>>
 public void RegisterCollision(SceneItemAgent agent)
 {
     if (!Collision.ContainsKey(agent))
     {
         if (agent.HasCollision())
         {
             Collision.Add(agent, agent.GetCollsion());
         }
     }
     else
     {
         if (agent.HasCollision())
         {
             Collision[agent] = agent.GetCollsion();
         }
         else
         {
             Collision.Remove(agent);
         }
     }
 }
示例#19
0
    public static void SetSceneItem(int id, string feature, string value)
    {
        SceneItemAgent objSelected = null;

        SceneItemAgent[] agents = FindObjectsOfType <SceneItemAgent>();
        for (int i = 0; i < agents.Length; i++)
        {
            if (agents[i].InstanceId == id)
            {
                objSelected = agents[i];
                break;
            }
        }
        if (objSelected == null)
        {
            //Debug.LogError("id: " + id + " can not find");
            return;
        }
        if (objSelected != null)
        {
            objSelected.SetSceneItem(feature, value);
        }
    }
示例#20
0
    //int ViewIndex = 0;

    protected void CameraSmoothFollow(bool smooth = true)
    {
        float   CameraRadis = 0.0f;
        float   angleY      = 0;//此角度由目标与玩家间的距离的来计算,距离越近越大
        Vector3 newPos      = Vector3.zero;
        Vector3 vecTarget   = Vector3.zero;
        Vector3 wallHitPos  = Vector3.zero;//撞到墙壁的位置

        if (UnitTarget.LockTarget != null)
        {
            //观察格斗的双方
            LockTarget = UnitTarget.LockTarget.transform;
            //有锁定目标
            //开启摄像机锁定系统
            CameraLookAt.position = ((Target.position + LockTarget.position) / 2 + new Vector3(0, 25, 0));
            CameraRadis           = Vector3.Distance(Target.position, LockTarget.position) / 2 + 60;
            float   dis        = Vector3.Distance(new Vector3(Target.position.x, 0, Target.position.z), new Vector3(LockTarget.position.x, 0, LockTarget.position.z));
            Vector3 vecDiff    = Target.position - LockTarget.position;
            Vector3 vecForward = Vector3.Normalize(new Vector3(vecDiff.x, 0, vecDiff.z));

            //最远时,15度,最近时95度,其他值。10码 = 80度 140码 15度 约为 y = -0.5x + 85
            //半径最低65,最高
            angleY = -0.5f * dis + 95;
            float yHeight = Mathf.Tan(LookAtAngle * Mathf.Deg2Rad) * CameraRadis;
            newViewIndex[0]    = CameraLookAt.position + Quaternion.AngleAxis(-angleY, Vector3.up) * vecForward * CameraRadis;
            newViewIndex[0].y += yHeight;

            newViewIndex[1]    = CameraLookAt.position + Quaternion.AngleAxis(angleY, Vector3.up) * vecForward * CameraRadis;
            newViewIndex[1].y += yHeight;
            newViewIndex[2]    = CameraLookAt.position + Quaternion.AngleAxis(-angleY, Target.right) * vecForward * CameraRadis;//顶部最后考虑

            //vecTarget[0] = newViewIndex[ViewIndex];
            //vecTarget[1] = newViewIndex[(ViewIndex + 1) % 3];
            //vecTarget[2] = newViewIndex[(ViewIndex + 2) % 3];

            //重新排。当前排第一,顶部排最后,剩下的排第二。这样切换就不会那么频繁.
            //for (int i = 0; i < 3; i++)
            //    m_Targets[i].position = newViewIndex[i];
            dis = 1000.0f;
            for (int i = 0; i < 2; i++)
            {
                if (Utility.CameraCanLookTarget(UnitTarget, newViewIndex[i], out wallHitPos))
                {
                    float fdis = Vector3.Distance(newViewIndex[i], transform.position);
                    if (fdis < dis)
                    {
                        dis       = fdis;
                        vecTarget = newViewIndex[i];
                    }
                }
                else
                {
                    float fdis    = Vector3.Distance(wallHitPos, transform.position);
                    float disWall = Vector3.Distance(wallHitPos, CameraLookAt.position);//墙壁与看向目标的距离一定要足够,否则视角堵着很难受.
                    if (fdis < dis && disWall > 40.0f)
                    {
                        dis       = fdis;
                        vecTarget = wallHitPos;
                    }
                }
            }

            //左侧右侧都被墙壁堵住,并且太近
            if (vecTarget == Vector3.zero)
            {
                if (Utility.CameraCanLookTarget(UnitTarget, newViewIndex[2], out wallHitPos))
                {
                    vecTarget = newViewIndex[2];
                }
                else
                {
                    vecTarget = wallHitPos;
                }
            }

            newPos = vecTarget;
            //整个视角都是缓动的
            Vector3 velocity = currentVelocity;
            transform.position = Vector3.SmoothDamp(transform.position, newPos, ref velocity, SmoothDampTime);
            currentVelocity    = velocity;
            //摄像机朝向观察目标,平滑的旋转视角
            Quaternion to = Quaternion.LookRotation(CameraLookAt.position - transform.position, Vector3.up);
            transform.rotation = Quaternion.Lerp(transform.rotation, to, SmoothDampTime);
        }
        else
        {
            if (xRotate != 0.0f)
            {
                //根据参数调整高度,和距离.
                //最高俯仰75度。
                lastAngle -= xRotate;//鼠标往上,是仰视,往下是俯视
                if (lastAngle >= angleMax)
                {
                    lastAngle      = angleMax;
                    followDistance = Mathf.Abs((fRadis * Mathf.Cos(lastAngle * Mathf.Deg2Rad)));
                    followHeight   = Mathf.Abs((fRadis * Mathf.Sin(lastAngle * Mathf.Deg2Rad)));
                }
                else if (lastAngle <= angleMin)
                {
                    lastAngle      = angleMin;
                    followDistance = Mathf.Abs((fRadis * Mathf.Cos(lastAngle * Mathf.Deg2Rad)));
                    followHeight   = -Mathf.Abs((fRadis * Mathf.Sin(lastAngle * Mathf.Deg2Rad)));
                }
                else
                {
                    followDistance = Mathf.Abs((fRadis * Mathf.Cos(lastAngle * Mathf.Deg2Rad)));
                    followHeight   = lastAngle == 0.0f ? 0 : (lastAngle / Mathf.Abs(lastAngle)) * Mathf.Abs((fRadis * Mathf.Sin(lastAngle * Mathf.Deg2Rad)));
                }
            }

            newPos.x = Target.transform.position.x;
            newPos.y = Target.position.y + BodyHeight + followHeight;
            newPos.z = Target.transform.position.z;
            newPos  += Main.Ins.LocalPlayer.transform.forward * followDistance;

            vecTarget.x = Target.position.x;
            vecTarget.y = Target.position.y + BodyHeight;
            vecTarget.z = Target.position.z;

            //如果新的位置,与目标注视点中间隔着墙壁
            RaycastHit wallHit;
            bool       hitWall = false;
            if (Physics.Linecast(CameraLookAt.position, newPos, out wallHit, LayerManager.AllSceneMask))
            {
                hitWall = true;
                SceneItemAgent item = wallHit.collider.gameObject.GetComponentInParent <SceneItemAgent>();
                if (item != null)
                {
                    //不需要移动相机的位置
                    if (occlusionItem != null)
                    {
                        if (item != occlusionItem)
                        {
                            occlusionItem.RestoreAlpha();
                            occlusionItem = item;
                            occlusionItem.SetAlpha(0.3f);
                        }
                    }
                    else
                    {
                        occlusionItem = item;
                        item.SetAlpha(0.3f);
                    }
                }
                else
                {
                    float dis = Vector3.Distance(CameraLookAt.position, wallHit.point);
                    newPos = wallHit.point + Vector3.Normalize(CameraLookAt.position - wallHit.point) * 5;
                }
            }
            else
            {
                if (occlusionItem != null)
                {
                    occlusionItem.RestoreAlpha();
                    occlusionItem = null;
                }
            }

            //没有撞墙
            if (!hitWall)
            {
                newPos.x = Target.transform.position.x;
                newPos.z = Target.transform.position.z;
                float y = Mathf.SmoothDamp(CameraPosition.position.y, newPos.y, ref currentVelocityY, f_DampTime / 2);
                newPos.y = y;
                newPos  += Main.Ins.LocalPlayer.transform.forward * followDistance;
            }
            else
            {
                float y = Mathf.SmoothDamp(CameraPosition.position.y, newPos.y, ref currentVelocityY, f_DampTime / 2);
                newPos.y = y;
            }

            CameraPosition.position = newPos;

            vecTarget.x = Target.position.x;
            vecTarget.y = Mathf.SmoothDamp(CameraLookAt.position.y, Target.position.y + BodyHeight, ref currentVelocityY2, f_DampTime / 2);
            vecTarget.z = Target.position.z;

            CameraLookAt.position = vecTarget;

            //由电影视角,切换到单人视角之间的动画.
            if (animationPlay)
            {
                if (animationTick >= SmoothDampTime)
                {
                    animationTick = 0.0f;
                    animationPlay = false;
                }
                else
                {
                    //当锁定目标丢失,或者死亡时.从双人视角转换为单人视角的摄像机过渡动画.
                    animationTick += FrameReplay.deltaTime;
                    Vector3 velocity = currentVelocity;
                    transform.position = Vector3.SmoothDamp(transform.position, newPos, ref velocity, SmoothDampTime, f_speedMax);
                    currentVelocity    = velocity;
                    Quaternion to = Quaternion.LookRotation(CameraLookAt.position - transform.position, Vector3.up);
                    transform.rotation = Quaternion.Lerp(transform.rotation, to, SmoothDampTime);
                    return;
                }
            }
            else
            {
                transform.position = CameraPosition.position;
                transform.LookAt(CameraLookAt.position, Vector3.up);
            }
        }
    }
示例#21
0
文件: Loader.cs 项目: WeeirJoe/Joe
    public void LoadDynamicTrigger(string sceneItems)
    {
        //return;
        //mapObjectList.Clear();
        DesFile des = DesLoader.Ins.Load(sceneItems);

        for (int i = des.ObjectCount; i < des.SceneItems.Count; i++)
        {
            //一些特殊物件不需要加脚本,只相当于环境,也不用保存,只设置位置.
            if (des.SceneItems[i].name.StartsWith("D_user") ||
                des.SceneItems[i].name.StartsWith("D_team") ||
                des.SceneItems[i].name.StartsWith("D_User"))
            {
                continue;
            }
            string type;
            bool   active = false;
            if (des.SceneItems[i].ContainsKey("ticket", out type))
            {
                string[] subtype = type.Split(new char[] { ',' }, System.StringSplitOptions.RemoveEmptyEntries);
                for (int t = 0; t < subtype.Length; t++)
                {
                    if (int.Parse(subtype[t]) == (int)CombatData.Ins.GGameMode)
                    {
                        active = true;
                        break;
                    }
                }
            }
            else
            {
                active = true;
            }
            if (!active)
            {
                continue;
            }
            GameObject obj = new GameObject();
            obj.name = des.SceneItems[i].name;
            string model;
            if (des.SceneItems[i].ContainsKey("model", out model))
            {
                if (!string.IsNullOrEmpty(model))
                {
                    //先检查这个模型是否存在,1:安装包内带有资源 2:外传资源里带有资源,
                    //若都不存在,则忽略这个物件
                    if (blacklist.IndexOf(model) != -1)
                    {
                        continue;
                    }
                    SceneItemAgent target = obj.AddComponent <SceneItemAgent>();
                    target.tag = "SceneItemAgent";
                    target.Load(model);
                    target.LoadCustom(des.SceneItems[i].name, des.SceneItems[i].custom);//自定义的一些属性,name=damage100
                    target.ApplyPost();
                    if (target.root != null)
                    {
                        target.root.gameObject.SetActive(active);
                    }
                }
            }
            //环境特效.一直存在的特效.和特效挂载点
            string effect;
            if (des.SceneItems[i].ContainsKey("effect", out effect))
            {
                SFXLoader.Ins.PlayEffect(string.Format("{0}.ef", effect), obj);
            }
            obj.transform.position = des.SceneItems[i].pos;
            obj.transform.rotation = des.SceneItems[i].quat;
            obj.transform.SetParent(transform);
        }
    }
示例#22
0
    public void LoadDynamicTrigger(Level lev)
    {
        //return;
        //mapObjectList.Clear();
        DesFile des = DesLoader.Instance.Load(lev.goodList);

        for (int i = des.ObjectCount; i < des.SceneItems.Count; i++)
        {
            //一些特殊物件不需要加脚本,只相当于环境,也不用保存,只设置位置.
            if (des.SceneItems[i].name.StartsWith("D_user") ||
                des.SceneItems[i].name.StartsWith("D_team") ||
                des.SceneItems[i].name.StartsWith("D_User"))
            {
                continue;
            }
            //string effect;
            //if (des.SceneItems[i].ContainsKey("effect", out effect))
            //    continue;
            //if (des.SceneItems[i].name.StartsWith("D_wp") ||
            //    des.SceneItems[i].name.StartsWith("D_it") ||
            //    des.SceneItems[i].name.StartsWith("D_It") ||
            //    des.SceneItems[i].name.StartsWith("D_BBox") ||
            //    des.SceneItems[i].name.StartsWith("D_RJug") ||
            //    des.SceneItems[i].name.StartsWith("D_Jug"))
            //    continue;

            string type;
            bool   active = false;
            if (des.SceneItems[i].ContainsKey("ticket", out type))
            {
                //剧情模式出现
                string[] subtype = type.Split(new char[] { ',' }, System.StringSplitOptions.RemoveEmptyEntries);
                for (int t = 0; t < subtype.Length; t++)
                {
                    if (int.Parse(subtype[t]) == 6)
                    {
                        active = true;
                        break;
                    }
                }
            }
            else
            {
                active = true;
            }
            if (!active)
            {
                continue;
            }

            //某些类型的不要加载,包括有ticket却不包含6类型的,
            GameObject obj = new GameObject();
            obj.name = des.SceneItems[i].name;
            string model;
            if (des.SceneItems[i].ContainsKey("model", out model))
            {
                if (!string.IsNullOrEmpty(model))
                {
                    SceneItemAgent target = obj.AddComponent <SceneItemAgent>();
                    target.Load(model);
                    target.LoadCustom(des.SceneItems[i].name, des.SceneItems[i].custom);//自定义的一些属性,name=damage100
                    target.ApplyPost();
                    MeteorManager.Instance.OnGenerateSceneItem(target);
                }
            }
            //环境特效.一直存在的特效.和特效挂载点
            string effect;
            if (des.SceneItems[i].ContainsKey("effect", out effect))
            {
                SFXLoader.Instance.PlayEffect(effect, obj);
            }
            obj.transform.position = des.SceneItems[i].pos;
            obj.transform.rotation = des.SceneItems[i].quat;
            obj.transform.SetParent(transform);
        }
    }
示例#23
0
 public bool ExistDamage(SceneItemAgent item)
 {
     return(HurtItems.ContainsKey(item));
 }
示例#24
0
 public void Attack(SceneItemAgent item)
 {
     HurtItems.Add(item, CombatData.DamageDetectDelay);
 }