Пример #1
0
 public void Enter()
 {
     foreach (RideAnimationEvent RAE in Events)
     {
         RAE.Enter();
     }
 }
Пример #2
0
        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);
        }
Пример #3
0
        public RAE UnitVector()
        {
            var unitVector = new RAE()
            {
                R = 1.0,
                A = A,
                E = E
            };

            return(unitVector);
        }
Пример #4
0
    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();
    }
Пример #5
0
        public static RAE XYZToRAE(XYZ xyz)
        {
            var r = xyz.Magnitude();
            var a = Atan2(xyz.Y, xyz.X);
            var e = Asin(-xyz.Z / r);

            var rae = new RAE()
            {
                R = r,
                A = a,
                E = e
            };

            return(rae);
        }
Пример #6
0
        public static XYZ RAEToXYZ(RAE rae)
        {
            var x = rae.R * Cos(rae.A) * Cos(rae.E);
            var y = rae.R * Sin(rae.A) * Cos(rae.E);
            var z = -rae.R * Sin(rae.E);

            var xyz = new XYZ()
            {
                X = x,
                Y = y,
                Z = z
            };

            return(xyz);
        }
Пример #7
0
        public static RAE NEDToRAE(NED ned)
        {
            var r = ned.Magnitude();
            var a = Atan2(ned.E, ned.N);
            var e = Asin(-ned.D / r);

            var rae = new RAE()
            {
                R = r,
                A = a,
                E = e
            };

            return(rae);
        }
Пример #8
0
        public static NED RAEToNED(RAE rae)
        {
            var x = rae.R * Cos(rae.A) * Cos(rae.E);
            var y = rae.R * Sin(rae.A) * Cos(rae.E);
            var z = -rae.R * Sin(rae.E);

            var ned = new NED()
            {
                N = x,
                E = y,
                D = z
            };

            return(ned);
        }
Пример #9
0
 public void Run()
 {
     foreach (RideAnimationEvent RAE in Events)
     {
         RAE.Run();
     }
     done = true;
     foreach (RideAnimationEvent RAE in Events)
     {
         if (!RAE.done)
         {
             running = true;
             done    = false;
             break;
         }
     }
     if (done)
     {
         running = false;
     }
 }