Exemplo n.º 1
0
 public void setState(int aState)
 {
     this._state = aState;
     if (this._state == 0)
     {
         this.ResetAllPalyer();
         this._roundNumber++;
     }
     else if (this._state == 1)
     {
         this._messageText.text = string.Empty;
     }
     else if (this._state == 2)
     {
         this._roundWinner = null;
         this._roundWinner = this.GetRoundWinner();
         if (this._roundWinner != null)
         {
             this._roundWinner.setWin(this._roundWinner.getWin() + 1);
         }
         this._gameWinner = this.GetGameWinner();
         string text = this.EndMessage();
         this._messageText.text = text;
     }
 }
Exemplo n.º 2
0
 void Awake()
 {
     _col           = GetComponent <CapsuleCollider>();
     _stat          = GetComponent <CSoldierStat>();
     _anim          = GetComponent <CSoldierAnimation>();
     _playerManager = GameObject.Find("Manager").GetComponent <CPlayerManager>();
 }
Exemplo n.º 3
0
    public void SetTarget(CPlayerManager target)
    {
        if (target == null)//targetがいなければエラーをConsoleに表示
        {
            Debug.LogError("<Color=Red><a>Missing</a></Color> PlayMakerManager target for PlayerUI.SetTarget.", this);
            return;
        }
        //targetの情報をこのスクリプト内で使うのでコピー
        _target          = target;
        _targetTransform = _target.GetComponent <Transform>();

        //CharacterController取得
        //CharacterController _characterController = _target.GetComponent<CharacterController>();

        //PlayerManagerの頭上UIに表示したいデータをコピー
        //if (_characterController != null)
        //{
        //    _characterControllerHeight = _characterController.height;
        //}

        if (PlayerNameText != null)
        {
            PlayerNameText.text = _target.photonView.Owner.NickName;    //プレイヤー名
        }
        //if (PlayerHPSlider != null)
        //{
        //    PlayerHPSlider.value = _target.HP;                          //HP
        //}
        //if (ChatText != null)
        //{
        //    ChatText.text = _target.ChatText;                           //頭上チャットText
        //}
    }
Exemplo n.º 4
0
    private void Awake()
    {
        _pTarget      = GameObject.Find("CameraLookAtPostion").GetComponent <Transform>();
        _pBossMonster = GameObject.FindGameObjectWithTag("Boss").GetComponent <Transform>();

        player  = GameObject.FindWithTag("Player").GetComponent <CPlayerManager>();
        _CamMgr = GetComponent <CCameraMgr>();
    }
Exemplo n.º 5
0
    //1////////////////////////////////

    void Awake()
    {
        _tileManager   = GetComponent <CTileManager>();
        _playerManager = GetComponent <CPlayerManager>();
        _enemyManager  = GetComponent <CEnemyManager>();

        stage = 1;
        Debug.Log(SceneManager.sceneCount);
    }
 private void Awake()
 {
     if (_inst != null && _inst != this)
     {
         Destroy(gameObject);
         return;
     }
     DontDestroyOnLoad(this.gameObject);
     _inst = this;
 }
Exemplo n.º 7
0
    //----------------------------------------------------------------------
    // コンストラクタ
    //----------------------------------------------------------------------
    // @Param	none
    // @Return	none
    // @Date	2014/10/31  @Update 2014/10/31  @Author T.Kawashita
    //----------------------------------------------------------------------
    void Awake()
    {
        m_soccerBallManager = GameObject.Find("BallGameObject").GetComponent <CSoccerBallManager>();
        CPlayerManager.SetData();

        m_player1Script = GameObject.Find("P1&P2").transform.FindChild("Player1").transform.FindChild("player").GetComponent <CPlayer1> ();
        m_player2Script = GameObject.Find("P1&P2").transform.FindChild("Player2").transform.FindChild("player").GetComponent <CPlayer2> ();
        m_player3Script = GameObject.Find("P3&P4").transform.FindChild("Player3").transform.FindChild("player").GetComponent <CPlayer3> ();
        m_player4Script = GameObject.Find("P3&P4").transform.FindChild("Player4").transform.FindChild("player").GetComponent <CPlayer4> ();
    }
Exemplo n.º 8
0
 protected override void Awake()
 {
     base.Awake();
     _stateSystem       = GetComponent <WitchStateSystem>();
     _stateSystem.Witch = this;
     _skillSystem       = GetComponent <WitchSkillSystem>();
     _skillSystem.Witch = this;
     _curState          = WitchState.Groggy;
     _player            = FindObjectOfType <CPlayerManager>();
     _receiveDamage     = 0.0f;
     _collider          = FindObjectOfType <WitchWeaponCollider>();
     //_footHoldSpawnTime = WitchValueManager.I.FootholdContinueTime;
     _spawner   = FindObjectOfType <WitchMonsterSpawnerObject>();
     _isGravity = true;
 }
