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; }
void Start() { timer = GameObject.FindGameObjectWithTag("TimerHandler"); timers = timer.GetComponent <Timers>(); movement = this.GetComponent <NewMovement>(); raycast = this.GetComponent <RaycastCollission>(); _anim.GetComponent <Animator>(); }
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(); }
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); }
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); } } }
private void Awake() { instance = this; }
private void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <NewMovement>(); }
private void Start() { movementComponent = GetComponent <NewMovement>(); spriteComponent = GetComponentInChildren <ChangeSpriteColor>(); animatorComponent = GetComponentInChildren <Animator>(); }