public PLAYER_ITEM generateItemType() { PLAYER_ITEM[] typeList = new PLAYER_ITEM[] { PLAYER_ITEM.PI_MISSILE, PLAYER_ITEM.PI_SHIELD, PLAYER_ITEM.PI_TURBO, PLAYER_ITEM.PI_LAND_MINE }; int itemIndex = MathUtility.randomInt(0, typeList.Length - 1); return(typeList[itemIndex]); }
public void addProp(PLAYER_ITEM type) { activeProp(true); ItemInfo itemInfo = mScript.mItemInfoList[type]; mIcon.setSpriteName(itemInfo.mIconSpriteName); mIcon.setWindowSize(itemInfo.mSpriteSize); mLabel.setLabel(itemInfo.mPropsName); }
public void addProps(PLAYER_ITEM itemType, int itemIndex) { if (itemIndex > GameDefine.PACK_ITEM_COUNT) { UnityUtility.logError("itemIndex " + itemIndex + " is out of range count : " + mPropsList.Count); return; } mPropsList[itemIndex].addProp(itemType); }
public int getFirstItemIndex(PLAYER_ITEM item) { int maxCount = mPackItem.Length; for (int i = 0; i < maxCount; ++i) { if (mPackItem[i] != null && mPackItem[i].getItemType() == item) { return(i); } } return(-1); }
public int addItem(PLAYER_ITEM type) { PlayerItemBase item = createPlayerItem(type); int maxCount = mPackItem.Length; int startIndex = mSelectedIndex == -1 ? 0 : mSelectedIndex; for (int i = 0; i < maxCount; ++i) { int index = (startIndex + i) % maxCount; if (mPackItem[index] == null) { ++mItemCount; mPackItem[index] = item; return(index); } } return(0); }
public PlayerTurbo(PLAYER_ITEM type) : base(type) { ; }
public PlayerMissile(PLAYER_ITEM type) : base(type) { ; }
public override void init() { base.init(); mItemType = PLAYER_ITEM.PI_MAX; }
public PlayerItemBase(PLAYER_ITEM type) { mType = type; }
protected void registePlayerItem <T>(PLAYER_ITEM type) where T : PlayerItemBase { mRegisteList.Add(type, typeof(T)); }
//---------------------------------------------------------------------------------------------------------------- protected PlayerItemBase createPlayerItem(PLAYER_ITEM type) { return(UnityUtility.createInstance <PlayerItemBase>(mRegisteList[type], type)); }
public PlayerShield(PLAYER_ITEM type) : base(type) { ; }
public PlayerLandMine(PLAYER_ITEM type) : base(type) { ; }