void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { entered = true; hintUIController.toggleHint(transform.position.x, transform.position.y + 3); } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { entered = true; Vector3 hintPos = transform.position + ladderCentre; hintUIController.toggleHint(hintPos.x, hintPos.y); } }
void Awake() { hintUIController = GameObject.Find("HintCanvas").GetComponent <ToggleHintUI>(); hintUIController.toggleHint(); entered = false; }
// Use this for initialization void Awake() { hintUIController = GameObject.Find("HintCanvas").GetComponent <ToggleHintUI>(); hintUIController.toggleHint(); showing = false; dialogBox = GetComponentInChildren <Canvas>(); origPos = dialogBox.transform.position; hintUIController.toggleDialog(dialogBox); }
void Awake() { hintUIController = GameObject.Find("HintCanvas").GetComponent <ToggleHintUI>(); hintUIController.toggleHint(); ladderTag = gameObject.tag; ladderCentre = new Vector3(transform.localScale.x / 2, 3); GameObject player = GameObject.FindGameObjectWithTag("Player"); playerPosition = player.transform; entered = false; }
// Update is called once per frame void Update() { if (Input.GetButtonUp("Interact") && entered && !pickedup) { pickedup = true; hintUIController.toggleHint(); GameManager.instance.playersTurn = false; // let the player know he/she got a skill GameManager.instance.displayNotification("You got a skill scroll!"); Invoke("ActivateSkill", 0.8f); // we can go to next level now GameManager.instance.SubLevelComplete = true; //TODO: update repository gameObject.SetActive(false); GameManager.instance.playersTurn = true; } }