示例#1
0
        private void InitializeReplication()
        {
            // Replication.RegisterRPC("MyRPC", (System.Action<int>)this.MyRPC);
            Replication.RegisterRPC("OnReplicatedEventRPC", (System.Action <ReplicatedEvent>)EventManager.OnReplicatedEventRPC);

            // use a custom method for network instantiation to always go through the ObjectManager (pooling) system
            Replication.InstantiateMethod = GameUtils.InstantiateThroughObjectManager;

            Replication.RegisterResource("Bundles/Prefab/Player");
            Replication.RegisterResource("Bundles/Prefab/EnemyCharacter");
            Replication.RegisterResource("Bundles/Prefab/OtherPlayer");

            Replication.RegisterSerializable(typeof(RPCDictionary));
            Replication.RegisterSerializable(typeof(RPCList <EB.Replication.ViewId>));

            Replication.RegisterSerializable(typeof(LevelStartEvent));
            Replication.RegisterSerializable(typeof(SpawnerEnemiesAggroEvent));

            Replication.RegisterSerializable(typeof(EB.Sparx.SocketDataSet));
            Replication.RegisterSerializable(typeof(EB.Sparx.SocketData));
            Replication.RegisterSerializable(typeof(EB.Sparx.SocketData.SpawnerData));
            Replication.RegisterSerializable(typeof(EB.Sparx.SocketData.LootableData));
            Replication.RegisterSerializable(typeof(EB.Sparx.SocketData.CharacterData));
            Replication.RegisterSerializable(typeof(EB.Sparx.SocketData.DropData));

            CharacterCatalog.Instance.GetAssetPath();
            AutoAttackCatalog.Instance.GetAssetPath();
        }