Exemplo n.º 9
0
 private void Awake()
 {
     transform.position    = new Vector3(-188.47f, 0.7f, 3.41f);
     transform.eulerAngles = new Vector3(0.0f, 80.0f, 0.0f);
     _instance             = this;
     _rigid             = GetComponent <Rigidbody>();
     _anim              = GetComponent <Animator>();
     _CameraTr          = GameObject.FindWithTag("MainCamera").transform;
     _stat.CurHP        = _stat.MaxHP;
     _stat.CurDashGauge = _stat.MaxDashGauge;
     PlayerStateVal();
     layerMask = (1 << 16);
     HitObj.SetActive(false);
     Cursor.visible = true; // 지우의 요청으로 커서 보이게함.
     UltMeshFalse();
 }
Exemplo n.º 10
0
    private void Awake()
    {
        _instance          = this;
        _anim              = GetComponentInChildren <Animator>();
        _stat.CurHP        = _stat.MaxHP;
        _rigid             = GetComponentInParent <Rigidbody>();
        _pathfinding       = GameObject.Find("AStar").GetComponent <Pathfinding>();
        _PlayerMgr         = GameObject.FindGameObjectWithTag("Player").GetComponent <CPlayerManager>();
        pPlayerTransform   = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>();
        grid               = GameObject.Find("AStar").GetComponent <Grid>();
        _stat.CurMoveSpeed = _stat.MaxMoveSpeed;
        RespawnPoint       = GameObject.FindGameObjectsWithTag("RespawnPoint");
        Ready_BossState();
        pCameraShake = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <CCameraShake>();

        DeadDelay = 4.5f;
    }
    protected const float TAKE_BALL_SPACE = 10.0f;                              // AIがボールを取りに行く距離

    //----------------------------------------------------------------------
    // コンストラクタ
    //----------------------------------------------------------------------
    // @Param   none
    // @Return  none
    // @Date    2014/12/7  @Update 2014/12/7  @Author T.Takeuchi
    //----------------------------------------------------------------------
    protected void CGoalKeeperInit(int teamNo)
    {
        this.Init();

        // プレイヤーのデータをセット
        if (teamNo == 0)
        {
            CPlayerManager.SetPlayerData(this.m_playerData, CPlayerManager.AI_2);
        }
        else
        {
            CPlayerManager.SetPlayerData(this.m_playerData, CPlayerManager.AI_4);
        }
        m_pos = this.transform.localPosition;

        // 国の情報をセット / 国によってマテリアルを変更
        m_human = CHumanManager.GetWorldInstance(TeamData.teamNationality[teamNo]);
        if (teamNo == 0)
        {
            this.transform.FindChild("polySurface14").GetComponent <CGoalKeeper1Mesh>().ChangeMaterial(TeamData.teamNationality[0]);
        }
        else
        {
            this.transform.FindChild("polySurface14").GetComponent <CGoalKeeper2Mesh>().ChangeMaterial(TeamData.teamNationality[1]);
        }
        // CPU用の値をセット
        this.SetData();

        // サッカーボールの情報を取得
        this.soccerBallObject = GameObject.Find("SoccerBall");

        // プレイヤーのアニメーターをセット
        m_animator = this.gameObject.transform.parent.GetComponent <CPlayerAnimator>();

        // 向きをセット
        this.transform.LookAt(new Vector3(0.0f, 0.0f, 0.0f));

        // ホームポジションをセット
        this.HOME_POSITION = new Vector3(this.m_playerData.m_xPos, this.m_playerData.m_yPos, this.m_playerData.m_zPos);

        // ゲームマネージャをセット
        this.gameManager = GameObject.Find("GameManager").GetComponent <CGameManager>();
    }
 public override void OnInitObject()
 {
     base.OnInitObject();
     // INIT SOCKET
     CSocketManager.Instance.Init();
     CPlayerManager.GetInstance();
     // ADMOB
     CAdmobManager.Init();
     CAdmobManager.InitBanner();
     CAdmobManager.InitRewardedVideo();
     CAdmobManager.LoadBanner();
     CAdmobManager.LoadRewardedVideo();
     if (CGameSetting.HasTimeToAd() == false)
     {
         CGameSetting.ResetTimerToAd();
     }
     // EVENTS
     CSocketManager.Instance.On("welcome", this.OnReceiveWelcome);
 }
