public override void InitiatePickup() { PlayerVariables.HeldKey = addedKey; string KeyText = PlayerVariables.GetKeyName(addedKey); if (attachedLight) { StartCoroutine(FadeLight()); } StartCoroutine(PlayerVariables.ShowText(KeyText + " key acquired!", 5f - 2 * PlayerVariables.UITextAnimation.length)); }
// Start is called before the first frame update void Start() { playerScripts = GameObject.FindGameObjectWithTag("Player").GetComponents <MonoBehaviour>(); foreach (MonoBehaviour mono in playerScripts) { if (mono.GetType() == typeof(DashScript)) { if (canDash == false) { mono.enabled = false; } } else if (mono.GetType() == typeof(SlideScript)) { if (canSlide == false) { mono.enabled = false; } } else if (mono.GetType() == typeof(WallrunningScript)) { if (canWallrun == false) { mono.enabled = false; } } else if (mono.GetType() == typeof(WallclimbingScript)) { if (canClimb == false) { mono.enabled = false; } } else if (mono.GetType() == typeof(JumpScript)) { if (canJump == false) { mono.enabled = false; } } } UITextAnimator = UIText.GetComponent <Animator>(); textComp = UIText.GetComponent <TextMeshProUGUI>(); //StartCoroutine(TutorialText()); StartCoroutine(PlayerVariables.ShowText(InitialTut, hideTextAfter)); }
public override void InitiatePickup() { if (Wallclimb) { GameObject.FindGameObjectWithTag("Player").GetComponent <WallclimbingScript>().enabled = true; } else if (Slide) { GameObject.FindGameObjectWithTag("Player").GetComponent <SlideScript>().enabled = true; } else if (Dash) { GameObject.FindGameObjectWithTag("Player").GetComponent <DashScript>().enabled = true; } else if (Wallrun) { GameObject.FindGameObjectWithTag("Player").GetComponent <WallrunningScript>().enabled = true; } else if (Jump) { GameObject.FindGameObjectWithTag("Player").GetComponent <JumpScript>().enabled = true; } // Rotating the whole gameobject to face the player gameObject.transform.rotation = Quaternion.LookRotation(-GameObject.FindGameObjectWithTag("Player").transform.right); SimpleRotateFloatScript SRS = GetComponentInChildren <SimpleRotateFloatScript>(); if (SRS) { SRS.enabled = false; } PickupName.enabled = false; StartCoroutine(PlayerVariables.ShowText(Desc, destroyDelay - 2 * PlayerVariables.UITextAnimation.length));; if (attachedLight) { StartCoroutine(FadeLight()); } }
public override void Interact() { if (activated) { return; } if ((int)PlayerVariables.HeldKey == (int)requiredKey) { base.Interact(); doorScript.Open(); StartCoroutine(PlayerVariables.ShowText("Door unlocked", 5f)); } else { string requiredKeyText = PlayerVariables.GetKeyName(requiredKey); StartCoroutine(PlayerVariables.ShowText(requiredKeyText + " key required", 5f)); } }