private void Awake() { if (Instance == null) { Instance = this; } }
protected override void EnterInteract(PlayerRaycastSystem p) { base.EnterInteract(p); if (p.interactObject == this && Input.GetKeyDown(KeyCode.UpArrow) && Vector3.Distance(p.transform.position, transform.position) < 5f) { isOpenDoor = !isOpenDoor; animator.SetBool(isOpenHash, isOpenDoor); } }
protected override void EnterInteract(PlayerRaycastSystem playerRaycast) { base.EnterInteract(playerRaycast); if (playerRaycast.interactObject == this) { if (Input.GetKeyUp(KeyCode.UpArrow) && _time > delay) { float teleportNeedUseAmount = costTeleport; _time = 0; Player p = playerRaycast.gameObject.GetComponent <Player>(); if (playerRaycast.GetComponent <PortalNeed>().Spend(teleportNeedUseAmount)) { p.SetStatus(PlayerStatus.teleport); p.SetTranstition(1f); playerRaycast.gameObject.transform.position = this.spawnPoint.position; } } } }
protected virtual void ExitInteract(PlayerRaycastSystem p) { Debug.Log("Saliento de la interacción" + gameObject); }
protected virtual void EnterInteract(PlayerRaycastSystem p) { Debug.Log("Interactuando con: " + gameObject.name); }