예제 #1
0
    void UiInfo(string mes, Color col)
    {
        GameInfoUI info = gameObject.AddComponent <GameInfoUI>();

        info.SetButton(LocaleManager.locale.OK, () => { info.HideMessage(); Destroy(info); });
        info.ShowMessage(mes, col);
    }
예제 #2
0
    public void OnCarOutOfCharge(Car c)
    {
        Debug.Log(c + " called game event");
        //Let the user know what happened
        HideWarning();
        gameui.SetButton(LocaleManager.locale.TryFix, GoBackToConstruction);
        gameui.ShowMessage(string.Format(LocaleManager.locale.LevelFailed, c.serialNumber), Color.red);

        //Move the camera to the car which ran out
        //This does not currently work, as CameraScript is no longer used in simulation
        //Change this to SimulationCamera
        /*FindObjectOfType<CameraScript>().MoveTo(new Vector3(c.transform.position.x, c.transform.position.y, Camera.main.transform.position.z));*/

        //Switch over to the review phase
        SwitchPhase(Phase.Review);
        //Call event on level script
        levelScript.OnGameOver();
    }