示例#1
0
        /// <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()));
        }
示例#2
0
        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);
        }
示例#3
0
 /// <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));
 }