Example #1
0
    void Start()
    {
        player   = GameObject.FindGameObjectWithTag("Player");
        movement = player.GetComponent <NewMovement>();

        levelInt = player.GetComponent <LevelInteractions>();
    }
 void Start()
 {
     anim              = this.GetComponent <Animator> ();
     movement          = this.GetComponent <NewMovement> ();
     death_Is_Upon_You = false;
     max_Health        = 100f;
     cur_Health        = max_Health;
 }
Example #3
0
 void Start()
 {
     timer    = GameObject.FindGameObjectWithTag("TimerHandler");
     timers   = timer.GetComponent <Timers>();
     movement = this.GetComponent <NewMovement>();
     raycast  = this.GetComponent <RaycastCollission>();
     _anim.GetComponent <Animator>();
 }
Example #4
0
    public static void SavePlayer(NewMovement player)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/player.AR";
        FileStream      stream    = new FileStream(path, FileMode.Create);

        PlayerData data = new PlayerData(player);

        formatter.Serialize(stream, data);
        stream.Close();
    }
Example #5
0
    public PlayerData(NewMovement player)
    {
        level = SceneManager.GetActiveScene().buildIndex;
        Debug.Log(level);
        health = player.currentHealth;
        Debug.Log(health);

        position    = new float[3];
        position[0] = player.transform.position.x;
        position[1] = player.transform.position.y;
        position[2] = player.transform.position.z;
        Debug.Log(position);
    }
Example #6
0
    void OnCollisionEnter(Collision collision)
    {
        NewMovement mms = collision.collider.gameObject.GetComponentInParent <NewMovement>();

        if (mms)
        {
            Control.UI.SetActive(false);
            Control.Loss.SetActive(true);
            Destroy(collision.gameObject.GetComponentInChildren <NewCameraScript>());
            Destroy(collision.gameObject.GetComponent <PlayerInput>());
            Destroy(collision.gameObject.GetComponentInParent <NewMovement>());

            Debug.Log("Dead!!");
        }
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("Player"))
        {
            if (!dead)
            {
                player    = collision.gameObject.GetComponent <NewMovement>();
                dead      = true;
                deathAnim = true;

                audioManager.Play("Death");
                //collision.gameObject.GetComponent<NewMovement>().Die(respawnPosition.position);
            }
        }
    }
Example #8
0
 private void Awake()
 {
     instance = this;
 }
Example #9
0
 private void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player").GetComponent <NewMovement>();
 }
Example #10
0
 private void Start()
 {
     movementComponent = GetComponent <NewMovement>();
     spriteComponent   = GetComponentInChildren <ChangeSpriteColor>();
     animatorComponent = GetComponentInChildren <Animator>();
 }