public void Decorate(GameObject go, ParkitectObject PO) { if (go.GetComponent <Waypoints>()) { go.GetComponent <Waypoints>().waypoints = PO.waypoints; } else { go.AddComponent <Waypoints>().waypoints = PO.waypoints; } CustomFlatRide RA = go.AddComponent <CustomFlatRide>(); RA.xSize = (int)PO.XSize; RA.zSize = (int)PO.ZSize; RA.excitementRating = float.Parse(PO.XMLNode["Excitement"].InnerText); RA.intensityRating = float.Parse(PO.XMLNode["Intensity"].InnerText); RA.nauseaRating = float.Parse(PO.XMLNode["Nausea"].InnerText); RestraintRotationController controller = go.AddComponent <RestraintRotationController>(); controller.closedAngles = Loader.getVector3(PO.XMLNode["RestraintAngle"].InnerText); RA.motors = FlatRideLoader.LoadMotors(PO.XMLNode, go, RA); RA.phases = FlatRideLoader.LoadPhases(PO.XMLNode, go, RA); foreach (Phase P in RA.phases) { foreach (RideAnimationEvent RAE in P.Events) { RAE.Check(RA); } } BasicFlatRideSettings(RA); }
public override void Decorate() { //Setup waypoints if (Object.GetComponent <Waypoints>()) { Object.GetComponent <Waypoints>().waypoints = waypoints; } else { Object.AddComponent <Waypoints>().waypoints = waypoints; } //Flat Ride sSettings CustomFlatRide FR = Object.AddComponent <CustomFlatRide>(); FR.xSize = XSize; FR.zSize = ZSize; FR.excitementRating = Excitement; FR.intensityRating = Intensity; FR.nauseaRating = Nausea; //Restraints RestraintRotationController controller = Object.AddComponent <RestraintRotationController>(); controller.closedAngles = closedAngleRetraints; //Setup Animation FR.motors = Animation.motors; FR.phases = Animation.phases; foreach (Phase P in FR.phases) { foreach (RideAnimationEvent RAE in P.Events) { RAE.Check(FR); } } //Basic FlatRide Settings Debug.Log("==[Basic Settings]=="); Debug.Log(AssetManager.Instance.rideFenceGO); FR.fenceGO = AssetManager.Instance.rideFenceGO; Debug.Log(AssetManager.Instance.attractionEntranceGO); FR.entranceGO = AssetManager.Instance.attractionEntranceGO; Debug.Log(AssetManager.Instance.attractionExitGO); FR.exitGO = AssetManager.Instance.attractionExitGO; FR.categoryTag = "Attractions/Flat Ride"; FR.defaultEntranceFee = 1f; Debug.Log(AssetManager.Instance.flatRideEntranceExitBuilderGO); FR.entranceExitBuilderGO = AssetManager.Instance.flatRideEntranceExitBuilderGO; base.Decorate(); }