private void CreatePlatform() { if (PlayerResourcesManager.IsThereEnoughResource(2, 0) && isTimeStopped) { Vector3 spawnPosition = gameObject.transform.position - new Vector3(0, 1.4f, 0) + transform.forward * playerPhysicsModule.speedLimit / 4f; if (!IsMoving()) { spawnPosition = gameObject.transform.position - new Vector3(0, 1f, 0); } PlayerResourcesManager.JumpsLeft -= 1; Instantiate(Resources.Load("Prefabs/SourcePlatform") as GameObject, spawnPosition, Quaternion.identity); } }
public override void ModuleUpdate() { GatherSource(); if (Input.GetKeyDown(KeyCode.F) && PlayerResourcesManager.IsThereEnoughResource(3, 0) && IsMoving()) { StartCoroutine(Dash()); } if (Input.GetKeyDown(KeyCode.Space) && !playerPhysicsModule.onGround) { CreatePlatform(); } if (Input.GetKeyDown(KeyCode.R)) { SwitchArrowHead(); } }
public bool CheckIfCurrentArrowIsAvailable(string currentArrowheadName) { bool arrowAvailable = false; switch (currentArrowheadName) { case "DefaultArrow": arrowAvailable = PlayerResourcesManager.IsThereEnoughResource(4, 0); break; case "TimeZoneArrow": arrowAvailable = PlayerResourcesManager.IsThereEnoughResource(1, 0); break; case "CloudArrow": arrowAvailable = PlayerResourcesManager.IsThereEnoughResource(5, 0); break; } return(arrowAvailable); }