Example #1
0
 void Start()
 {
     charNum   = GameObject.Find("CharactorInfo").GetComponent <CharactorInfo>().GetCharaSelectData();
     charaInfo = GameObject.Find("CharactorInfo").GetComponent <CharactorInfo>();
     charaInfo.SetCharaSelectData(charNum);
     transform.position += new Vector3(10.0f, 0.0f, 0.0f) * ((int)charNum);
     destCameraPos       = transform.position;
     startPosition      += transform.position;
 }
Example #2
0
    Text nameText;      //NameTextUI

    // Use this for initialization
    void Start()
    {
        CharactorInfo charaInfo = GameObject.Find("CharactorInfo").GetComponent <CharactorInfo>();

        //名前設定
        if (null != charaInfo)
        {
            nameText.text = charaInfo.GetPlayerName();
        }
        else
        {
            nameText.text = "None";
        }
    }
Example #3
0
    //シングルトン処理
    void Awake()
    {
        //CharactorInfoインスタンスが存在したら
        if (instance != null)
        {
            //今回インスタンス化したCharactorInfoを破棄
            Destroy(this.gameObject);
        }

        //CharactorInfoインスタンスがなかったら
        else if (instance == null)
        {
            //このCharactorInfoをインスタンスとする
            instance = this;
        }

        //シーンを跨いでもCharactorInfoインスタンスを破棄しない
        DontDestroyOnLoad(gameObject);


        if (SceneManager.GetActiveScene().name == "Offline")
        {
            GameObject player = null;

            switch (charSelectData)
            {
            case CHARA.TANUKI:
                player = Instantiate(playerPrefab_0, new Vector3(0.0f, 25.5f, 0.0f), Quaternion.identity);
                break;

            case CHARA.CAT:
                player = Instantiate(playerPrefab_1, new Vector3(0.0f, 25.5f, 0.0f), Quaternion.identity);
                break;

            case CHARA.FOX:
                player = Instantiate(playerPrefab_2, new Vector3(0.0f, 25.5f, 0.0f), Quaternion.identity);
                break;

            case CHARA.DOG:
                player = Instantiate(playerPrefab_3, new Vector3(0.0f, 25.5f, 0.0f), Quaternion.identity);
                break;
            }

            player.name = playerName;
        }
    }
Example #4
0
    void Awake()
    {
        //NetworkManagerの取得
        manager = GetComponent <NetworkManager>();

        //OnlineCanvasの取得
        canvas = GameObject.Find("OnlineCanvas");
        if (canvas == null)
        {
            Debug.Log("Missing : OnlineCanvas");
        }

        //PuniconCameraの取得
        punioconCamera = GameObject.Find("PuniconCamera");
        if (punioconCamera == null)
        {
            Debug.Log("Missing : PunioconCamera");
        }

        //CharactorInfoの取得
        GameObject c = GameObject.Find("CharactorInfo");

        if (c == null)
        {
            Debug.Log("Missing : CharactorInfo");
        }
        else
        {
            charaInfo = c.GetComponent <CharactorInfo>();
        }

        //charaConnect = new CharaConnect();



        //接続時のローディングイメージを有効
        loadingImage.gameObject.SetActive(true);

        OnlineSetup();          //オンライン時の設定
    }