Exemplo n.º 13
0
    //----------------------------------------------------------------------
    // コンストラクタ
    //----------------------------------------------------------------------
    // @Param	none
    // @Return	none
    // @Date	2014/10/15  @Update 2014/10/31  @Author T.Kawashita
    // @Date    2014/12/1  @Update 2014/12/1  @Author T.Takeuchi
    //----------------------------------------------------------------------
    void Start()
    {
        this.Init();

        // プレイヤーのデータをセット
        CPlayerManager.SetPlayerData(this.m_playerData, CPlayerManager.PLAYER_1);
        this.SetData();

        m_pos = this.transform.localPosition;

        // 国の情報をセット / 国によってマテリアルを変更
        m_human = CHumanManager.GetWorldInstance(TeamData.teamNationality[0]);
        Debug.Log(m_human);

        // プレイヤーの情報をマップにセット
//		Color color = Color.red;
//		CPlayerManager.m_playerManager.SetMap(this.gameObject, color);

        // プレイヤーのアニメーターをセット
        m_animator = this.gameObject.transform.parent.GetComponent <CPlayerAnimator>();
    }
Exemplo n.º 14
0
    //----------------------------------------------------------------------
    // コンストラクタ
    //----------------------------------------------------------------------
    // @Param   none
    // @Return	none
    // @Date	2014/12/1  @Update 2014/12/1  @Author T.Kawashita
    // @Date    2014/12/1  @Update 2014/12/1  @Author T.Takeuchi
    //----------------------------------------------------------------------
    void Start()
    {
        this.Init();

        // プレイヤーのデータをセット
        CPlayerManager.SetPlayerData(this.m_playerData, CPlayerManager.AI_1);
        m_pos = this.transform.localPosition;

        // 国の情報をセット / 国によってマテリアルを変更
        m_human = CHumanManager.GetWorldInstance(TeamData.teamNationality[0]);
        this.transform.FindChild("polySurface14").GetComponent <CCpu1Mesh>().ChangeMaterial(TeamData.teamNationality[0]);

        // CPU用の値をセット
        this.SetData();

        // サッカーボールの情報を取得
        this.soccerBallObject = GameObject.Find("SoccerBall");

        // プレイヤーのアニメーターをセット
        m_animator = this.gameObject.transform.parent.GetComponent <CPlayerAnimator>();
    }
Exemplo n.º 15
0
    //----------------------------------------------------------------------
    // コンストラクタ
    //----------------------------------------------------------------------
    // @Param	none
    // @Return	none
    // @Date	2014/10/15  @Update 2014/10/31  @Author T.Kawashita
    //----------------------------------------------------------------------
    void Start()
    {
        this.Init();

        // プレイヤーのデータをセット
        CPlayerManager.SetPlayerData(this.m_playerData, CPlayerManager.PLAYER_4);

        // 国の情報をセット / 国によってマテリアルを変更
        m_human = CHumanManager.GetWorldInstance(TeamData.teamNationality[1]);
        this.transform.FindChild("polySurface14").GetComponent <CPlayer4Mesh>().ChangeMaterial(TeamData.teamNationality[1]);
        m_gauge.m_teamNo = 2;

        // プレイヤーごとの値をセット
        this.SetData();

        // プレイヤーのアニメーターをセット
        m_animator = this.gameObject.transform.parent.GetComponent <CPlayerAnimator>();

        // カメラをセット
        m_camera = this.gameObject.transform.parent.FindChild("Player4Camera").GetComponent <PlayerCamera>();
        m_trans  = this.transform.Find("LookTrans").transform;
    }
Exemplo n.º 16
0
    public bool m_isRotation;                                  // 현재 플레이어가 회전중인가

    void Start()
    {
        CPlayerManager._instance = this;
        _CPlayerMove             = GetComponent <CPlayerMove>();
        _CPlayerAni_Contorl      = GetComponent <CPlayerAni_Contorl>();
        _CPlayerCombe            = GetComponent <CPlayerCombe>();
        _CPlayerSkill            = GetComponent <CPlayerSkill>();
        _PlayerController        = GetComponent <CharacterController>();
        _CPlayerSwap             = GetComponent <CPlayerSwap>();
        _CPlayerShild            = GetComponent <CPlayerShild>();

        // 플레이어 스탯 설정
        m_fMoveSpeed   = 6;
        m_fGravity     = 10;
        m_fPlayerHp    = 100;
        m_fPlayerStm   = 100;
        m_fPlayerGauge = 100;
        m_nAttackCombo = 0;

        m_bMove     = true;
        m_bAnimator = true;
    }
