Esempio n. 1
0
 public void Start()
 {
     thePlayerStats = FindObjectOfType <PlayerStats>();
     theCameras     = FindObjectOfType <CameraController>();
     thePSP         = FindObjectOfType <PlayerStartPoint>();
     thePC          = FindObjectOfType <PlayerController>();
 }
Esempio n. 2
0
 // Update is called once per frame
 void Update()
 {
     thePlayer          = FindObjectOfType <PlayerController>();
     playerHealth       = FindObjectOfType <PlayerHealthManager>();
     playerStamina      = FindObjectOfType <PlayerStaminaManager>();
     playerRangedAttack = FindObjectOfType <PlayerRangedAttack>();
     playerStatsScript  = FindObjectOfType <PlayerStats>();
     startPoint         = FindObjectOfType <PlayerStartPoint>();
     globalDataScript   = FindObjectOfType <GlobalDataScript>();
     itemSlotManager    = FindObjectOfType <ItemSlotManager>();
     curLvl             = SceneManager.GetActiveScene().name;
 }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        currentHp      = HPLevels[1];
        currentAttack  = attackLevels[1];
        currentDefense = defenseLevels[1];

        maxExp = ExpNeededToLevelUp[1];

        thePlayerHealth = FindObjectOfType <PlayerHealthManager>();
        theSFX          = FindObjectOfType <SFXManager>();
        thePSP          = FindObjectOfType <PlayerStartPoint>();
        thePC           = FindObjectOfType <PlayerController>();
    }
    void Start()
    {
        characterSelector = FindObjectOfType <CharacterSelector>(); //Needed to "properly" access the methods of the CharacterSelector script... for some reason
        playerStartPoint  = FindObjectOfType <PlayerStartPoint>();

        if (!cameraExists)
        {
            cameraExists = true;
            DontDestroyOnLoad(transform.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
    }
    // Use this for initialization
    void Start()
    {
        playerCheck = GameObject.FindGameObjectWithTag("Player");

        // check to see if player exists, if not, create it and call the startpoint function
        if (playerCheck == null)
        {
            Object newPlayer = Instantiate(player, transform.position, transform.rotation);
            newPlayer.name   = "player";
            playerStartPoint = FindObjectOfType <PlayerStartPoint>();
            //playerStartPoint.startPointFunc();        // current run by PlayerStartPoint script... uncomment if no longer the case
        }
        else
        {
            // nothing
        }
    }
Esempio n. 6
0
    private void Update()
    {
        if (ConfirmReset)
        {
            PlayerStats.Reset();
            PlayerStartPoint.Reset();
            ScoreManager.SetScore();
            SceneManager.LoadScene("Begining");
            player.GetComponent <Controls>().StartPoint              = "Begin";
            canvas.GetComponent <PlayerStats>().CurrentPlayerLevel   = 0;
            canvas.GetComponent <PlayerStats>().CurrentPlayerExp     = 0;
            player.GetComponent <PlayerHealth>().PlayerCurrentHealth = 50;
            Start();

            ConfirmReset = false;
        }
    }
Esempio n. 7
0
    void Start()
    {
        playerHealthBarManager = FindObjectOfType <PlayerHealthBarManager>(); //gets a reference to the PlayerHealthBarManager script
        playerStartPoint       = FindObjectOfType <PlayerStartPoint>();

        if (playerStartPoint != null)                                  //if there is a player start point present, change the player's starting position to its values
        {
            playerSpawnPosition = playerStartPoint.GetStartPosition(); //sets the player's spawn position to the position of the player start point game object to prevent camera drag on character spawn
        }

        if (!UIExists) //if the UI doesn't exist in the current scene, don't destroy the UI between scene swapping
        {
            UIExists = true;
            DontDestroyOnLoad(transform.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
    }
Esempio n. 8
0
 public void Back()
 {
     if (SceneManager.GetActiveScene().name == "BOSS_LEVEL")
     {
         PlayerStats.Reset();
         PlayerStartPoint.Reset();
         ScoreManager.SetScore();
         SceneManager.LoadScene("Begining");
         player.GetComponent <Controls>().StartPoint              = "Begin";
         canvas.GetComponent <PlayerStats>().CurrentPlayerLevel   = 0;
         canvas.GetComponent <PlayerStats>().CurrentPlayerExp     = 0;
         player.GetComponent <PlayerHealth>().PlayerCurrentHealth = 50;
         Start();
     }
     else
     {
         info.SetActive(false);
         topScore.SetActive(false);
         start.SetActive(false);
         main.SetActive(true);
     }
 }
Esempio n. 9
0
    // Use this for initialization
    void Start()
    {
        anim          = GetComponent <Animator>();
        myRigidBody   = GetComponent <Rigidbody2D>();
        theSFXManager = FindObjectOfType <SFXManager>();
        thePHM        = FindObjectOfType <PlayerHealthManager>();
        thePSP        = FindObjectOfType <PlayerStartPoint>();
        joystick      = FindObjectOfType <Joystick>();
        joybutton     = FindObjectOfType <JoyButton>();

        if (!playerExists)
        {
            playerExists = true;
            DontDestroyOnLoad(transform.gameObject); // Won't destroy player when switching scenes
        }
        else
        {
            Destroy(gameObject);
        }

        canMove = true;

        lastMove = new Vector2(0, -1f); // Beginning of game, player faces down
    }
 void Start()
 {
     playerStartPoint = FindObjectOfType <PlayerStartPoint>();
 }
Esempio n. 11
0
 // Use this for initialization
 void Start()
 {
     thePlayer = FindObjectOfType <PlayerController>();
     theSP     = FindObjectOfType <PlayerStartPoint>();
 }
Esempio n. 12
0
 // Use this for initialization
 void Start()
 {
     thePlayer            = Object.FindObjectOfType <PlayerMovement>();
     startPointController = Object.FindObjectOfType <PlayerStartPoint>();
     player = GameObject.FindGameObjectWithTag("Player");
 }
Esempio n. 13
0
 void Start()
 {
     spawnPoint = GetComponent <PlayerStartPoint>();
     player     = GameObject.FindGameObjectWithTag("player");
     PC         = player.GetComponent <PlayerControl>();
 }
Esempio n. 14
0
 private void GetCheckPoint()
 {
     PlayerStartPoint.SetCheckPoint(this.transform.position);
 }