Ejemplo n.º 1
0
	// Use this for initialization
	void Start () {
		instance = this; // lazily reassigning singleton between stages
		// only doing it here to check whichLev when saving which level got won

		if(initTextYet == false) {
			initTextYet = true;
			for(int i = 0; i < 3; i++) {
				doneAlready[i] = false;
				wonAlready[i] = false;
			}
		}

		if(doneAlready[whichLev] == false) {
			if(voiceOver) {
				PlayClipOn(voiceOver, transform.position, 1.0f, transform);
			}
			for(int i = 0; i < AwakeWhenDone.Length; i++) {
				AwakeWhenDone[i].SetActive(false);
			}
			if(ActivatePlayerSpawner) {
				ActivatePlayerSpawner.enabled = false;
			}

			myText = GetComponent<Text>();
			fullText = myText.text;
			myText.text = " ■";
			StartCoroutine(TypeOutText());
			doneAlready[whichLev] = true;
		} else {
			WhenDone();
		}
	}
Ejemplo n.º 2
0
 /// <summary>
 /// Print a text using the color, string refered
 /// </summary>
 /// /// <param name="text">string to be shown in the Console</param>
 /// <param name="text">string to be shown in the Console</param>
 public static void Write(TypeText color, string text, bool goBackOneLine)
 {
     if (goBackOneLine)
     {
         Console.SetCursorPosition(0, Console.CursorTop - 1);
     }
     Console.ForegroundColor = (ConsoleColor)color;
     Console.WriteLine(text);
 }
Ejemplo n.º 3
0
    private void Start()
    {
        tT = TypeText.Instance;

        transitionPanel = GameObject.Find("Canvas/Transition");
        window          = GameObject.Find("Window");
        image           = GameObject.Find("Canvas/Image").GetComponent <Image>();

        transitionPanel.SetActive(false);
    }
Ejemplo n.º 4
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        if (!mainAudioSource)
        {
            Debug.Log("No AudioSource has been set. Set one if you wish you use audio features.");
        }
    }
Ejemplo n.º 5
0
        private void AddCarSubmit_Click(object sender, RoutedEventArgs e)
        {
            string[] Data = new string[6];
            Data[0] = VINText.GetLineText(0);
            Data[1] = ModelText.GetLineText(0);
            Data[2] = YearText.GetLineText(0);
            Data[3] = ManufacturerText.GetLineText(0);
            Data[4] = SeatsText.GetLineText(0);
            Data[5] = PriceText.GetLineText(0);
            string Type = TypeText.GetLineText(0);
            string VIN  = Data[0];

            MakeVehicle V = new MakeVehicle(Data, cn);
            MakeCar     C = new MakeCar(VIN, Type, cn);

            try
            {
                V.CreateVehicle();
            }
            catch (OleDbException ex)
            {
                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
                return;
            }

            try
            {
                C.CreateCar();
            }
            catch (OleDbException ex)
            {
                try
                {
                    V.DeleteVehicle();
                }
                catch (OleDbException ex2) { }

                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
                return;
            }

            if (used)
            {
                R = new VehicleHistoryReport(Parent, cn);
                R.ShowDialog();
            }
            this.Close();
        }
Ejemplo n.º 6
0
        private void AddCustomerSubmit_Click(object sender, RoutedEventArgs e)
        {
            string[] Data = new string[7];
            Data[0] = IDText.GetLineText(0);
            Data[1] = NameText.GetLineText(0);
            Data[2] = PhoneText.GetLineText(0);
            Data[3] = AddressText.GetLineText(0);
            Data[4] = SexText.GetLineText(0);
            Data[5] = Data[0];
            Data[6] = TypeText.GetLineText(0);

            acc.createCustomer(Data).ShowDialog();

            this.Close();
        }
Ejemplo n.º 7
0
        public override void Execute(string value)
        {
            Action act = null;

            By by = By.XPath(value);

            switch (_action)
            {
            case SelectorOptions.Action.Click: act = new Click(by); break;

            case SelectorOptions.Action.TypeText: act = new TypeText(by); break;

            default: throw new System.Exception("Invalid action chosen! " + _action);
            }
            act.Perform(Browser, value);
        }
