/// <summary> /// Merge a <see cref="BasicDevice"/> and <see cref="TwoPieceDevice"/> to a <see cref="ThreePieceDevice"/> /// </summary> /// <returns>null if failed</returns> public GameObject MergeBasicAndTwoPiece(BasicDevice basic, TwoPieceDevice twoPiece) { List <DeviceInfo> infos = new List <DeviceInfo>(); infos.Add(basic.DeviceInfo); infos.AddRange(twoPiece.DeviceInfos); return(InstantiateThreePieceDevice(infos.ToArray())); }
private GameObject InstantiateBasicDevice(DeviceInfo info) { GameObject go = Instantiate(PrefabHolder.Instance.devices.basicDevice); BasicDevice device = go.GetComponent <BasicDevice>(); device.SetDeviceInfo(info); device.DeviceId = info.Uid; ActivateGameObjectIfNeeded(go); Debug.LogFormat("Spawned BasicDevice with uid '{0}'", device.DeviceId); return(go); }
/// <summary> /// Merge <see cref="BasicDevice"/> devices to a <see cref="TwoPieceDevice"/> /// </summary> /// <returns>null if failed</returns> public GameObject MergeBasicDevices(BasicDevice left, BasicDevice right) { return(InstantiateTwoPieceDevice(left.DeviceInfo, right.DeviceInfo)); }