public virtual void OnReplicationDeserialize_CJGenerated(P2PNetworkReader reader, bool initial_state)
    {
        this.m_BestTriggerReplObj_Repl     = reader.ReadGameObject();
        this.m_ExecutedTriggerReplObj_Repl = reader.ReadGameObject();
        int num = (int)reader.ReadPackedUInt32();

        if (this.m_BestTriggerChildIdx_Repl == null || this.m_BestTriggerChildIdx_Repl.Count != num)
        {
            this.m_BestTriggerChildIdx_Repl = new List <int>(num);
        }
        for (int i = 0; i < num; i++)
        {
            if (this.m_BestTriggerChildIdx_Repl.Count != num)
            {
                int item = reader.ReadInt32();
                this.m_BestTriggerChildIdx_Repl.Add(item);
            }
            else
            {
                this.m_BestTriggerChildIdx_Repl[i] = reader.ReadInt32();
            }
        }
        int num2 = (int)reader.ReadPackedUInt32();

        if (this.m_ExecutedTriggerChildIdx_Repl == null || this.m_ExecutedTriggerChildIdx_Repl.Count != num2)
        {
            this.m_ExecutedTriggerChildIdx_Repl = new List <int>(num2);
        }
        for (int j = 0; j < num2; j++)
        {
            if (this.m_ExecutedTriggerChildIdx_Repl.Count != num2)
            {
                int item2 = reader.ReadInt32();
                this.m_ExecutedTriggerChildIdx_Repl.Add(item2);
            }
            else
            {
                this.m_ExecutedTriggerChildIdx_Repl[j] = reader.ReadInt32();
            }
        }
    }
Esempio n. 2
0
        public virtual void OnReplicationDeserialize_CJGenerated(P2PNetworkReader reader, bool initial_state)
        {
            this.m_WeaponType_Repl = (HumanAI.WeaponType)reader.ReadInt32();
            GameObject gameObject         = reader.ReadGameObject();
            int        repl_behaviour_idx = reader.ReadInt32();

            this.m_PrimaryWeapon_Repl = (gameObject ? ((Item)gameObject.GetComponent <ReplicationComponent>().GetComponentFromIndex(repl_behaviour_idx)) : null);
            GameObject gameObject2         = reader.ReadGameObject();
            int        repl_behaviour_idx2 = reader.ReadInt32();

            this.m_AdditionalWeapon_Repl = (gameObject2 ? ((Item)gameObject2.GetComponent <ReplicationComponent>().GetComponentFromIndex(repl_behaviour_idx2)) : null);
            GameObject gameObject3         = reader.ReadGameObject();
            int        repl_behaviour_idx3 = reader.ReadInt32();

            this.m_SecondaryWeapon_Repl = (gameObject3 ? ((Item)gameObject3.GetComponent <ReplicationComponent>().GetComponentFromIndex(repl_behaviour_idx3)) : null);
            GameObject gameObject4         = reader.ReadGameObject();
            int        repl_behaviour_idx4 = reader.ReadInt32();

            this.m_CurrentWeapon_Repl = (gameObject4 ? ((Item)gameObject4.GetComponent <ReplicationComponent>().GetComponentFromIndex(repl_behaviour_idx4)) : null);
            GameObject gameObject5         = reader.ReadGameObject();
            int        repl_behaviour_idx5 = reader.ReadInt32();

            this.m_CurrentAdditionalWeapon_Repl = (gameObject5 ? ((Item)gameObject5.GetComponent <ReplicationComponent>().GetComponentFromIndex(repl_behaviour_idx5)) : null);
        }
 public override void OnReplicationDeserialize(P2PNetworkReader reader, bool initialState)
 {
     this.m_ReplAttachmentIdx = reader.ReadInt32();
     this.m_ReplParent        = reader.ReadGameObject();
 }