Esempio n. 1
0
    void Awake()
    {
        highlightBox = transform.Find("chkHighlight").gameObject;
        playerRigid  = GetComponent <Rigidbody>();
        nowRot       = transform.localRotation;
        playerCamera = GameObject.Find("Camera").GetComponent <Camera>();
        cameraAni    = playerCamera.GetComponent <Animator>();
        playerAniCon = GetComponent <AnimationController>();

        sceneName = SceneManager.GetActiveScene().name;

        if (sceneName == "ItemCollectScene")
        {
            playerSpeed = 3;
            s_itemBtn   = GameObject.Find("itemBtnCanvas/btn_GetItem").GetComponent <ItemBtn>();
            canvas      = GameObject.Find("Canvas");
            Block       = null;
        }

        else if (sceneName == "GameScene")
        {
            DontDestroyOnLoad(transform.parent);
            GM          = GameObject.Find("GameMgr2/itemFieldCntrl").GetComponent <ItemFieldCntrl>();
            sockServObj = GameObject.Find("GameMgr2/MatchingCntrl");
            playerInfo  = sockServObj.GetComponent <GameEnterScript>();
            weaponNum   = playerInfo.savCharInfo.weapon;
            spawnInfo   = sockServObj.GetComponent <SpawnScript>();

            shotMgr = GetComponentInChildren <ShotManager>();
            shotMgr.ShotPosChange(weaponNum);
            shotMgr.point = GameObject.Find("PointPrefab");
            shotMgr.point.SetActive(false);

            StartCoroutine(MoveDelay()); //플레이어의 정보 전송하는 코루틴
            hpText      = GameObject.Find("Canvas").transform.GetChild(0).GetComponent <Text>();
            playerHPBar = GameObject.Find("Canvas").transform.GetChild(3).GetComponent <HpBar>();
            Block       = GameObject.Find("Canvas").transform.GetChild(4).gameObject;


            s_itemSpawn = GameObject.Find("itemSpawnArr").GetComponent <ItemSpawn>();
            s_hitEffect = GameObject.Find("HitEffect").GetComponent <hitEffect>();
            ChinkEffect = GameObject.Find("ChinkEffect");

            ItemImg = new GameObject[4];
            ItemImg[(int)eITEM.em_HP_POTION]         = GameObject.Find("HpPotionImg").gameObject;
            ItemImg[(int)eITEM.em_SPEED_POTION]      = GameObject.Find("SpdPotionImg").gameObject;
            ItemImg[(int)eITEM.em_DAMAGE_UP_POTIOM]  = GameObject.Find("AtkPotionImg").gameObject;
            ItemImg[(int)eITEM.em_DEFENCE_UP_POTION] = GameObject.Find("DefPotionImg").gameObject;
            for (int i = 0; i < 4; i++)
            {
                ItemImg[i].SetActive(false);
            }

            sound    = GameObject.Find("GameMgr").GetComponent <BgmController>();
            effSound = gameObject.GetComponentInChildren <EffSoundController>();
        }
    }
Esempio n. 2
0
 void Start()
 {
     DontDestroyOnLoad(transform.parent);
     playerAniCon = GetComponent <AnimationController>();
     weaponType   = GetComponent <HeroCustomize>().IndexWeapon.CurrentType;
     shotMgr      = GetComponentInChildren <ShotManager>();
     shotMgr.ShotPosChange(weaponType);
     hpText       = GameObject.Find("Canvas").transform.GetChild(1).GetComponent <Text>();
     enemyHpBar   = transform.Find("Canvas").transform.GetChild(0).GetComponent <HpBar>();
     s_itemSpawn2 = GameObject.Find("itemSpawnArr").GetComponent <itemSpawn2>();
     effSound     = gameObject.GetComponentInChildren <EffSoundController>();
 }
Esempio n. 3
0
    void Awake()
    {
        highlightBox = transform.Find("chkHighlight").gameObject;
        playerRigid  = GetComponent <Rigidbody>();
        nowRot       = transform.localRotation;
        playerCamera = GameObject.Find("Camera").GetComponent <Camera>();
        cameraAni    = playerCamera.GetComponent <Animator>();
        playerAniCon = GetComponent <AnimationController>();

        sceneName = SceneManager.GetActiveScene().name;

        if (sceneName == "ItemCollectScene")
        {
            playerSpeed = 3;
            s_itemBtn   = GameObject.Find("itemBtnCanvas/btn_GetItem").GetComponent <ItemBtn>();
            canvas      = GameObject.Find("Canvas");
            block       = null;
        }

        else if (sceneName == "GameScene")
        {
            DontDestroyOnLoad(transform.parent);
            GM          = GameObject.Find("GameMgr2/itemFieldCntrl").GetComponent <ItemFieldCntrl>();
            sockServObj = GameObject.Find("GameMgr2/MatchingCntrl");
            playerInfo  = sockServObj.GetComponent <GameEnterScript>();
            weaponNum   = playerInfo.savCharInfo.weapon;
            spawnInfo   = sockServObj.GetComponent <SpawnScript>();
            usedItemEff = GameObject.Find("usedItemEff").GetComponent <Image>();
            usedItemEff.gameObject.SetActive(false);
            Info = GameObject.Find("Info");
            Info.transform.GetChild(weaponNum + 1).gameObject.SetActive(true);

            shotMgr = GetComponentInChildren <ShotManager>();
            shotMgr.ShotPosChange(weaponNum);
            shotMgr.point = GameObject.Find("PointPrefab");
            shotMgr.point.SetActive(false);

            StartCoroutine(MoveDelay()); //플레이어의 정보 전송하는 코루틴
            playerHPBar = GameObject.Find("Canvas/playerHP").GetComponent <HpBar>();
            block       = GameObject.Find("Canvas/Block").gameObject;
            block.SetActive(false);

            s_itemSpawn            = GameObject.Find("itemSpawnArr").GetComponent <ItemSpawn>();
            s_hitEffect            = GameObject.Find("HitEffect").GetComponent <hitEffect>();
            ChinkEffect            = GameObject.Find("ChinkEffect");
            usedItemParticle       = transform.Find("ItemEffect").GetComponentInChildren <ParticleSystem>();
            usedItemParticleRender = transform.Find("ItemEffect").GetComponentInChildren <ParticleSystemRenderer>();
            sound    = GameObject.Find("GameMgr").GetComponent <BgmController>();
            effSound = gameObject.GetComponentInChildren <EffSoundController>();
        }
    }
Esempio n. 4
0
 void Start()
 {
     effSound = transform.parent.GetChild(1).GetComponent <EffSoundController>();
 }
Esempio n. 5
0
    public bool getAtkMgr = false;                      // AttackMgr 한 번만 받아서 저장하기

    private void Awake()
    {
        particle = GetComponentInChildren <ParticleSystem>();
        sound    = gameObject.GetComponentInChildren <EffSoundController>();
    }
 void Start()
 {
     effSound = transform.parent.GetChild(1).GetComponent <EffSoundController>();
     effSound.PlayEff((int)eEFFSOUND.em_WIND);
 }