예제 #1
0
    void Awake()
    {
        Player_rb2d      = GetComponent <Rigidbody2D>();
        Player_xyz       = GetComponent <Transform>();
        Player_sprite    = GetComponent <SpriteRenderer>();
        Player_animation = GetComponent <Animator>();
        if (GameObject.FindGameObjectWithTag("InvulnerableSprite") != null)
        {
            InvulnerableCooldown_Sprite = GameObject.FindGameObjectWithTag("InvulnerableSprite").GetComponent <Image>();
        }

        groundCheck1_transform = transform.Find("groundCheck_1");
        groundCheck2_transform = transform.Find("groundCheck_2");

        if (checkpointedLevel)
        {
            isCheck = GameObject.FindGameObjectWithTag("Undying").GetComponent <IsCheckpoint>();
            if (isCheck.checkpoint == true)
            {
                Player_xyz.position = new Vector3(isCheck.pointX, isCheck.pointY, 0f);
            }
        }
    }
예제 #2
0
 // Start is called before the first frame update
 void Start()
 {
     isCheck = GameObject.FindGameObjectWithTag("Undying").GetComponent <IsCheckpoint>();
     sprite  = GetComponent <SpriteRenderer>();
     player  = GameObject.Find("player").GetComponent <Player>();
 }