// 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); } }
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; } }