PlayerInfo _playerInfo;                 // 플레이어의 상태를 가져온다.

    // private float CameraAngleSpeed = 0.1f;
    // private float CameraPosY = 3f;
    //private float CameraPosSpeed = 0.02f;

    void Start()
    {
        CharactRigidbody = GetComponent <Rigidbody>();
        JoyStick         = GameObject.Find("Joystick").GetComponent <NGUIJoystick>();
        touchField       = GameObject.Find("cameraBack").GetComponent <FixedTouchField>();
        //cameraManager = GameObject.Find("CMcheaserFreeLook").GetComponent<CameraManager>();

        _playerInfo = GetComponent <PlayerInfo>();
        speed       = 5.0f;
    }
Beispiel #2
0
    //  public bool isStopMove { get; set; }    // 플레이어를 강제로 멈출 변수다.

    // private float CameraAngleSpeed = 0.1f;
    // private float CameraPosY = 3f;
    //private float CameraPosSpeed = 0.02f;

    void Start()
    {
        JoyStick   = GameObject.Find("Joystick").GetComponent <NGUIJoystick>();
        touchField = GameObject.Find("cameraBack").GetComponent <FixedTouchField>();
        rigidbody  = GetComponent <Rigidbody>();
        SoundManager.instance.playerWalkSource   = GetComponents <AudioSource>()[0]; //사운드매니저에 넣어주기 - 지민추가
        SoundManager.instance.playerEffectSource = GetComponents <AudioSource>()[1]; //사운드매니저에 넣어주기 - 지민추가
                                                                                     //cameraManager = GameObject.Find("CMcheaserFreeLook").GetComponent<CameraManager>();
                                                                                     //  isStopMove = false;
        SoundManager.instance.ChangeBGM("IngameBGM");
    }
    charactorMovingCamera _playerMove;      // 플레이어의 움직임을 결정하는 클래스

    //public
    // CheaserHitBButton hitButton;

    void Start()
    {
        animator = GetComponent <Animator>();
        JoyStick = GameObject.Find("Joystick").GetComponent <NGUIJoystick>(); // 다른클래스를 호출한다.

        _playerInfo   = GetComponent <PlayerInfo>();
        _moveSpeed    = 0;
        isInteracting = false;
        _playerRigid  = GetComponent <Rigidbody>();
        _playerMove   = GetComponent <charactorMovingCamera>();

        // hitButton = GameObject.Find("AttckButton").GetComponent<CheaserHitBButton>();
    }
Beispiel #4
0
 protected override void Init()
 {
     //聊天
     btn_liaotian          = FindInChild <Button>("btn_liaotian");
     liaotianBg            = FindInChild <UISprite>("btn_liaotian/background");
     btn_liaotian.onClick += ChatOnClick;
     mainChatContent1      = FindInChild <UILabel>("MainChat/wenzi1");
     nguiJoystick          = FindChild("MoveControl/Joystick/Button").AddComponent <NGUIJoystick>();
     joystickHighLight     = FindChild("MoveControl/Joystick/Background").GetComponent <UISprite>();
     nguiJoystick.radius   = 80;
     welMsg = FindInChild <UILabel>("msg");
     vp_Timer.In(2f, CloseMsg, 1, 1f);
     base.showTween = FindInChild <TweenPlay>();
 }
Beispiel #5
0
    void Start()
    {
        animator        = GetComponent <Animator>();
        JoyStick        = GameObject.Find("Joystick").GetComponent <NGUIJoystick>();
        hitButton       = GameObject.Find("AttckButton").GetComponent <CheaserHitBButton>();
        flashCollision  = GameObject.Find("Cheaser").GetComponent <FlashCollision>();
        cheaserCollider = this.GetComponent <CapsuleCollider>();

        // 스킬 버튼
        chSkillButton1 = GameObject.FindWithTag("CheaserSkillUiButton").GetComponent <ChSkillButton1>();
        chSkillButton2 = GameObject.FindWithTag("CheaserSkillUiButton2").GetComponent <ChSkillButton2>();
        chSkillButton3 = GameObject.FindWithTag("CheaserSkillUiButton3").GetComponent <Skill3Button>();

        // 파티클 제어
        paticleSkill1.Stop();
        paticleSkill2.Stop();
        paticleSkill3.Stop();

        // 쉐이더 변경
        cheaserMesh = this.GetComponentInChildren <SkinnedMeshRenderer>();
    }
