void Start() { thePlayer = FindObjectOfType <Player_Movement>(); theCamera = FindObjectOfType <Main_Camera>(); theFade = FindObjectOfType <FadeManager>(); BGM = FindObjectOfType <BGMManager>(); }
IEnumerator LoadWaitCoroutine() { yield return(new WaitForSeconds(1.0f)); thePlayer = FindObjectOfType <Player_Movement>(); bounds = FindObjectsOfType <Bound>(); theCamera = FindObjectOfType <Main_Camera>(); theFade = FindObjectOfType <FadeManager>(); theMenu = FindObjectOfType <Menu>(); cam = FindObjectOfType <Camera>(); Color color = thePlayer.GetComponent <SpriteRenderer>().color; color.a = 1f; thePlayer.GetComponent <SpriteRenderer>().color = color; theCamera.target = GameObject.Find("Player_Swordman"); theMenu.GetComponent <Canvas>().worldCamera = cam; for (int i = 0; i < bounds.Length; i++) { if (bounds[i].boundName == thePlayer.currentMapName) { bounds[i].SetBound(); break; } } theFade.FadeIn(); }
void Start() { theCamera = FindObjectOfType <Main_Camera>(); thePlayer = FindObjectOfType <Player_Movement>(); if (startPoint == thePlayer.currentMapName) { theCamera.transform.position = new Vector3(this.transform.position.x, this.transform.position.y, theCamera.transform.position.z); thePlayer.transform.position = this.transform.position; } }
private void Awake() { MC = GetComponent <Main_Camera>(); }
// Use this for initialization void Start() { bound = GetComponent <BoxCollider2D>(); theCamera = FindObjectOfType <Main_Camera>(); }