// Use this for initialization void Awake() { manager = GameObject.Find("GameManager").GetComponent <GameManager>(); cardPickup = manager.pickCard; fill = GameObject.Find("HandManager").GetComponent <FillHand>(); golds = GameObject.Find("GoldManager").GetComponent <GoldScript>(); }
// Use this for initialization void Awake() { manager = GameObject.Find("GameManager").GetComponent <GameManager>(); mainCamera = GameObject.Find("Main Camera"); secondaryCamera = GameObject.Find("Secondary Camera"); secondaryCamera.SetActive(false); fill = GameObject.Find("HandManager").GetComponent <FillHand>(); attack = GameObject.Find("GameBoard").GetComponent <AttackScript>(); golds = GameObject.Find("GoldManager").GetComponent <GoldScript>(); }
// Update is called once per frame void Update() { if (Input.GetMouseButton(0)) { punch.Play(); } Vector3 mousePos = Input.mousePosition; mousePos.z = 10; Vector3 screenPos = Camera.main.ScreenToWorldPoint(mousePos); RaycastHit2D hit = Physics2D.Raycast(screenPos, Vector2.zero); if (Input.GetMouseButtonDown(0)) { if (hit) { if (hit.collider.tag == "Mine") { MineLogic mineScript = hit.collider.gameObject.GetComponent <MineLogic>(); mineScript.ToggleCanvas(); } else if (hit.collider.tag == "Gold") { GoldScript goldScript = hit.collider.gameObject.GetComponent <GoldScript>(); goldScript.ToggleCanvas(); } else if (hit.collider.tag == "Wall") { WallLogic wallScript = hit.collider.gameObject.GetComponent <WallLogic>(); wallScript.ToggleCanvas(); } } } }
void Awake() { instance = this; }