GreedyMerchant
Member
I can't get my custom spawn manager working. When I use it in the demo scene nothing spawns (none of the public gameobjects are null). What am I doing wrong?
using UnityEngine;
using Opsive.UltimateCharacterController.AddOns.Multiplayer.PhotonPun.Game;
using Photon.Realtime;
public class MySpawnManager : SpawnManagerBase
{
public GameObject myGameObject;
public GameObject myGhost;
public GameObject myWallWalker;
public GameObject myRocketJumper;
/// <summary>
/// Virtual method which allows for a character to be spawned based on the game logic.
/// </summary>
/// <param name="newPlayer">The player that entered the room.</param>
/// <returns>The character prefab that should spawn.</returns>
protected override GameObject GetCharacterPrefab(Player newPlayer)
{
Debug.Log("Spawning characters, newPlayer: " + newPlayer.TagObject);
switch((int) newPlayer.TagObject){
case 1:
return myGhost;
break;
case 2:
return myWallWalker;
break;
case 3:
return myRocketJumper;
break;
}
return myGameObject; // Replace with your own game logic.
}
}