//----------------------------------------------- private void Awake() { if (instance) { // 씬에 존재하면 소멸시킨다. DestroyImmediate(gameObject); return; } instance = this; DontDestroyOnLoad(gameObject); }
void Start() { coolTimeObject = transform.Find("CoolTimeActive").gameObject; if (coolTimeObject) { coolImage = coolTimeObject.transform.Find("CoolImage").gameObject.GetComponent <Image>(); coolText = coolTimeObject.transform.Find("CoolText").gameObject.GetComponent <Text>(); } // 할당 후, Active 해제. coolTimeObject.SetActive(false); summonMgr = SummonMgr.instance; }
protected void setting() { myRigidbody = GetComponent <Rigidbody2D>(); spriteRenderer = GetComponent <SpriteRenderer>(); animator = GetComponent <Animator>(); if (isPlayerSummon) { spriteRenderer.flipX = true; } else { spriteRenderer.flipX = false; } AnimationSetting(MonsterState.RUN); monsterCurHp = monsterMaxHP; summonMgr = SummonMgr.instance; }