// Start is called before the first frame update void Awake() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <moveplayer>(); time = 0.2f; once = false; //if (player.startPoint == pointName) //{ // Debug.Log("great!"); // player.transform.position = transform.position; // //camera = FindObjectOfType<CameraFollow>(); // //camera.transform.position = new Vector3(transform.position.x, transform.position.y, camera.transform.position.z); //} }
// Start is called before the first frame update void Start() { gm = FindObjectOfType <GameManager>(); target = GameObject.FindGameObjectWithTag("Player").transform; //if (!cameraExists) //{ // cameraExists = true; // DontDestroyOnLoad(transform.gameObject); //} //else //{ // Destroy(gameObject); //} move = target.GetComponent <moveplayer>(); }
// Update is called once per frame void Update() { if (SceneManager.GetActiveScene().buildIndex != 2 && SceneManager.GetActiveScene().buildIndex != 9) { player = GameObject.FindGameObjectWithTag("Player").GetComponent <moveplayer>(); } //check for animation level if (SceneManager.GetActiveScene().buildIndex == 2) { //falling animation level StartCoroutine(AnimationLevel(14)); } if (SceneManager.GetActiveScene().buildIndex == 9) { StartCoroutine(AnimationLevel(5)); } }
void Start() { engine = GetComponent <moveplayer>(); }
// Start is called before the first frame update void Start() { player = FindObjectOfType <moveplayer>(); }
// Start is called before the first frame update void Start() { player = GameObject.FindGameObjectWithTag("Player"); direction = player.GetComponent <moveplayer>(); sprite = GetComponent <SpriteRenderer>(); }