public IEnumerator leftAnimateAndCrate(ieStruct paket) { crafting = true; GetComponent <Animator>().SetTrigger("Work"); Counter = paket.time; craftingGO = paket.Output; craftingCount = paket.quant; /*ButtonGO.GetComponent<BasicButton>().close = true; * Color buttonColor = ButtonGO.GetComponent<Image>().color; * buttonColor.a = 0.3f; * ButtonGO.GetComponent<Image>().color = buttonColor;*/ yield return(new WaitForSeconds(paket.time)); /*buttonColor.a = 1; * ButtonGO.GetComponent<Image>().color = buttonColor; * craftingGO = null; * ButtonGO.GetComponent<BasicButton>().close = false;*/ crafting = false; GetComponent <Animator>().SetTrigger("Stop"); GetComponent <Station>().TransactionIE(gameObject, paket.Output, paket.quant); if (paket.Output.GetComponent <Meal>()) { paket.Output.GetComponent <Meal>().createdTime = Order.zaman; } }
IEnumerator animateAndCreate(ieStruct Paket) { int Count = int.Parse(GameObject.FindGameObjectWithTag("CountGO").transform.GetChild(1).GetComponent <Text>().text); int unitTimeTimesCount = 0; GameObject Output = Paket.Output; creatingOutput = Paket.Output; int quantaty = Paket.quant; if (Output.GetComponent <MealMaterial>()) { unitTimeTimesCount = Mathf.FloorToInt(Output.GetComponent <MealMaterial>().unitTime *Count); } else { unitTimeTimesCount = Mathf.FloorToInt(Output.GetComponent <Meal>().unitTime *Count); } crafting = true; GetComponent <Animator>().SetTrigger("Work"); GetComponent <Station>().Counter = unitTimeTimesCount; craftingGO = Output; craftingCount = Count; /*ButtonGO.GetComponent<BasicButton>().close = true; * Color buttonColor = ButtonGO.GetComponent<Image>().color; * buttonColor.a = 0.3f; * ButtonGO.GetComponent<Image>().color = buttonColor;*/ yield return(new WaitForSeconds(unitTimeTimesCount)); /*buttonColor.a = 1; * ButtonGO.GetComponent<Image>().color = buttonColor; * craftingGO = null; * ButtonGO.GetComponent<BasicButton>().close = false;*/ crafting = false; GetComponent <Animator>().SetTrigger("Stop"); GetComponent <Station>().TransactionIE(gameObject, Output, quantaty); if (Paket.Output.GetComponent <Meal>()) { Paket.Output.GetComponent <Meal>().createdTime = Order.zaman; } }
public void Create(ieStruct paket) { StartCoroutine("leftAnimateAndCrate", paket); Debug.Log("created"); }