상속: MonoBehaviour
예제 #1
0
    // Update is called once per frame
    void Update()

    {
        sceneID = SceneManager.GetActiveScene().buildIndex;

        Debug.Log("Scene id is " + sceneID);

        if (sceneID > 0)
        {
            ReSkinAnimation player = GameObject.Find("/Player").GetComponent <ReSkinAnimation>();

            player.indexia = currentSkinIndex;

            Debug.Log(player);
        }
    }
예제 #2
0
    void Awake()
    {
        defaultHp = hp;

        if (isParent)
        {
            sr              = GetComponent <SpriteRenderer> ();
            anim            = GetComponent <Animator> ();
            resKin          = GetComponent <ReSkinAnimation>();
            defaultPosition = transform.position;
        }
        else
        {
            sr              = GetComponentInParent <SpriteRenderer> ();
            anim            = GetComponentInParent <Animator> ();
            resKin          = GetComponentInParent <ReSkinAnimation>();
            defaultPosition = transform.parent.gameObject.transform.position;
        }
    }