Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        Player     = GameObject.Find("Player");
        mainCamera = GameObject.Find("Main Camera");
        Player.GetComponent <Player>().IsDead            = true;
        mainCamera.GetComponent <CameraMovement>().Pause = true;
        anim         = Player.GetComponent <Animator>();
        audioSource  = GetComponent <AudioSource>();
        anim.enabled = false;

        easyTouch.SetActive(false);
        SpawEnemy.SetActive(false);
        spriteRenderer = Player.GetComponent <SpriteRenderer>();

        spriteRenderer.sprite = null;

        tranformPlayer = Player.GetComponent <Transform>();
        startPosition  = tranformPlayer.position;
        endPosition    = Place1.position;
        journey        = Vector3.Distance(startPosition, endPosition);

        journeyCamera = Vector3.Distance(mainCamera.transform.position, Place3.position);
        startPCamera  = mainCamera.transform.position;

        timeRun = Time.time;

        audioSource.PlayOneShot(plane);
    }
Beispiel #2
0
 private void doSomething()
 {
     easyTouch.SetActive(true);
     SpawEnemy.SetActive(true);
     Player.GetComponent <Player>().IsDead = false;
     anim.enabled = true;
     mainCamera.GetComponent <CameraMovement>().Pause = false;
     Destroy(gameObject);
 }