Exemplo n.º 17
0
    // GetMyPlayer 自キャラのオブジェクトをmyPlayerに登録
    bool GetMyPlayer()
    {
        //自キャラのID取得
        int player_id = PhotonNetwork.LocalPlayer.ActorNumber;

        //全てのプレイヤーオブジェクトを取得
        players = GameObject.FindGameObjectsWithTag("Player");
        //全てのプレイヤーオブジェクトから自キャラをIDで検索し、取り出す
        foreach (GameObject player in players)
        {
            int playerLoostring_PID = player.GetComponent <PhotonView>().Owner.ActorNumber;
            if (playerLoostring_PID == player_id)
            {
                //自プレイヤーオブジェクトを取得
                myPlayer      = player;
                PlayerManager = myPlayer.GetComponent <CPlayerManager>();
                myID          = playerLoostring_PID;
                PlayerName    = player.GetComponent <PhotonView>().Owner.NickName;
                return(true);
            }
        }
        return(false);
    }
Exemplo n.º 18
0
 private void Awake()
 {
     _BossTransform = GameObject.FindGameObjectWithTag("Boss").GetComponent <Transform>();
     pPlayerMgr     = GameObject.FindGameObjectWithTag("Player").GetComponent <CPlayerManager>();
     _manager       = GetComponent <CEnemyManager>();
 }
Exemplo n.º 19
0
 private void Start()
 {
     CPlayerAttackEffect._instance = this;
     m_manager = GetComponent <CPlayerManager>();
 }
Exemplo n.º 20
0
    void Awake()
    {
        CPlayerManager._instance = this;

        Init();
    }
Exemplo n.º 21
0
 public void SetManager(CPlayerManager manager)
 {
     _manager = manager;
 }
Exemplo n.º 22
0
 private void Awake()
 {
     _manager = GetComponent <CPlayerManager>();
 }
Exemplo n.º 23
0
    //check what was hit on collisions
    void OnTriggerEnter(Collider col)
    {
        //cache corresponding gameobject that was hit
        GameObject obj = col.gameObject;
        //try to get a player component out of the collided gameobject
        CPlayerManager player = obj.GetComponent <CPlayerManager>();

        //we actually hit a player
        //do further checks
        if (player != null)
        {
            /*
             * //ignore ourselves & disable friendly fire (same team index)
             * if (player.gameObject == owner) return;
             * else if (player.GetView().GetTeam() == owner.GetComponent<Player>().GetView().GetTeam()) return;
             */

            //create clips and particles on hit
            if (hitFX)
            {
                CPoolManager.Spawn(hitFX, transform.position, Quaternion.identity);
            }
            // if (hitClip) AudioManager.Play3D(hitClip, transform.position);

            //on the player that was hit, set the killing player to the owner of this bullet
            //maybe this owner really killed the player, but that check is done in the Player script
            // player.killedBy = owner;
        }
        else if (bounce > 0)
        {
/*
 *          //a player was not hit but something else, and we still have some bounces left
 *          //create a ray that points in the direction this bullet is currently flying to
 *          Ray ray = new Ray(transform.position - transform.forward, transform.forward);
 *          RaycastHit hit;
 *
 *          //perform spherecast in the flying direction, on the default layer
 *          if (Physics.SphereCast(ray, sphereCol.radius, out hit, speed, 1 << 0))
 *          {
 *              //something was hit in the direction this projectile is flying to
 *              //get new reflected (bounced off) direction of the colliding object
 *              Vector3 dir = Vector3.Reflect(ray.direction, hit.normal);
 *              //rotate bullet to face the new direction
 *              transform.rotation = Quaternion.LookRotation(dir);
 *              //reassign velocity with the new direction in mind
 *              OnSpawn();
 *
 *              //play clip at the collided position
 *              if (hitClip) AudioManager.Play3D(hitClip, transform.position);
 *              //substract bouncing count by one
 *              bounce--;
 *              //exit execution until next collision
 *              return;
 *          }
 */
        }

        //despawn gameobject
        //       PoolManager.Despawn(gameObject);

        //the previous code is not synced to clients at all, because all that clients need is the
        //initial position and direction of the bullet to calculate the exact same behavior on their end.
        //at this point, continue with the critical game aspects only on the server
        if (!PhotonNetwork.isMasterClient)
        {
            return;
        }
        //apply bullet damage to the collided player
        //       if (player) player.TakeDamage(this);
    }
Exemplo n.º 24
0
 void Awake()
 {
     _playerManager = GetComponent <CPlayerManager>();
     _gameManager   = GetComponent <CGameManager>();
 }
Exemplo n.º 25
0
 void Awake()
 {
     _PlayerManager = GetComponent <CPlayerManager>();
 }