Пример #1
0
    // 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);
        //}
    }
Пример #2
0
    // 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>();
    }
Пример #3
0
    // 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));
        }
    }
Пример #4
0
 void Start()
 {
     engine = GetComponent <moveplayer>();
 }
Пример #5
0
 // Start is called before the first frame update
 void Start()
 {
     player = FindObjectOfType <moveplayer>();
 }
Пример #6
0
 // Start is called before the first frame update
 void Start()
 {
     player    = GameObject.FindGameObjectWithTag("Player");
     direction = player.GetComponent <moveplayer>();
     sprite    = GetComponent <SpriteRenderer>();
 }