public void Craft() { if (jave.logs >= 5) { Debug.Log(jave.logs); jave.logs -= 5; Debug.Log(jave.logs); Instantiate(orb, new Vector3(jave.transform.position.x, jave.transform.position.y, jave.transform.position.z), Quaternion.identity); jave.SaveResources(); } UpdateCraft(); }
void Update() { if (Input.GetMouseButton(0) && en) { Vector2 point = Camera.main.ScreenToWorldPoint(Input.mousePosition); Collider2D hit = Physics2D.OverlapPoint(point); if (hit != null && hit.gameObject == gameObject) { if (jave.neuralNetworks >= 7) { en = false; jave.currentPower = 33f; jave.inAnimation = true; jave.cameraShe = true; jave.logs = 0; jave.neuralNetworks = 0; jave.SavePower(); jave.SaveResources(); PlayerPrefs.SetInt("Completed", 1); StartCoroutine("EndS"); StartCoroutine("End2S"); StartCoroutine("End3S"); StartCoroutine("End4S"); } } } if (!en) { Camera.main.orthographicSize = Mathf.Lerp(Camera.main.orthographicSize, 2, Time.deltaTime * 2f); } if (end) { sheWheel.transform.Rotate(Vector3.forward * 4f); she.transform.position = Vector3.Slerp(she.transform.position, shePoint.transform.position, Time.deltaTime * 1f); } }