Example #1
0
 void Awake()
 {
     aerodynamics      = GetComponent <PlayerAerodynamicsController>();
     sparkleController = GameObject.Find("SparkleRising").gameObject.GetComponent <SparkleController>();
     turbineBoost      = GetComponent <TurbineBoost>();
     windBoost         = GetComponent <WindBoost>();
 }
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        aerodynamics = target as PlayerAerodynamicsController;

        EditorGUILayout.HelpBox(
            string.Format("Terminal bottom speed: {0,2:f} Km/h\nTerminal front speed: {1,2:f} Km/h\nTerminal right speed: {2,2:f} Km/h",
                          aerodynamics.getTerminalBottomSpeed() * 3.6,
                          aerodynamics.getTerminalFrontSpeed() * 3.6,
                          aerodynamics.getTerminalrightSpeed() * 3.6)
            , MessageType.Info);
    }
Example #3
0
    void LoadLevel()
    {
        for (int i = 0; i < Levels.Length; i++)
        {
            Levels[i].LevelObject.SetActive(i == gameStatus.Level);
        }

        level = Levels[gameStatus.Level];

        WindBoost windBoost = player.GetComponent <WindBoost>();

        windBoost.infiniteBoost = DebugOn ? InfiniteBoost : level.InfiniteBoost;
        windBoost.boostDuration = level.BoostDuration;
        windBoost.StartBoost    = level.StartBoost;

        PlayerAerodynamicsController dynamics = player.GetComponent <PlayerAerodynamicsController>();

        if (level.OverrideDynamics)
        {
            if (level.Gravity != 0)
            {
                dynamics.Gravity = level.Gravity;
            }
            if (level.Mass != 0)
            {
                dynamics.Mass = level.Mass;
            }
            if (level.cdBottom != 0)
            {
                dynamics.cdBottom = level.cdBottom;
            }
            if (level.cdFront != 0)
            {
                dynamics.cdFront = level.cdFront;
            }
            if (level.cdRight != 0)
            {
                dynamics.cdRight = level.cdRight;
            }
            if (level.LiftCoefficient != 0)
            {
                dynamics.LiftCoefficient = level.LiftCoefficient;
            }
        }

        levelStats.Completed = false;
        levelStats.LevelName = LevelNames.Names[gameStatus.Level];
    }