// Use this for initialization void Start() { dl = GameObject.FindGameObjectWithTag("DrawListener").GetComponent <DrawListener>(); cam = Camera.main; camController = cam.gameObject.GetComponent <CameraController>(); nextCheckForDeathPaths = checkForDeadPaths; riders.AddRange(GameObject.FindGameObjectsWithTag("Player")); postProc = cam.gameObject.GetComponent <UnityEngine.PostProcessing.PostProcessingBehaviour>(); deathProfile = (UnityEngine.PostProcessing.PostProcessingProfile)Instantiate(Resources.Load("Profiles/DeathProfile")); // Determine camera bounds upperXBound = cam.gameObject.transform.position.x + (cam.orthographicSize * Screen.width / Screen.height); lowerXBound = cam.gameObject.transform.position.x - (cam.orthographicSize * Screen.width / Screen.height); upperYBound = cam.gameObject.transform.position.y + cam.orthographicSize; lowerYBound = cam.gameObject.transform.position.y - cam.orthographicSize; }
// Use this for initialization void Start() { cd = GetComponent <BoxCollider2D>(); velocity = new Vector2(offPathSpeed, 0f); anim = gameObject.AddComponent <PathRiderAnimation>(); anim.rider = this; TrailRenderer rend = GetComponentInChildren <TrailRenderer>(); if (rend) { rend.sortingLayerName = "Character"; } dl = GameObject.FindGameObjectWithTag("DrawListener").GetComponent <DrawListener>(); lm = GameObject.FindGameObjectWithTag("GameController").GetComponent <LevelManager>(); audio = GetComponent <AudioSource>(); }
public void SetListener(DrawListener listener) { this.listener = listener; }