コード例 #1
0
    IEnumerator CorReLoad(string sceneName)
    {
        AsyncOperation op = SceneManager.LoadSceneAsync(sceneName);

        while (!op.isDone)
        {
            yield return(null);
        }

        player      = GameObject.FindGameObjectWithTag("Player").GetComponent <DisplayPlayer>();
        textMyCoin  = GameObject.Find("TextMyCoins").GetComponent <Text>();
        textMyScore = GameObject.Find("TextMyScore").GetComponent <Text>();

        bool load = SaveData.Instance.LoadUserData();

        //Debug.Log("SAVE : " + load);
        if (load == true)
        {
            myBestScore = SaveData.Instance.LoadBestScore();
            myCoins     = SaveData.Instance.LoadCoins();
        }
        else
        {
            myBestScore = 0;
            myCoins     = 200;
        }

        textMyScore.text = "" + myBestScore;

        SaveData.Instance.SaveUserData(myCoins, myBestScore);
        SoundManager.Instance.ActiveBGM(SoundManager.Instance.bgm);
        AdManager.Instance.NewAwake();
        options.SetOptionMode(false);
    }
コード例 #2
0
    public void ReloadSettings()
    {
        player      = GameObject.FindGameObjectWithTag("Player").GetComponent <DisplayPlayer>();
        textMyCoin  = GameObject.Find("TextMyCoins").GetComponent <Text>();
        textMyScore = GameObject.Find("TextMyScore").GetComponent <Text>();

        bool load = SaveData.Instance.LoadUserData();

        //Debug.Log("SAVE : " + load);
        if (load == true)
        {
            myBestScore = SaveData.Instance.LoadBestScore();
            myCoins     = SaveData.Instance.LoadCoins();
        }
        else
        {
            myBestScore = 0;
            myCoins     = 200;
            SaveData.Instance.SaveUserData(myCoins, myBestScore);
        }

        textMyScore.text = "" + myBestScore;

        AdManager.Instance.NewAwake();
        options.SetOptionMode(false);
    }
コード例 #3
0
    private void Start()
    {
        player      = GameObject.FindGameObjectWithTag("Player").GetComponent <DisplayPlayer>();
        textMyCoin  = GameObject.Find("TextMyCoins").GetComponent <Text>();
        textMyScore = GameObject.Find("TextMyScore").GetComponent <Text>();

        bool load = SaveData.Instance.LoadUserData();

        //Debug.Log("SAVE : " + load);
        if (load == true)
        {
            myBestScore = SaveData.Instance.LoadBestScore();
            myCoins     = SaveData.Instance.LoadCoins();
        }
        else
        {
            myBestScore = 0;
            myCoins     = 200;
        }

        textMyScore.text = "" + myBestScore;

        SaveData.Instance.SaveUserData(myCoins, myBestScore);
        InvokeRepeating("RandomizeKeys", 1, 1);
    }
コード例 #4
0
 public void ChangePlayerSprite(Sprite[] sprite)
 {
     if (player == null)
     {
         player = GameObject.FindGameObjectWithTag("Player").GetComponent <DisplayPlayer>();
     }
     playerSprites = sprite;
     player.SetSprites(sprite);
 }
コード例 #5
0
ファイル: Program3.cs プロジェクト: SlavXX/C-Sharp-Course
        static void Main(string[] args)
        {
            Dictionary <int, string> listofPlayers = new Dictionary <int, string>();

            listofPlayers.Add(7, "Ronaldo");
            listofPlayers.Add(10, "Messi");
            listofPlayers.Add(8, "Iniesta");

            DisplayPlayer player = new DisplayPlayer(DisplayPlayerInfo);

            player(listofPlayers);
        }
コード例 #6
0
ファイル: PlayerService.cs プロジェクト: BesterBenedikt/API
        public DisplayPlayer GetDisplayPlayer(int id)
        {
            DisplayPlayer displayPlayer = new DisplayPlayer();
            T002_Player   rawPlayer     = new T002_Player();

            using (var dbc = new TeamDBEntities())
            {
                rawPlayer = dbc.T002_Player.Where(p => p.Id == id).First();
            }
            displayPlayer.importRawPlayer(rawPlayer);
            displayPlayer.TeamName          = ts.getTeamNameById(rawPlayer.TeamId);
            displayPlayer.profilePictureURL = ss.getURL(rawPlayer.Id.ToString());

            return(displayPlayer);
        }
コード例 #7
0
    // Start is called before the first frame update
    void Start()
    {
        if (PhotonNetwork.IsConnectedAndReady)
        {
            foreach (KeyValuePair <int, Player> player in PhotonNetwork.CurrentRoom.Players)
            {
                object playerNum;
                int    playerID = 0;
                if (player.Value.CustomProperties.TryGetValue(NetworkCustomSettings.PLAYER_NUMBER, out playerNum))
                {
                    playerID = (int)playerNum;
                }

                string        playerName  = player.Value.NickName;
                Color         playerColor = _playerColors[playerID - 1];
                DisplayPlayer playerUI    = _playerUIs[playerID - 1];

                playerUI.Intitalize(playerID, playerName, playerColor);
                playerUI.gameObject.SetActive(true);
            }
        }
    }
    IEnumerator LoadScene()
    {
        yield return(null);

        Time.timeScale = 1;

        AsyncOperation op = SceneManager.LoadSceneAsync(nextScene);

        op.allowSceneActivation = false;

        float timer = 0.0f;

        Vector3 min, max;

        min = Camera.main.ViewportToWorldPoint(Vector3.zero);
        max = Camera.main.ViewportToWorldPoint(new Vector3(1, 1));
        //Debug.Log(min + " : " + max);


        player = GameObject.FindWithTag("Player").GetComponent <DisplayPlayer>();
        player.SetSprites(playerSprites);


        min.z = min.y = max.y = max.z = 0;
        min  *= 1.3f;
        player.transform.position = min;


        yield return(new WaitForSeconds(0.5f));

        while (!op.isDone)
        {
            yield return(null);

            timer += Time.deltaTime;
            if (op.progress < 0.9f)
            {
                //progressBar.fillAmount = Mathf.Lerp(progressBar.fillAmount, op.progress, timer);
                player.transform.position = Vector3.Lerp(min, max, timer);
                if (timer >= op.progress)
                {
                    timer = 0f;
                }
            }
            else
            {
                //progressBar.fillAmount = Mathf.Lerp(progressBar.fillAmount, 1f, timer);
                player.transform.position = Vector3.Lerp(min, max, timer);
                if (timer >= 1.0f)
                {
                    op.allowSceneActivation = true;

                    if (toMainMenu == true)
                    {
                        MainManager.Instance.ReLoad(nextScene);
                    }
                    yield break;
                }
            }
        }
    }
コード例 #9
0
 protected void DisplayMention()
 {
     dp = Instantiate(pMention[player - 1], transform);
 }