Beispiel #6
0
    void Awake()
    {
        chSkillButton1 = GameObject.FindWithTag("CheaserSkillUiButton");
        chSkillButton2 = GameObject.FindWithTag("CheaserSkillUiButton2").GetComponent <ChSkillButton2>();
        chSkillButton3 = GameObject.FindWithTag("CheaserSkillUiButton3").GetComponent <Skill3Button>();

        joyStick = GameObject.Find("Joystick").GetComponent <NGUIJoystick>();

        characterSpeed      = GameObject.Find("Cheaser").GetComponent <CheaserMoveCamera>();
        playerOutLine       = GameObject.FindGameObjectWithTag("Player").GetComponent <Outline>();
        cheaserAttackButton = GameObject.FindWithTag("CheaserAttackButton").GetComponent <CheaserHitBButton>();
        potalCollider       = GameObject.FindWithTag("PotalCollision").GetComponent <PotalCollider>();

        cheaserAni = this.GetComponent <CheaserAnimationPoton>();
        cheaserRay = new Ray();

        crow2Navi     = GameObject.FindWithTag("Crow2").GetComponent <CrowNavi>();
        attackUiLabel = GameObject.FindWithTag("CheaserAttackButton").GetComponentInChildren <UILabel>();

        animator = GetComponent <Animator>();
    }
Beispiel #7
0
 void OnDestroy()
 {
     mInstance = null;
 }
Beispiel #8
0
 void Awake()
 {
     ResetJoystick();
     mInstance = this;
     //background.gameObject.SetActive(false);
 }
