static public string GetPlayerPrefab(ColorPathType path) { string obj = ""; switch (path) { case ColorPathType.Blue: obj = "Prefabs/Cylinders/BlueCylinder"; break; case ColorPathType.Green: obj = "Prefabs/Cylinders/GreenCylinder"; break; case ColorPathType.Orange: obj = "Prefabs/Cylinders/OrangeCylinder"; break; case ColorPathType.Purple: obj = "Prefabs/Cylinders/PurpleCylinder"; break; case ColorPathType.Red: obj = "Prefabs/Cylinders/RedCylinder"; break; case ColorPathType.Yellow: obj = "Prefabs/Cylinders/YellowCylinder";; break; } return(obj); }
public GameObject GetColorPathObject(ColorPathType path) { GameObject obj = bluePath; switch (path) { case ColorPathType.Blue: obj = bluePath; break; case ColorPathType.Green: obj = greenPath; break; case ColorPathType.Orange: obj = orangePath; break; case ColorPathType.Purple: obj = purplePath; break; case ColorPathType.Red: obj = redPath; break; case ColorPathType.Yellow: obj = yellowPath; break; } return(obj); }
public static List <GameObject> FindTargetBlocks(ColorPathType path, int step) { GameObject obj = gameBoard.GetColorPathObject(path); //Debug.LogWarning("begin: " + obj.name); return(gameBoard.FindMoveTargets(obj, step - 1, true)); }
static public PlayerController InstantiatePlayer(ColorPathType path) { string obj = GetPlayerPrefab(path); GameObject go = (GameObject)Instantiate(Resources.Load(obj), Vector3.zero, Quaternion.identity); var player = go.GetComponentInChildren <PlayerController>(); return(player); }
static public PlayerController CreateForeignPlayer(ColorPathType colorPath) { PlayerController player = InstantiatePlayer(colorPath); player.Initialize(colorPath, PlayerType.ForeignPlayer); playerControllers.Add(player); return(player); }
static public PlayerController createAvatarPlayer(ColorPathType colorPath, Vector3 position, Quaternion rotation) { string prefabName = GetPlayerPrefab(colorPath); GameObject obj = PhotonNetwork.Instantiate(prefabName, position, rotation, 0); PlayerController player = obj.GetComponent <PlayerController>(); player.Initialize(colorPath, PlayerType.LocalPlayer); return(player); }
public void Initialize(ColorPathType pathType, PlayerType ptype) { this.colorPath = pathType; this.playerType = ptype; }