コード例 #1
0
    void SetOn()
    {
        playerID = Data.Instance.levelData.winnerID;
        characterFace.Init(playerID);

        string username = "";

        if (Data.Instance.userData.mode == UserData.modes.MULTIPLAYER)
        {
            username = Data.Instance.multiplayerData.GetPlayer(playerID).username;
        }
        else
        {
            username = Data.Instance.userData.username;
        }

        if (Data.Instance.userData.mode == UserData.modes.SINGLEPLAYER)
        {
            field.text = "LEVEL COMPLETE!";
        }
        else if (Data.Instance.multiplayerData.players.Count > 1)
        {
            field.text = "THE WINNER IS " + username + "!";
        }

        Invoke("Reset", 3f);
    }
コード例 #2
0
    public void Init(int _id)
    {
        this.id = _id;
        characterFace.Init(id);
        int totalPlayers = Data.Instance.multiplayerData.players.Count;

        if (totalPlayers == 1)
        {
            return;
        }

        if (id > 2)
        {
            Vector3 scale = transform.localScale;
            scale.x = -scale.x;
            transform.localScale = scale;
        }
        if (Data.Instance.userData.mode == UserData.modes.MULTIPLAYER)
        {
            Events.OnPowerUpActive += OnPowerUpActive;
        }
    }