Example #5
0
    // Use this for initialization
    void Start()
    {
        if (targetObject_Green == null)
        {
            Debug.Log("タヌキのリザルトオブジェクトの設定してー");
        }

        if (targetObject_Sand == null)
        {
            Debug.Log("キツネのリザルトオブジェクトの設定してー");
        }

        if (targetObject_Ice == null)
        {
            Debug.Log("イヌのリザルトオブジェクトの設定してー");
        }

        if (targetObject_Town == null)
        {
            Debug.Log("ネコのリザルトオブジェクトの設定してー");
        }

        charInfo    = GameObject.Find("CharactorInfo").GetComponent <CharactorInfo>();
        player      = netConnector.GetLocalPlayer();
        scoreObject = GameObject.Find("ResultManager/ResultObjectScore/Canvas/Score000");

        GameObject manager = GameObject.Find("LoadSceneManager");

        if (null != manager)
        {
            loadSceneManager = manager.GetComponent <LoadSceneManager> ();
        }

        GameObject audio = GameObject.Find("AudioManager");

        if (null != audio)
        {
            audioManager = audio.GetComponent <AudioManager> ();
        }
    }
    void Start()
    {
        //クライアント側で使用キャラを送信する為取得
        charaInfo = GameObject.Find("CharactorInfo").GetComponent <CharactorInfo>();
        if (null == charaInfo)
        {
            //エラーログ
            Debug.Log("PlayerSyncScore:Not charaInfo");
        }

        if (isServer)
        {
            //サーバ側でクライアントへ町の総合得点を送信する為取得
            serverScore = GameObject.Find("ServerScore").GetComponent <ServerScore> ();
            if (null == serverScore)
            {
                //エラーログ
                Debug.Log("PlayerSyncScore:Not serverScore");
            }
        }
        //サーバへ使用キャラを送信
        SendUseCharaToServer();
        //ServerScore ();
    }
Example #7
0
    // Use this for initialization
    void Start()
    {
        //自分が操作するオブジェクトに限定する
        if (isLocalPlayer)
        {
            //自分のプレイヤーの名前変更
            //name = GameObject.Find("CharactorInfo").GetComponent<CharactorInfo>().GetPlayerName();
            //name = "Player";

            //自分を操作するぷにコンに自分自身を伝える。
            PunipuniController punipuni = GameObject.Find("PuniconCamera/Punicon").GetComponent <PunipuniController>();
            punipuni.SetPlayer(this.gameObject);

            //ローディングイメージのアクティブを切る
            if (GameObject.Find("OnlineCanvas/LoadingImage") != null)
            {
                GameObject.Find("OnlineCanvas/LoadingImage").SetActive(false);
            }

            //PlayerCameraを使うため、Scene Cameraを非アクティブ化
            GameObject cam = GameObject.Find("Scene Camera");
            if (null != cam)
            {
                cam.SetActive(false);
            }

            //Camera,AudioListenerの各コンポーネントをアクティブ化
            PlayerCamera.GetComponent <Camera>().enabled         = true;
            audioListener.GetComponent <AudioListener>().enabled = true;

            //LocalPlayerのAnimatorパラメータを自動的に送る
            GetComponent <NetworkAnimator>().SetParameterAutoSend(0, true);

            //カメラの取得等があるため、ここでPostureControllerのスクリプトをOnにしてStartメソッド呼び出し。
            GetComponent <OfflinePostureController>().enabled = true;

            //ミッションマネージャに自分がスポーンした事を知らせる。
            GameObject.Find("NetworkMissionManager").GetComponent <NetworkMissionManager>().SetPlayer(this.gameObject);


            netConnector = GameObject.Find("NetConnector").GetComponent <NetConnector>();
            if (null != netConnector)
            {
                netConnector.SetLocalPlayer(gameObject);
            }

            charaInfo = GameObject.Find("CharactorInfo").GetComponent <CharactorInfo>();

            if (null != charaInfo)
            {
                // SendName(charaInfo.GetPlayerName());
                //playerName.SetNameText(charaInfo.GetPlayerName());
                useChara = charaInfo.GetCharaSelectData();
            }

            skyBg.gameObject.SetActive(true);
            //接続時のローディングイメージを有効
//            GameObject.Find("OnlineCanvas/LoadingImage").SetActive(false);

            netConnector.createPlayer = true;
        }
        else
        {
            //自分以外の移動スクリプトを切る
            GetComponent <OfflinePostureController>().enabled    = false;
            PlayerCamera.GetComponent <Camera>().enabled         = false;
            audioListener.GetComponent <AudioListener>().enabled = false;
            skyBg.gameObject.SetActive(false);
        }
    }
Example #8
0
 //リセット
 public void ClearFlg()
 {
     playerName     = null;
     charSelectData = CHARA.TANUKI;
     instance       = null;
 }