Ejemplo n.º 1
0
    public override void OnPageEnter()
    {
        // move all player UI boxes to the prefered positions of this page
        // unselect ready arrows from last screen
        _playerInfo.SetPlayerUIByScreen(MenuScreen.CharacterSelect);
        _playerInfo.photonView.RPC("SetReadyUI", PhotonTargets.All, PhotonNetwork.player.ID, false);

        // get the view of first model in character database
        _currentView = CharacterDatabase.instance.GetFirstView();
        photonView.RPC("Update3DModel", PhotonTargets.All, PhotonNetwork.player.ID, _currentView.name);

        // tell everyone to update this players UI Box
        _playerInfo.photonView.RPC("UpdatePlayerUI", PhotonTargets.All, PhotonNetwork.player.ID, _currentView.name);

        // get how many skins this character have and update dots
        _numSkins = _currentView.materials.Length;
        UpdateSkinDots();

        // if masterclient tell averyone to start countdown timer
        if (PhotonNetwork.isMasterClient)
        {
            photonView.RPC("StartCountdown", PhotonTargets.All, PhotonNetwork.time);
        }

        InvokeRepeating("CheckAllReady", 0, 5);
    }
Ejemplo n.º 2
0
    public void OnCharacterSelected(string name)
    {
        // get the view from the name of selcted character
        _currentView = CharacterDatabase.instance.GetViewFromName(name);

        // tell everyone to update the 3d model
        photonView.RPC("Update3DModel", PhotonTargets.All, PhotonNetwork.player.ID, name);

        // always start with skin 0 on new character
        _currentSkin = 0;
        _numSkins    = _currentView.materials.Length;
        UpdateSkinDots();

        // tell everyone to update this players UI Box
        _playerInfo.photonView.RPC("UpdatePlayerUI", PhotonTargets.All, PhotonNetwork.player.ID, name);
    }
Ejemplo n.º 3
0
    void CreateSounds(CharacterDatabase.ViewData data, Transform parent)
    {
        GameObject soundHolderWalk = new GameObject("walkSound", typeof(AudioSource));

        soundHolderWalk.transform.SetParent(parent);

        GameObject soundHolderDash = new GameObject("dashSound", typeof(AudioSource));

        soundHolderDash.transform.SetParent(parent);

        GameObject soundHolderPunch = new GameObject("punchSound", typeof(AudioSource));

        soundHolderPunch.transform.SetParent(parent);

        GameObject soundHolderDeath = new GameObject("DeathSound", typeof(AudioSource));

        soundHolderDeath.transform.SetParent(parent);

        GameObject soundHolderCharge = new GameObject("ChargeSound", typeof(AudioSource));

        soundHolderCharge.transform.SetParent(parent);

        _sounds[(int)CharacterSound.Walk]      = soundHolderWalk.GetComponent <AudioSource>();
        _sounds[(int)CharacterSound.Walk].clip = data.walkSound;

        _sounds[(int)CharacterSound.Dash]      = soundHolderDash.GetComponent <AudioSource>();
        _sounds[(int)CharacterSound.Dash].clip = data.dashSound;

        _sounds[(int)CharacterSound.Punch]      = soundHolderPunch.GetComponent <AudioSource>();
        _sounds[(int)CharacterSound.Punch].clip = data.hitSound;

        _sounds[(int)CharacterSound.Death]      = soundHolderDeath.GetComponent <AudioSource>();
        _sounds[(int)CharacterSound.Death].clip = data.deathSound;

        _sounds[(int)CharacterSound.Charge]      = soundHolderCharge.GetComponent <AudioSource>();
        _sounds[(int)CharacterSound.Charge].clip = data.chargeSound;
        _sounds[(int)CharacterSound.Charge].loop = true;
    }
Ejemplo n.º 4
0
    public void ManualAwake(CharacterDatabase.ViewData data, Transform parent)
    {
        _sounds = new AudioSource[(int)CharacterSound.Count];

        CreateSounds(data, parent);
    }
Ejemplo n.º 5
0
 public void ManualAwake(CharacterDatabase.ViewData data, Transform parent)
 {
     _data = data;
     CreateTrail(parent);
 }