public static new NormalGround DeSerialize(int ID, Vector3 wPos, bool use = true)
        {
            var obj = New(ID, wPos, R.asset.prefab.normalGround);

            if (ID == 149)
            {
                obj.name   = Name.START;
                startPoint = obj;
            }
            else if (ID == 150)
            {
                obj.name = Name.END;
                endPoint = obj;
            }
            else
            {
                obj.name = Name.NORMAL;
            }

            if (use)
            {
                obj.Use();
            }
            return(obj);
        }
示例#2
0
        public static Platform DeSerialize(int ID, Vector3 wPos, bool use = true)
        {
            Platform platform = null;

            if ((0 <= ID && ID <= 76) || (78 <= ID && ID <= 86) || ID == 91 || (249 <= ID && ID <= 254))
            {
                platform = NormalObstacle.DeSerialize(ID, wPos, use);
            }

            else if ((94 <= ID && ID <= 147) || ID == 149 || ID == 150 || ID == 158)
            {
                platform = NormalGround.DeSerialize(ID, wPos, use);
            }

            else if (ID == 77)
            {
                platform = Snow.DeSerialize(ID, wPos, use);
            }

            else if (87 <= ID && ID <= 90)
            {
                platform = WaterFlow.DeSerialize(ID, wPos, use);
            }

            else if (ID == 148)
            {
                platform = SlipperyIce.DeSerialize(ID, wPos, use);
            }

            else if ((151 <= ID && ID <= 157) || ID == 159 || ID == 207 || ID == 221 || ID == 243 || ID == 246 || ID == 248)
            {
                platform = Item.DeSerialize(ID, wPos, use);
            }

            else if (ID == 160)
            {
                platform = GrassMowerStop.DeSerialize(ID, wPos, use);
            }

            else if (ID == 161 || ID == 162)
            {
                platform = RailRoadButton.DeSerialize(ID, wPos, use);
            }

            else if (ID == 163 || ID == 164)
            {
                platform = MazeButton.DeSerialize(ID, wPos, use);
            }

            else if (ID == 165 || ID == 166)
            {
                platform = WaterFlowButton.DeSerialize(ID, wPos, use);
            }

            else if (167 <= ID && ID <= 174)
            {
                platform = PinWheelButton.DeSerialize(ID, wPos, use);
            }

            else if (ID == 175 || ID == 176)
            {
                platform = Trap.DeSerialize(ID, wPos, use);
            }

            else if (177 <= ID && ID <= 180)
            {
                platform = Mirror.DeSerialize(ID, wPos, use);
            }

            else if (181 <= ID && ID <= 184)
            {
                platform = RailRoad.DeSerialize(ID, wPos, use);
            }

            else if (185 <= ID && ID <= 190)
            {
                platform = Maze.DeSerialize(ID, wPos, use);
            }

            else if (191 <= ID && ID <= 194)
            {
                platform = BoxButton.DeSerialize(ID, wPos, use);
            }

            else if (195 <= ID && ID <= 198)
            {
                platform = Box.DeSerialize(ID, wPos, use);
            }

            else if (ID == 199)
            {
                platform = Grass.DeSerialize(ID, wPos, use);
            }

            else if (200 <= ID && ID <= 202)
            {
                platform = Carrot.DeSerialize(ID, wPos, use);
            }

            else if (ID == 203 || ID == 204)
            {
                platform = EasterEgg.DeSerialize(ID, wPos, use);
            }

            else if (ID == 205)
            {
                platform = Locker.DeSerialize(ID, wPos, use);
            }

            else if (ID == 206 || ID == 222 || ID == 223 || ID == 238)
            {
                platform = BeanTree.DeSerialize(ID, wPos, use);
            }

            else if (208 <= ID && ID <= 211)
            {
                platform = PinWheel.DeSerialize(ID, wPos, use);
            }

            else if (ID == 212)
            {
                platform = Wood.DeSerialize(ID, wPos, use);
            }

            else if (215 <= ID && ID <= 217)
            {
                platform = Dragon.DeSerialize(ID, wPos, use);
            }

            else if (ID == 227)
            {
                platform = IcyBlock.DeSerialize(ID, wPos, use);
            }

            else if (ID == 237)
            {
                platform = Rock.DeSerialize(ID, wPos, use);
            }

            else if (240 <= ID && ID <= 242)
            {
                platform = CloudHole.DeSerialize(ID, wPos, use);
            }

            else if (ID == 244 || ID == 245)
            {
                platform = Wind.DeSerialize(ID, wPos, use);
            }

            return(platform);
        }