Пример #1
0
 // 销毁所有指定类型的道具
 public void destroyAllItem(SCENE_ITEM type = SCENE_ITEM.SI_MAX)
 {
     // 销毁所有道具
     if (type == SCENE_ITEM.SI_MAX)
     {
         foreach (var item in mItemList)
         {
             int count = item.Value.Count;
             for (int i = 0; i < count; ++i)
             {
                 (item.Value)[i].destroy();
             }
         }
         mItemList.Clear();
     }
     // 销毁指定类型的道具
     else
     {
         if (!mItemList.ContainsKey(type))
         {
             return;
         }
         int count = mItemList[type].Count;
         for (int i = 0; i < count; ++i)
         {
             mItemList[type][i].destroy();
         }
         mItemList[type].Clear();
     }
 }
Пример #2
0
 public SceneItemBase(string name, SCENE_ITEM type)
     :
     base(name)
 {
     mType = type;
     mSelfControlDestroy = false;
 }
Пример #3
0
 public SceneItemBox(SCENE_ITEM type)
     :
     base("ItemBox", type)
 {
     mSelfControlDestroy  = true;
     mExplodeParticleName = "ItemBox_SOmobileFX_galaxy_2";
     mBoxModelNodeName    = "DJ_xiangzi";
 }
Пример #4
0
 public SceneLandMine(SCENE_ITEM type)
     :
     base("Landmine", type)
 {
     mSelfControlDestroy  = true;
     mExplodeParticleName = "Landmine_3D_FireHit_01";
     mLandmineModelName   = "DJ_dilei";
 }
Пример #5
0
 public SceneMissile(SCENE_ITEM type)
     :
     base("Missile", type)
 {
     mSelfControlDestroy   = true;
     mExplodeParticleName  = "Missile_M_3D_Hit_02";
     mExplodeParticleName1 = "Missile_M_3D_EarthMagic_02";
     mMissileModelName     = "DJ_daodan";
 }
Пример #6
0
    // 延迟创建一个道具
    public void createItemDelay(SCENE_ITEM type, float time, ItemParamBase param)
    {
        CommandSceneItemManagerCreateItem cmd = newCmd(out cmd, true, true);

        cmd.mParam    = param;
        cmd.mItemType = type;
        pushDelayCommand(cmd, this, time);
        cmd.addStartCommandCallback(onCreateItemCmd, null);
        mDelayCreateList.Add(cmd.mAssignID);
    }
Пример #7
0
    // 创建一个道具
    public SceneItemBase createItem(SCENE_ITEM type, ItemParamBase param)
    {
        if (!mItemRegisteList.ContainsKey(type))
        {
            return(null);
        }
        SceneItemBase item = UnityUtility.createInstance <SceneItemBase>(mItemRegisteList[type], type);

        item.init(param);
        if (mItemList.ContainsKey(type))
        {
            mItemList[type].Add(item);
        }
        else
        {
            List <SceneItemBase> itemList = new List <SceneItemBase>();
            itemList.Add(item);
            mItemList.Add(type, itemList);
        }
        return(item);
    }
Пример #8
0
 public T createItem <T>(SCENE_ITEM type, ItemParamBase param) where T : SceneItemBase
 {
     return(createItem(type, param) as T);
 }
Пример #9
0
 //------------------------------------------------------------------------------------------------
 protected void registeItem <T>(SCENE_ITEM type) where T : SceneItemBase
 {
     mItemRegisteList.Add(type, typeof(T));
 }
Пример #10
0
 public override void init()
 {
     base.init();
     mParam    = null;
     mItemType = SCENE_ITEM.SI_MAX;
 }
Пример #11
0
    public override string showDebugInfo()
    {
        SCENE_ITEM type = mSceneItem != null?mSceneItem.getItemType() : SCENE_ITEM.SI_MAX;

        return(this.GetType().ToString() + " : type : " + type);
    }
 public override void init()
 {
     base.init();
     mAttackSource = SCENE_ITEM.SI_MAX;
 }