Beispiel #9
0
        protected override void Init()
        {
            //这里是 竞技场 View
            ArenaFightView.Instance.gameObject = FindChild("ArenaFightView");
            ArenaFightView.Instance.gameObject.SetActive(false);

            _topLeftGameObject          = Tools.find(gameObject, "TopLeft");
            _topRightGameObject         = Tools.find(gameObject, "TopRight");
            _topGameObject              = Tools.find(gameObject, "Top");
            _sldBossHp                  = Tools.find(gameObject, "TopRight/SldBossHp").GetComponent <UIBloodBar>();
            _sldBossHp.fillDirection    = UIBloodBar.FillDirection.RightToLeft;
            _sldMonsterHp               = Tools.find(gameObject, "TopRight/SldMonsterHp").GetComponent <UIBloodBar>();
            _sldMonsterHp.fillDirection = UIBloodBar.FillDirection.RightToLeft;
            _playerLevelLabel           = Tools.find(gameObject, "TopLeft/PlayerInfo/PlayerLevelLabel").GetComponent <UILabel>();
            _playerNameLabel            = Tools.find(gameObject, "TopLeft/PlayerInfo/PlayerNameLabel").GetComponent <UILabel>();
            _playerHeadSprite           = Tools.find(gameObject, "TopLeft/PlayerInfo/PlayerHeadIcon").GetComponent <UISprite>();
            _sldHp      = Tools.find(gameObject, "TopLeft/SldHp").GetComponent <UISlider>();
            _sldMagic   = Tools.find(gameObject, "TopLeft/SldMagic").GetComponent <UISlider>();
            _btnStop    = Tools.find(gameObject, "TopLeft/BtnStop").GetComponent <Button>();
            _entrustBtn = Tools.find(gameObject, "TopLeft/BtnEntrust").GetComponent <Button>();
            _arrowLeft  = Tools.find(gameObject, "Left").GetComponent <UISprite>();
            _arrowRight = Tools.find(gameObject, "Right").GetComponent <UISprite>();
            _leftNum    = Tools.find(gameObject, "Left/num").GetComponent <UILabel>();
            _rightNum   = Tools.find(gameObject, "Right/num").GetComponent <UILabel>();

            _btnSkill0   = Tools.find(gameObject, "BottomRight/BtnSkill0").GetComponent <Button>();
            _btnSkill1   = Tools.find(gameObject, "BottomRight/BtnSkill1").GetComponent <Button>();
            _btnSkill2   = Tools.find(gameObject, "BottomRight/BtnSkill2").GetComponent <Button>();
            _btnSkill3   = Tools.find(gameObject, "BottomRight/BtnSkill3").GetComponent <Button>();
            _btnSkill4   = Tools.find(gameObject, "BottomRight/BtnSkill4").GetComponent <Button>();
            _btnAttack   = Tools.find(gameObject, "BottomRight/BtnAttack").GetComponent <Button>();
            _btnChat     = Tools.find(gameObject, "BottomLeft/BtnChat").GetComponent <Button>();
            BtnChatBg    = Tools.find(gameObject, "BottomLeft/BtnChat/background").GetComponent <UISprite>();
            _healthLabel = Tools.find(gameObject, "TopLeft/SldHp/Label").GetComponent <UILabel>();
            _magicLabel  = Tools.find(gameObject, "TopLeft/SldMagic/Label").GetComponent <UILabel>();

            _skill0Cd = Tools.find(gameObject, "BottomRight/BtnSkill0/CD");
            _skill1Cd = Tools.find(gameObject, "BottomRight/BtnSkill1/CD");
            _skill2Cd = Tools.find(gameObject, "BottomRight/BtnSkill2/CD");
            _skill3Cd = Tools.find(gameObject, "BottomRight/BtnSkill3/CD");
            _skill4Cd = Tools.find(gameObject, "BottomRight/BtnSkill4/CD");

            _skill0CdTimeLabel = Tools.find(gameObject, "BottomRight/BtnSkill0/Number").GetComponent <UILabel>();
            _skill1CdTimeLabel = Tools.find(gameObject, "BottomRight/BtnSkill1/Number").GetComponent <UILabel>();
            _skill2CdTimeLabel = Tools.find(gameObject, "BottomRight/BtnSkill2/Number").GetComponent <UILabel>();
            _skill3CdTimeLabel = Tools.find(gameObject, "BottomRight/BtnSkill3/Number").GetComponent <UILabel>();
            _skill4CdTimeLabel = Tools.find(gameObject, "BottomRight/BtnSkill4/Number").GetComponent <UILabel>();

            _skill0Icon       = Tools.find(gameObject, "BottomRight/BtnSkill0/Icon").GetComponent <UISprite>();
            _skill1Icon       = Tools.find(gameObject, "BottomRight/BtnSkill1/Icon").GetComponent <UISprite>();
            _skill2Icon       = Tools.find(gameObject, "BottomRight/BtnSkill2/Icon").GetComponent <UISprite>();
            _skill3Icon       = Tools.find(gameObject, "BottomRight/BtnSkill3/Icon").GetComponent <UISprite>();
            _skill4Icon       = Tools.find(gameObject, "BottomRight/BtnSkill4/Icon").GetComponent <UISprite>();
            _normalAttackIcon = Tools.find(gameObject, "BottomRight/BtnAttack/Icon").GetComponent <UISprite>();

            _leftTimeLabel = Tools.find(gameObject, "Top/LeftTime/LeftTimeLabel").GetComponent <UILabel>(); //剩余时间

            _time                          = Tools.find(gameObject, "Top/LeftTime").GetComponent <Transform>();
            _nguiJoystick                  = Tools.find(gameObject, "BottomLeft/Joystick/Button").AddComponent <NGUIJoystick>();
            _nguiJoystick.radius           = 80;
            _nguiJoystick.IsBattleJoystick = true;
            _joystickHighLight             = Tools.find(gameObject, "BottomLeft/Joystick/Background").GetComponent <UISprite>();
            _btnChat.onClick              += OnChatBtnClick;
            _btnSkill0.onClick            += CallSkill0;
            _btnSkill1.onClick            += CallSkill1;
            _btnSkill2.onClick            += CallSkill2;
            _btnSkill3.onClick            += CallSkill3;
            _btnSkill4.onClick            += CallSkill4;
            _entrustBtn.onClick           += CallEntrust;
            _btnAttack.onPress            += CallAttack;
            _btnStop.onClick              += StopGame;
            UpdateInfo();
            InitPlayerInfo();
            _sldMonsterHp.gameObject.SetActive(false);
            InitSkillIcon();
            _skillCdGameObjects = new[] { _skill1Cd, _skill2Cd, _skill3Cd, _skill4Cd, _skill0Cd };
            _skillButtons       = new[] { _btnSkill1, _btnSkill2, _btnSkill3, _btnSkill4, _btnSkill0 };
            _battleMode         = Singleton <BattleMode> .Instance;
            _skillCdTimeLabels  = new[]
            { _skill1CdTimeLabel, _skill2CdTimeLabel, _skill3CdTimeLabel, _skill4CdTimeLabel, _skill0CdTimeLabel };
            if (Application.platform != RuntimePlatform.WindowsEditor)
            {
                _btnChat.SetActive(false);
            }
            _guideJoy   = Tools.find(gameObject, "BottomLeft/GuideJoy");
            _guideSkill = Tools.find(gameObject, "BottomRight/GuideSkill");
        }