public override void Start() { base.Start(); EquipmentCmpt equipment = Entity.GetCmpt <EquipmentCmpt>(); equipment.mItemReciver = this; }
void RPC_S2C_EquipedItems(uLink.BitStream stream, uLink.NetworkMessageInfo info) { ItemObject[] equips = stream.Read <ItemObject[]>(); if (Equals(null, entity)) { return; } Pathea.EquipmentCmpt cmpt = entity.GetCmpt <Pathea.EquipmentCmpt>(); if (null != cmpt) { cmpt.ApplyEquipment(equips); } }
public override void Start() { base.Start(); cmptIK = Entity.GetCmpt <IKCmpt>(); cmptCommon = GetComponent <CommonCmpt>(); cmptEquipment = GetComponent <EquipmentCmpt>(); Entity.aliveEntity.deathEvent += OnDeath; Entity.aliveEntity.reviveEvent += OnRevive; //there is no scene event if (SceneMan.self == null) { this.Invoke(0.1f, Build); } }
void RPC_S2C_PutOnEquipment(uLink.BitStream stream, uLink.NetworkMessageInfo info) { ItemObject[] equips = stream.Read <ItemObject[]>(); if (Equals(null, entity)) { return; } Pathea.EquipmentCmpt cmpt = entity.GetCmpt <Pathea.EquipmentCmpt>(); if (null != cmpt) { foreach (ItemObject equip in equips) { cmpt.PutOnEquipment(equip, false, null, true); } } }
void RPC_S2C_TakeOffEquipment(uLink.BitStream stream, uLink.NetworkMessageInfo info) { int[] equipIds = stream.Read <int[]>(); if (Equals(null, entity)) { return; } Pathea.EquipmentCmpt cmpt = entity.GetCmpt <Pathea.EquipmentCmpt>(); if (null != cmpt) { foreach (int equipId in equipIds) { ItemObject equip = ItemMgr.Instance.Get(equipId); cmpt.TakeOffEquipment(equip, false, null, true); } } }
void InitAction() { m_Trans = Entity.peTrans; m_Skill = Entity.aliveEntity; m_Skill.onSheildReduce += OnSheildReduce; m_View = Entity.biologyViewCmpt; m_EquipCmpt = Entity.equipmentCmpt; m_Package = Entity.packageCmpt; m_NPC = Entity.NpcCmpt; m_Anim = Entity.animCmpt; m_MotionMgr = Entity.motionMgr; Invoke("CheckGloves", 0.5f); m_HeavyEquipmentCtrl.moveCmpt = Entity.motionMove as Motion_Move_Human; m_HeavyEquipmentCtrl.ikCmpt = Entity.IKCmpt; m_HeavyEquipmentCtrl.motionMgr = m_MotionMgr; // m_ChainSawActive.anim = anim; m_SwordAttack.m_UseStamina = isMainPlayer; m_TwoHandWeaponAttack.m_UseStamina = isMainPlayer; //Gun m_GunFire.m_gunHold = m_GunHold; m_HandChangeHold.onActiveEvt += OnActiveEquipment; m_HandChangeHold.onDeactiveEvt += OnDeactiveEquipment; m_TwoHandWeaponHold.onActiveEvt += OnActiveEquipment; m_TwoHandWeaponHold.onDeactiveEvt += OnDeactiveEquipment; m_GunHold.onActiveEvt += OnActiveEquipment; m_GunHold.onDeactiveEvt += OnDeactiveEquipment; m_BowHold.onActiveEvt += OnActiveEquipment; m_BowHold.onDeactiveEvt += OnDeactiveEquipment; m_AimEquipHold.onActiveEvt += OnActiveEquipment; m_AimEquipHold.onDeactiveEvt += OnDeactiveEquipment; if (null != m_MotionMgr) { m_MotionMgr.onActionEnd += OnActionEnd; m_MotionMgr.AddAction(m_HandChangeHold); m_MotionMgr.AddAction(m_HandChangePutOff); m_MotionMgr.AddAction(m_SwordAttack); m_MotionMgr.AddAction(m_TwoHandWeaponHold); m_MotionMgr.AddAction(m_TwoHandWeaponPutOff); m_MotionMgr.AddAction(m_TwoHandWeaponAttack); m_MotionMgr.AddAction(m_SheildHold); m_MotionMgr.AddAction(m_GunHold); m_MotionMgr.AddAction(m_GunPutOff); m_MotionMgr.AddAction(m_GunFire); m_MotionMgr.AddAction(m_GunReload); m_MotionMgr.AddAction(m_GunMelee); m_MotionMgr.AddAction(m_BowHold); m_MotionMgr.AddAction(m_BowPutOff); m_MotionMgr.AddAction(m_BowShoot); m_MotionMgr.AddAction(m_BowReload); m_MotionMgr.AddAction(m_AimEquipHold); m_MotionMgr.AddAction(m_AimEquipPutOff); m_MotionMgr.AddAction(m_DigTerrain); m_MotionMgr.AddAction(m_Fell); m_MotionMgr.AddAction(m_JetPackAction); m_MotionMgr.AddAction(m_ParachuteAction); m_MotionMgr.AddAction(m_GliderAction); m_MotionMgr.AddAction(m_DrawWater); m_MotionMgr.AddAction(m_PumpWater); m_MotionMgr.AddAction(m_ThrowGrenade); m_MotionMgr.AddAction(m_FlashLightAction); m_MotionMgr.AddAction(m_RopeGunAction); } }
public ShortCutSlotList(int count, ItemPackage pkg, EquipmentCmpt equip) { mShortCutItems = new ShortCutItem[count]; mPkg = pkg; mEquip = equip; }