Ejemplo n.º 8
0
        private void AddTire_Click(object sender, RoutedEventArgs e)
        {
            noError = true;
            string[] Data = new string[4];
            Data[0] = SerialNumberText.GetLineText(0);
            Data[1] = VINText.GetLineText(0);
            Data[2] = NameText.GetLineText(0);
            Data[3] = ManufacturerText.GetLineText(0);
            string SerialNumber = Data[0];
            string Type         = TypeText.GetLineText(0);
            string Size         = SizeText.GetLineText(0);

            MakePart  P = new MakePart(Data, cn);
            MakeTires T = new MakeTires(SerialNumber, Type, Size, cn);

            try
            {
                P.CreatePart();
            }
            catch (OleDbException ex)
            {
                noError = false;
                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
            }
            try
            {
                T.CreateTires();
            }
            catch (OleDbException ex)
            {
                try
                {
                    P.DeletePart();
                }
                catch (OleDbException ex2) { }

                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
                return;
            }
            if (noError)
            {
                this.Close();
            }
        }
Ejemplo n.º 9
0
        private void AddCustomerSubmit_Click(object sender, RoutedEventArgs e)
        {
            string[] Data = new string[5];
            Data[0] = IDText.GetLineText(0);
            Data[1] = NameText.GetLineText(0);
            Data[2] = PhoneText.GetLineText(0);
            Data[3] = AddressText.GetLineText(0);
            Data[4] = SexText.GetLineText(0);
            string EID  = Data[0];
            string Type = TypeText.GetLineText(0);

            MakePerson   P = new MakePerson(Data, cn);
            MakeCustomer E = new MakeCustomer(EID, Type, cn);

            try
            {
                P.CreatePerson();
            }
            catch (OleDbException ex)
            {
                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
                return;
            }

            try
            {
                E.CreateCustomer();
            }
            catch (OleDbException ex)
            {
                try
                {
                    P.DeletePerson();
                }
                catch (OleDbException ex2) { }

                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
                return;
            }

            this.Close();
        }
        public async Task<TranslationsResult[]> Translate(string textToTranslate, TypeText type = TypeText.html, string langFrom = "en", string langTo = "pl") {
            string route = $"/translate?api-version=3.0&from={langFrom}&to={langTo}&textType={type}";
            object[] body = new object[] { new { Text = textToTranslate } };
            var requestBody = JsonConvert.SerializeObject(body);

            using (var client = new HttpClient()) {
                using (var request = new HttpRequestMessage()) {
                    request.Method = HttpMethod.Post;
                    request.RequestUri = new Uri(SettingsController.Settings.EndpointTextUrl + route);
                    request.Content = new StringContent(requestBody, Encoding.UTF8, "application/json");
                    request.Headers.Add("Ocp-Apim-Subscription-Key", SettingsController.Settings.SubscriptionKey1);
                    request.Headers.Add("Ocp-Apim-Subscription-Region", SettingsController.Settings.Region);

                    HttpResponseMessage response = await client.SendAsync(request).ConfigureAwait(false);
                    string result = await response.Content.ReadAsStringAsync();
                    return JsonConvert.DeserializeObject<TranslationsResult[]>(result);
                }
            }
        }
 void Awake()
 {
     Fade  = GetComponent <FadeToBlackScript>();
     Typer = GetComponent <TypeText>();
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Print a text using the color, string format and arguments refered
 /// </summary>
 /// /// <param name="text">string to be shown in the Console</param>
 /// <param name="text">string to be shown in the Console</param>
 /// <param name="arg">parameters to be included in text </param>
 public static void Write(TypeText color, string text, bool goBackOneLine, params object[] arg)
 {
     Write(color, string.Format(text, arg), goBackOneLine);
 }
Ejemplo n.º 13
0
 private void Awake()
 {
     instance = this;
 }