Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
    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();
        }
    }
Exemplo n.º 3
0
    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);
    }