SchultzGames
Para tirar dúvidas, crie um tópico especifico na área "Dúvidas em Geral" e aguarde ser respondido. Evite comentar em tópicos não relacionados a sua dúvida :D
TÓPICOS RECENTES:
Tópico:
Postado em:
Postado por:
Montando equipe! [Game survival]
Character controller no android
[TUTORIAL] Interação para FPS com Raycast
Unity lendo as faces ao contrario ;-;
Controle de câmera em primeira pessoa com um joystick virtual
Meu Joystick virtual pra Android só funciona uma vez!!!
[TUTORIAL] Entenda o Sistema De multiplayer local ! BASICO (Video Aula) pt/br
Como fazer um sistema multiplayer?
Coletar Objetos que estão na mira
Olá a todos :)
Sou novo no FÓRUM
Lance o inventário de objetos
PROBLEMA EM COPIAR SCRIPTS
[RESOLVIDO] Instancia objeto em posições diferentes
Notepad++
Alguem Usa Pagamentos Automaticos do unity Ads Pode Me Ajudar com o Pagamento ?
[TUTORIAL] Sistema COMPLETO de câmeras
[____TÓPICO LIVRE____] FALE O QUE QUISER (Parte 2)
Unity Package Manager Error
[RESOLVIDO] Custom Inspector
Cinemachine
Total de Jogadores Online
[____APOIE O FÓRUM E O CANAL E GANHE RECOMPENSAS____]
[___COMO UTILIZAR O FÓRUM___] Principais botões e suas funções
[RESOLVIDO] Botao Home(Native do Android)
[RESOLVIDO] Resolução Resposiva
[RESOLVIDO] Tilemap Collider
[RESOLVIDO] Arremessar uma granada(2D)
Controle Objetos 3D
[PROJETO MOBILE] Defeat the Illuminatis
Qual a melhor forma de deixar o cabelo low poly animado ?
[AULA] Estrutura de decisão if..else
[____ENQUETE____] Eleições para presidente 2018
Criar jogo de terror
personagem do unity sem animaçao e caindo pra baixo
Ajuda com script C# (delay effect)
Script de health de inimigo sendo acessado mesmo sem acerta o inimigo
Preciso de ajuda em um script para o trabalho do meu estágio.
[Plugin dll] DigData basico save data Para Unity
[TUTORIAL] Como criar um JOGO DE TERROR
[TUTORIAL] Controle 3ª pessoa com animações mecânicas (root motion)
[Em Desenvolvimento] Battles of Worlds
Skybox da unity rosa
Dark blue sword RPG low poly
Atualizado (The Pyramid 1.1.1)
Problema com o Shader (Shader Bloqueado)
Como faço para o player agachar
Erro ao carregar cena salva
[RESOLVIDO] tem como mudar a cor desse fundo de distância azul?
[TUTORIAL] Otimização Simples por distância
Inventário de objetos 2D
video aula videoplayback easy ar /unity
como faz LookAt em 2d
Visual studio nao instala com compatibilidade com a unity :C
[JOGO MOBILE] The Sprinter Maze / Agradecimentos
Carregar video por url remote settings
É recomendado fazer cidades fictícias no sketchup?
[TUTORIAL] AI Enemy 2.0 + animações ( Jogos de terror )
Sprite crescer em linha reta como um laser 2D
[RESOLVIDO] Problema para Carregar cena
[RESOLVIDO] Como exportar o modelo sem o seguinte prefab:
[RESOLVIDO] correr character controller
Problema com Wheel Collider
Ajuda na criação de AudioSource
Ambient Occlusion para mobile.
Erro ao instalar o componente da Unity no Visual Studio
[____SUGESTÕES PARA O FÓRUM____]
Camera Estilo Gta (Livre que Volta Sozinha)
O básico do script
[____ADERIR A UMA CATEGORIA NO FÓRUM____]
Precisa-se DE Modelador/Animador Para Um Jogo de RPG Online..
unity - erro ao salvar dados
Duvidas com Json
Artistas 3D e Programadores Unity3D (Remunerado)
[TUTORIAL] Como fazer um laser com LineRenderer - UNITY 5
[TUTORIAL ] Script para Cutscenes
The Pyramid Demo Atualizado
Problemas com Colisores
Como fazer a vida ficar encima do player enquanto ele se move
Camera olhar para player em planeta esférico (estilo Mario Galaxy)
[RESOLVIDO] Ativar um Unico Objeto da Array.
tela preta do unity apos abrir no celular..
Procuro desenvolvedor Google Maps
Destruir Terreno
[TUTORIAL] Inteligência artificial, inimigo e AIPoints
Erro de arquivo CSPROJ na Unity
[RESOLVIDO] Diminuir um número
[RESOLVIDO] String.contains
Command 888
[TUTORIAL] Mover personagem com Touch, no estilo SUBWAY SURFERS
Ajuda com código Raycast2D
[TUTORIAL] Bubble Sort - Algoritmo
touch do android em C# Unity
[TUTORIAL] Gerar números aleatórios SEM REPETIR (método com lista)
[TUTORIAL] Sistema de Lanterna com Pilhas
Dúvida, poupar processador.
Gerador de senha
(ARQUIVO) Leia aqui como obter sucesso com seu jogo independente?
Alguém pode corrigir as roupas do meu personagem? (Modelagem 3D - Pedido)
Ontem à(s) 10:44 pm
Ontem à(s) 9:39 pm
Ontem à(s) 9:21 pm
Ontem à(s) 4:49 pm
Ontem à(s) 1:30 pm
Ontem à(s) 1:25 pm
Ontem à(s) 1:23 pm
Ontem à(s) 11:51 am
Ontem à(s) 7:51 am
Ontem à(s) 7:44 am
Ontem à(s) 12:45 am
Ontem à(s) 12:22 am
Seg Set 24, 2018 10:25 pm
Seg Set 24, 2018 6:24 pm
Seg Set 24, 2018 4:50 pm
Seg Set 24, 2018 4:49 pm
Seg Set 24, 2018 4:47 pm
Seg Set 24, 2018 1:40 pm
Seg Set 24, 2018 11:48 am
Seg Set 24, 2018 12:07 am
Dom Set 23, 2018 9:49 pm
Dom Set 23, 2018 2:18 pm
Dom Set 23, 2018 2:14 pm
Dom Set 23, 2018 2:12 pm
Dom Set 23, 2018 1:30 pm
Dom Set 23, 2018 1:30 pm
Dom Set 23, 2018 12:36 pm
Dom Set 23, 2018 4:16 am
Sab Set 22, 2018 11:42 pm
Sab Set 22, 2018 9:29 pm
Sab Set 22, 2018 9:16 pm
Sab Set 22, 2018 5:14 pm
Sab Set 22, 2018 2:13 pm
Sab Set 22, 2018 8:53 am
Sab Set 22, 2018 1:21 am
Sex Set 21, 2018 5:42 pm
Sex Set 21, 2018 3:40 pm
Sex Set 21, 2018 2:26 pm
Sex Set 21, 2018 1:58 pm
Sex Set 21, 2018 11:41 am
Sex Set 21, 2018 6:58 am
Sex Set 21, 2018 12:11 am
Qui Set 20, 2018 8:23 pm
Qui Set 20, 2018 6:01 pm
Qui Set 20, 2018 12:53 pm
Qua Set 19, 2018 8:10 pm
Qua Set 19, 2018 7:16 pm
Qua Set 19, 2018 7:11 pm
Qua Set 19, 2018 10:51 am
Qua Set 19, 2018 10:23 am
Qua Set 19, 2018 10:21 am
Qua Set 19, 2018 2:14 am
Qua Set 19, 2018 1:17 am
Ter Set 18, 2018 9:01 pm
Ter Set 18, 2018 1:59 pm
Seg Set 17, 2018 7:55 pm
Seg Set 17, 2018 12:58 pm
Seg Set 17, 2018 12:54 pm
Seg Set 17, 2018 8:18 am
Dom Set 16, 2018 11:15 pm
Dom Set 16, 2018 11:13 pm
Dom Set 16, 2018 4:50 pm
Dom Set 16, 2018 5:13 am
Sab Set 15, 2018 10:06 pm
Sab Set 15, 2018 10:00 pm
Sex Set 14, 2018 8:41 pm
Sex Set 14, 2018 8:37 pm
Sex Set 14, 2018 5:17 pm
Sex Set 14, 2018 2:04 pm
Sex Set 14, 2018 11:10 am
Qui Set 13, 2018 3:36 pm
Qui Set 13, 2018 10:14 am
Qui Set 13, 2018 9:48 am
Qui Set 13, 2018 9:25 am
Qua Set 12, 2018 11:40 pm
Qua Set 12, 2018 6:04 pm
Qua Set 12, 2018 12:57 pm
Qua Set 12, 2018 3:33 am
Qua Set 12, 2018 12:25 am
Ter Set 11, 2018 8:00 pm
Ter Set 11, 2018 4:20 pm
Ter Set 11, 2018 2:52 pm
Ter Set 11, 2018 2:20 pm
Ter Set 11, 2018 12:27 pm
Seg Set 10, 2018 11:10 pm
Seg Set 10, 2018 8:29 pm
Seg Set 10, 2018 7:17 pm
Seg Set 10, 2018 6:47 pm
Seg Set 10, 2018 12:08 pm
Seg Set 10, 2018 9:07 am
Dom Set 09, 2018 11:27 pm
Dom Set 09, 2018 6:58 pm
Dom Set 09, 2018 3:53 am
Sab Set 08, 2018 11:37 pm
Sab Set 08, 2018 11:29 pm
Sab Set 08, 2018 11:23 pm
Sab Set 08, 2018 10:23 pm
Sab Set 08, 2018 6:23 pm
Sab Set 08, 2018 5:07 pm
zeca urubu
francisco barroso
dstaroski
TioUV
NKKF
NKKF
NKKF
Callyde Jr
dstaroski
dstaroski
ffabim
JuR
francisco barroso
QueriaStarMorto
MarcosSchultz
MarcosSchultz
MarcosSchultz
Dom3000
Callyde Jr
speedluk
QueriaStarMorto
NKKF
FelipeSouza11
FelipeSouza11
nofrim
nofrim
Marmota
BananaSmith
MarcosSchultz
dstaroski
TioUV
MayLeone
JohnRambo
Lourenco
MarcosSchultz
PedroSilva
Jmspp
luansantos
FelipeSouza11
francisco barroso
dstaroski
Dom3000
MarcosSchultz
MRX
Callyde Jr
diegopds
MayLeone
Callyde Jr
Daniel Dória
Daniel Dória
Caius
marciosilva
MarcosSchultz
luiz12345
JohnRambo
natanael.olimpio
Callyde Jr
Callyde Jr
Ezequiel286
Eduardoro39
SuperGamer
JuR
MarcosSchultz
MeverPlays
MeverPlays
MarcosSchultz
MarcosSchultz
dstaroski
dstaroski
JohnRambo
fecirineu
igorobm
igorobm
igorobm
Eduardoro39
NKKF
Callyde Jr
MarcosSchultz
MarcosSchultz
MarcosSchultz
nicolasfive
natanael.olimpio
natanael.olimpio
INKnight
FuncaoFF
dstaroski
QueriaStarMorto
NyanHeavyBR
Callyde Jr
FabioBRPA
MarcosSchultz
NKKF
niao
MarcosSchultz
MarcosSchultz
MarcosSchultz
Flávio
Joab Artes Gráficas
vitorhugo

Alguem pode me ajudar? tenho esse erro aqui em um script mas nao consigo resolver...:

Ir em baixo

Outro Alguem pode me ajudar? tenho esse erro aqui em um script mas nao consigo resolver...:

Mensagem por Samuelostgamer em Qui Set 06, 2018 10:48 pm

Código:
////////////////////////////////////////////////////////////////////////////////
//////////////////// bl_PlayerSync.cs///////////////////////////////////////////
////////////////////use this for the synchronizer position , rotation, states,//
///////////////////etc...  via photon//////////////////////////////////////////
////////////////////////////////Lovatto Studio//////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

[RequireComponent(typeof(PhotonView))]
public class bl_PlayerSync : bl_MonoBehaviour
{
    /// <summary>
    /// the player's team is not ours
    /// </summary>
    [HideInInspector]
    public string RemoteTeam;
    /// <summary>
    /// the current state of the current weapon
    /// </summary>
    public string WeaponState;
    /// <summary>
    /// the object to which the player looked
    /// </summary>
    public Transform HeatTarget;
    /// <summary>
    /// smooth interpolation amount
    /// </summary>
    public float SmoothingDelay = 8f;
    /// <summary>
    /// list all remote weapons
    /// </summary>
    public List<bl_NetworkGun> NetworkGuns = new List<bl_NetworkGun>();

    [SerializeField]
    PhotonTransformViewPositionModel m_PositionModel = new PhotonTransformViewPositionModel();

    [SerializeField]
    PhotonTransformViewRotationModel m_RotationModel = new PhotonTransformViewRotationModel();

    [SerializeField]
    PhotonTransformViewScaleModel m_ScaleModel = new PhotonTransformViewScaleModel();

    PhotonTransformViewPositionControl m_PositionControl;
    PhotonTransformViewRotationControl m_RotationControl;
    PhotonTransformViewScaleControl m_ScaleControl;

    bool m_ReceivedNetworkUpdate = false;
    [Space(5)]
    //Script Needed
    [Header("Necessary script")]
    public bl_GunManager GManager;
    public bl_PlayerAnimations m_PlayerAnimation;
    //Material for apply when disable a NetGun
    public Material InvicibleMat;
    //private
    private bl_FirstPersonController Controller;
    private GameObject CurrenGun;
    private bl_PlayerSettings Settings;
    private bl_PlayerDamageManager PDM;
   private DrawName DrawName;
    private bl_RoomMenu RoomMenu;
    private bool FrienlyFire = false;
    private bool SendInfo = false;
    private CharacterController m_CController;
#if UMM
    private bl_MiniMapItem MiniMapItem = null;
#endif

#pragma warning disable 0414
    [SerializeField]
    bool ObservedComponentsFoldoutOpen = true;
#pragma warning disable 0414


    protected override void Awake()
    {
        base.Awake();
        if (!PhotonNetwork.connected)
            Destroy(this);

        //FirstUpdate = false;
        if (!this.isMine)
        {
            if (HeatTarget.gameObject.activeSelf == false)
            {
                HeatTarget.gameObject.SetActive(true);
            }
        }

        m_PositionControl = new PhotonTransformViewPositionControl(m_PositionModel);
        m_RotationControl = new PhotonTransformViewRotationControl(m_RotationModel);
        m_ScaleControl = new PhotonTransformViewScaleControl(m_ScaleModel);
        Controller = GetComponent<bl_FirstPersonController>();
        Settings = GetComponent<bl_PlayerSettings>();
        PDM = GetComponent<bl_PlayerDamageManager>();
        DrawName = GetComponent<bl_DrawName>();
        RoomMenu = FindObjectOfType<bl_RoomMenu>();
        m_CController = GetComponent<CharacterController>();
        FrienlyFire = (bool)PhotonNetwork.room.CustomProperties[PropertiesKeys.RoomFriendlyFire];
#if UMM
      MiniMapItem = this.GetComponent<bl_MiniMapItem>();
#endif
    }

    /// <summary>
    /// serialization method of photon
    public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    {

        m_PositionControl.OnPhotonSerializeView(transform.localPosition, stream, info);
        m_RotationControl.OnPhotonSerializeView(transform.localRotation, stream, info);
        m_ScaleControl.OnPhotonSerializeView(transform.localScale, stream, info);
        if (isMine == false && m_PositionModel.DrawErrorGizmo == true)
        {
            DoDrawEstimatedPositionError();
        }
        if (stream.isWriting)
        {
            //We own this player: send the others our data
            stream.SendNext(gameObject.name);
            stream.SendNext(HeatTarget.position);
            stream.SendNext(HeatTarget.rotation);
            stream.SendNext((int)Controller.State);
            stream.SendNext(Controller.isGrounded);
            stream.SendNext(GManager.GetCurrentWeapon().GunID);
            stream.SendNext(Settings.m_Team.ToString());
            stream.SendNext(WeaponState);
            stream.SendNext(Controller.Velocity);
        }
        else
        {
            //Network player, receive data
            RemotePlayerName = (string)stream.ReceiveNext();
            HeadPos = (Vector3)stream.ReceiveNext();
            HeadRot = (Quaternion)stream.ReceiveNext();
            m_state = (int)stream.ReceiveNext();
            m_grounded = (bool)stream.ReceiveNext();
            CurNetGun = (int)stream.ReceiveNext();
            RemoteTeam = (string)stream.ReceiveNext();
            UpperState = (string)stream.ReceiveNext();
            velocity = (Vector3)stream.ReceiveNext();

            m_ReceivedNetworkUpdate = true;
        }
    }

    private Vector3 HeadPos = Vector3.zero;// Head Look to
    private Quaternion HeadRot = Quaternion.identity;
    private int m_state;
    private bool m_grounded;
    private string RemotePlayerName = string.Empty;
    private int CurNetGun;
    private string UpperState = "";
    private Vector3 velocity;

    protected override void OnDisable()
    {
        base.OnDisable();
        if (bl_GameData.Instance.DropGunOnDeath)
        {
            NetGunsRoot.gameObject.SetActive(false);
        }
    }

    /// <summary>
    ///
    /// </summary>
    public override void OnUpdate()
    {
        ///if the player is not ours, then
        if (photonView == null || isMine == true || isConnected == false)
        {
            return;
        }

        UpdatePosition();
        UpdateRotation();
        UpdateScale();
        GetTeamRemote();

        this.HeatTarget.position = Vector3.Lerp(this.HeatTarget.position, HeadPos, Time.deltaTime * this.SmoothingDelay);
        this.HeatTarget.rotation = HeadRot;
        m_PlayerAnimation.state = m_state;//send the state of player local for remote animation
        m_PlayerAnimation.grounded = m_grounded;
        m_PlayerAnimation.velocity = velocity;
        m_PlayerAnimation.UpperState = UpperState;

        gameObject.name = RemotePlayerName;
        if(DrawName != null) { DrawName.m_PlayerName = RemotePlayerName; }
        if (!isOneTeamMode)
        {
            //Determine if remote player is teamMate or enemy
            if (RemoteTeam == (string)PhotonNetwork.player.CustomProperties[PropertiesKeys.TeamKey])
            {
                TeamMate();
            }
            else
            {
                Enemy();
            }
        }
        else
        {
            Enemy();
        }

        CurrentTPVGun();
    }

    void CurrentTPVGun(bool local = false)
    {
        if (GManager == null)
            return;

        //Get the current gun ID local and sync with remote
        bool found = false;
        foreach (bl_NetworkGun guns in NetworkGuns)
        {
            int currentID = (local) ? GManager.GetCurrentWeapon().GunID : CurNetGun;
            if (guns.GetWeaponID == currentID)
            {
                guns.gameObject.SetActive(true);
                if (!local)
                {
                    CurrenGun = guns.gameObject;
                    CurrenGun.GetComponent<bl_NetworkGun>().SetUpType();
                }
                found = true;
            }
            else
            {
                guns.gameObject.SetActive(false);
            }
        }
        if (!found) { Debug.LogWarning("Net gun with id: " + CurNetGun + " is not defined!"); }
    }

    /// <summary>
    /// use this function to set all details for enemy
    /// </summary>
    void Enemy()
    {
        PDM.DamageEnabled = true;
        DrawName.enabled = RoomMenu.SpectatorMode;
#if UMM
      if (UpperState == "Firing")
        {
            MiniMapItem.ShowItem();
        }
        else
        {
            MiniMapItem.HideItem();
        }
#endif
    }

    /// <summary>
    /// use this function to set all details for teammate
    /// </summary>
    void TeamMate()
    {
        PDM.DamageEnabled = FrienlyFire;
        DrawName.enabled = true;
        m_CController.enabled = false;

        if (!SendInfo)
        {
            SendInfo = true;
            this.GetComponentInChildren<bl_BodyPartManager>().IgnorePlayerCollider();
        }

#if UMM
  MiniMapItem.ShowItem();
#endif
    }

    /// <summary>
    ///
    /// </summary>
    public void SetNetworkWeapon(GunType weaponType)
    {
        m_PlayerAnimation.SetNetworkWeapon(weaponType);
    }

    /// <summary>
    /// public method to send the RPC shot synchronization
    /// </summary>
    public void IsFire(string m_type, float t_spread, Vector3 pos, Quaternion rot)
    {
        photonView.RPC("FireSync", PhotonTargets.Others, new object[] { m_type, t_spread, pos, rot });
    }

    /// <summary>
    /// public method to send the RPC shot synchronization
    /// </summary>
    public void IsFireGrenade(float t_spread, Vector3 pos, Quaternion rot, Vector3 angular)
    {
        photonView.RPC("FireGrenadeRpc", PhotonTargets.Others, new object[] { t_spread, pos, rot, angular });
    }

    public Transform NetGunsRoot { get { if (!bl_GameData.Instance.DropGunOnDeath) { CurrentTPVGun(true); } return NetworkGuns[0].transform.parent; } }

    /// <summary>
    /// Synchronize the shot with the current remote weapon
    /// send the information necessary so that fire
    /// impact in the same direction as the local
    /// </summary>
    [PunRPC]
    void FireSync(string m_type, float m_spread, Vector3 pos, Quaternion rot)
    {
        if (CurrenGun)
        {
            if (m_type == GunType.Machinegun.ToString())
            {
                CurrenGun.GetComponent<bl_NetworkGun>().Fire(m_spread, pos, rot);
            }
            else if (m_type == GunType.Shotgun.ToString())
            {
                CurrenGun.GetComponent<bl_NetworkGun>().Fire(m_spread, pos, rot);//if you need add your custom fire shotgun in networkgun
            }
            else if (m_type == GunType.Sniper.ToString())
            {
                CurrenGun.GetComponent<bl_NetworkGun>().Fire(m_spread, pos, rot);//if you need add your custom fire sniper in networkgun
            }
            else if (m_type == GunType.Burst.ToString())
            {
                CurrenGun.GetComponent<bl_NetworkGun>().Fire(m_spread, pos, rot);//if you need add your custom fire burst in networkgun
            }
            else if (m_type == GunType.Knife.ToString())
            {
                CurrenGun.GetComponent<bl_NetworkGun>().KnifeFire();//if you need add your custom fire launcher in networkgun
            }
        }
    }

    [PunRPC]
    void FireGrenadeRpc(float m_spread, Vector3 pos, Quaternion rot,Vector3 angular)
    {
        CurrenGun.GetComponent<bl_NetworkGun>().GrenadeFire(m_spread, pos, rot, angular);
    }

    /// <summary>
    ///
    /// </summary>
    public void SetActiveGrenade(bool active)
    {
        photonView.RPC("SyncOffAmmoGrenade", PhotonTargets.Others, active);
    }

    [PunRPC]
    void SyncOffAmmoGrenade(bool active)
    {
        if (CurrenGun == null)
        {
            Debug.LogError("Grenade is not active on TPS Player");
            return;
        }
        CurrenGun.GetComponent<bl_NetworkGun>().DesactiveGrenade(active, InvicibleMat);
    }

    /// <summary>
    ///
    /// </summary>
    void GetTeamRemote()
    {
        if (RemoteTeam == Team.Recon.ToString())
        {
            Settings.m_Team = Team.Recon;
        }
        else if (RemoteTeam == Team.Delta.ToString())
        {
            Settings.m_Team = Team.Delta;
        }
        else
        {
            Settings.m_Team = Team.All;
        }
    }

#if CUSTOMIZER
    [PunRPC]
    void SyncCustomizer(string info, string p)
    {
        if (CurrenGun)
        {
            if (p == this.gameObject.name)//is mine
            {
                this.CurrenGun.GetComponent<bl_NetworkGun>().ReadCustomizer(info);
            }
        }
        else
        {
            StartCoroutine(WaitForGetGUN(info, p));
        }
    }

    IEnumerator WaitForGetGUN(string info, string p)
    {
        yield return new WaitForSeconds(2);
        this.SyncCustomizer(info, p);
    }
#endif

    /// <summary>
    ///
    /// </summary>
    void UpdatePosition()
    {
        if (m_PositionModel.SynchronizeEnabled == false || m_ReceivedNetworkUpdate == false)
        {
            return;
        }

        transform.localPosition = m_PositionControl.UpdatePosition(transform.localPosition);
    }
    /// <summary>
    ///
    /// </summary>
    void UpdateRotation()
    {
        if (m_RotationModel.SynchronizeEnabled == false || m_ReceivedNetworkUpdate == false)
        {
            return;
        }

        transform.localRotation = m_RotationControl.GetRotation(transform.localRotation);
    }
    /// <summary>
    ///
    /// </summary>
    void UpdateScale()
    {
        if (m_ScaleModel.SynchronizeEnabled == false || m_ReceivedNetworkUpdate == false)
        {
            return;
        }

        transform.localScale = m_ScaleControl.GetScale(transform.localScale);
    }
    /// <summary>
    ///
    /// </summary>
    void DoDrawEstimatedPositionError()
    {
        Vector3 targetPosition = m_PositionControl.GetNetworkPosition();

        Debug.DrawLine(targetPosition, transform.position, Color.red, 2f);
        Debug.DrawLine(transform.position, transform.position + Vector3.up, Color.green, 2f);
        Debug.DrawLine(targetPosition, targetPosition + Vector3.up, Color.red, 2f);
    }
    /// <summary>
    /// These values are synchronized to the remote objects if the interpolation mode
    /// or the extrapolation mode SynchronizeValues is used. Your movement script should pass on
    /// the current speed (in units/second) and turning speed (in angles/second) so the remote
    /// object can use them to predict the objects movement.
    /// </summary>
    /// <param name="speed">The current movement vector of the object in units/second.</param>
    /// <param name="turnSpeed">The current turn speed of the object in angles/second.</param>
    public void SetSynchronizedValues(Vector3 speed, float turnSpeed)
    {
        m_PositionControl.SetSynchronizedValues(speed, turnSpeed);
    }
}
Assets/MFPS/Scripts/Misc/Network/bl_PlayerSync.cs(62,10): error CS0246: The type or namespace name `DrawName' could not be found. Are you missing an assembly reference?

Samuelostgamer
Iniciante
Iniciante

PONTOS : 384
REPUTAÇÃO : 0
Respeito as regras :

Ver perfil do usuário

Voltar ao Topo Ir em baixo

Outro Re: Alguem pode me ajudar? tenho esse erro aqui em um script mas nao consigo resolver...:

Mensagem por NKKF em Qui Set 06, 2018 11:15 pm

Amigo, isso é um erro do próprio Asset, entre em contato com o suporte.

Recomendo também que veja se a sua versão Unity é suportada pela versão do MFPS que você baixou.
avatar
NKKF
ProgramadorMaster

Masculino PONTOS : 1955
REPUTAÇÃO : 402
Idade : 13
Áreas de atuação : Error 404 Not Found.
Respeito as regras :

Ver perfil do usuário http://www.projetounity.esy.es

Voltar ao Topo Ir em baixo

Outro Re: Alguem pode me ajudar? tenho esse erro aqui em um script mas nao consigo resolver...:

Mensagem por fecirineu em Sex Set 07, 2018 9:37 am

@Samuelostgamer escreveu:
Código:
////////////////////////////////////////////////////////////////////////////////
//////////////////// bl_PlayerSync.cs///////////////////////////////////////////
////////////////////use this for the synchronizer position , rotation, states,//
///////////////////etc...   via photon//////////////////////////////////////////
////////////////////////////////Lovatto Studio//////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

[RequireComponent(typeof(PhotonView))]
public class bl_PlayerSync : bl_MonoBehaviour
{
    /// <summary>
    /// the player's team is not ours
    /// </summary>
    [HideInInspector]
    public string RemoteTeam;
    /// <summary>
    /// the current state of the current weapon
    /// </summary>
    public string WeaponState;
    /// <summary>
    /// the object to which the player looked
    /// </summary>
    public Transform HeatTarget;
    /// <summary>
    /// smooth interpolation amount
    /// </summary>
    public float SmoothingDelay = 8f;
    /// <summary>
    /// list all remote weapons
    /// </summary>
    public List<bl_NetworkGun> NetworkGuns = new List<bl_NetworkGun>();

    [SerializeField]
    PhotonTransformViewPositionModel m_PositionModel = new PhotonTransformViewPositionModel();

    [SerializeField]
    PhotonTransformViewRotationModel m_RotationModel = new PhotonTransformViewRotationModel();

    [SerializeField]
    PhotonTransformViewScaleModel m_ScaleModel = new PhotonTransformViewScaleModel();

    PhotonTransformViewPositionControl m_PositionControl;
    PhotonTransformViewRotationControl m_RotationControl;
    PhotonTransformViewScaleControl m_ScaleControl;

    bool m_ReceivedNetworkUpdate = false;
    [Space(5)]
    //Script Needed
    [Header("Necessary script")]
    public bl_GunManager GManager;
    public bl_PlayerAnimations m_PlayerAnimation;
    //Material for apply when disable a NetGun
    public Material InvicibleMat;
    //private
    private bl_FirstPersonController Controller;
    private GameObject CurrenGun;
    private bl_PlayerSettings Settings;
    private bl_PlayerDamageManager PDM;
 private DrawName DrawName;
    private bl_RoomMenu RoomMenu;
    private bool FrienlyFire = false;
    private bool SendInfo = false;
    private CharacterController m_CController;
#if UMM
     private bl_MiniMapItem MiniMapItem = null;
#endif

#pragma warning disable 0414
    [SerializeField]
    bool ObservedComponentsFoldoutOpen = true;
#pragma warning disable 0414


    protected override void Awake()
    {
        base.Awake();
        if (!PhotonNetwork.connected)
            Destroy(this);

        //FirstUpdate = false;
        if (!this.isMine)
        {
            if (HeatTarget.gameObject.activeSelf == false)
            {
                HeatTarget.gameObject.SetActive(true);
            }
        }

        m_PositionControl = new PhotonTransformViewPositionControl(m_PositionModel);
        m_RotationControl = new PhotonTransformViewRotationControl(m_RotationModel);
        m_ScaleControl = new PhotonTransformViewScaleControl(m_ScaleModel);
        Controller = GetComponent<bl_FirstPersonController>();
        Settings = GetComponent<bl_PlayerSettings>();
        PDM = GetComponent<bl_PlayerDamageManager>();
        DrawName = GetComponent<bl_DrawName>();
        RoomMenu = FindObjectOfType<bl_RoomMenu>();
        m_CController = GetComponent<CharacterController>();
        FrienlyFire = (bool)PhotonNetwork.room.CustomProperties[PropertiesKeys.RoomFriendlyFire];
#if UMM
      MiniMapItem = this.GetComponent<bl_MiniMapItem>();
#endif
    }

    /// <summary>
    /// serialization method of photon
    public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    {

        m_PositionControl.OnPhotonSerializeView(transform.localPosition, stream, info);
        m_RotationControl.OnPhotonSerializeView(transform.localRotation, stream, info);
        m_ScaleControl.OnPhotonSerializeView(transform.localScale, stream, info);
        if (isMine == false && m_PositionModel.DrawErrorGizmo == true)
        {
            DoDrawEstimatedPositionError();
        }
        if (stream.isWriting)
        {
            //We own this player: send the others our data
            stream.SendNext(gameObject.name);
            stream.SendNext(HeatTarget.position);
            stream.SendNext(HeatTarget.rotation);
            stream.SendNext((int)Controller.State);
            stream.SendNext(Controller.isGrounded);
            stream.SendNext(GManager.GetCurrentWeapon().GunID);
            stream.SendNext(Settings.m_Team.ToString());
            stream.SendNext(WeaponState);
            stream.SendNext(Controller.Velocity);
        }
        else
        {
            //Network player, receive data
            RemotePlayerName = (string)stream.ReceiveNext();
            HeadPos = (Vector3)stream.ReceiveNext();
            HeadRot = (Quaternion)stream.ReceiveNext();
            m_state = (int)stream.ReceiveNext();
            m_grounded = (bool)stream.ReceiveNext();
            CurNetGun = (int)stream.ReceiveNext();
            RemoteTeam = (string)stream.ReceiveNext();
            UpperState = (string)stream.ReceiveNext();
            velocity = (Vector3)stream.ReceiveNext();

            m_ReceivedNetworkUpdate = true;
        }
    }

    private Vector3 HeadPos = Vector3.zero;// Head Look to
    private Quaternion HeadRot = Quaternion.identity;
    private int m_state;
    private bool m_grounded;
    private string RemotePlayerName = string.Empty;
    private int CurNetGun;
    private string UpperState = "";
    private Vector3 velocity;

    protected override void OnDisable()
    {
        base.OnDisable();
        if (bl_GameData.Instance.DropGunOnDeath)
        {
            NetGunsRoot.gameObject.SetActive(false);
        }
    }

    /// <summary>
    ///
    /// </summary>
    public override void OnUpdate()
    {
        ///if the player is not ours, then
        if (photonView == null || isMine == true || isConnected == false)
        {
            return;
        }

        UpdatePosition();
        UpdateRotation();
        UpdateScale();
        GetTeamRemote();

        this.HeatTarget.position = Vector3.Lerp(this.HeatTarget.position, HeadPos, Time.deltaTime * this.SmoothingDelay);
        this.HeatTarget.rotation = HeadRot;
        m_PlayerAnimation.state = m_state;//send the state of player local for remote animation
        m_PlayerAnimation.grounded = m_grounded;
        m_PlayerAnimation.velocity = velocity;
        m_PlayerAnimation.UpperState = UpperState;

        gameObject.name = RemotePlayerName;
        if(DrawName != null) { DrawName.m_PlayerName = RemotePlayerName; }
        if (!isOneTeamMode)
        {
            //Determine if remote player is teamMate or enemy
            if (RemoteTeam == (string)PhotonNetwork.player.CustomProperties[PropertiesKeys.TeamKey])
            {
                TeamMate();
            }
            else
            {
                Enemy();
            }
        }
        else
        {
            Enemy();
        }

        CurrentTPVGun();
    }

    void CurrentTPVGun(bool local = false)
    {
        if (GManager == null)
            return;

        //Get the current gun ID local and sync with remote
        bool found = false;
        foreach (bl_NetworkGun guns in NetworkGuns)
        {
            int currentID = (local) ? GManager.GetCurrentWeapon().GunID : CurNetGun;
            if (guns.GetWeaponID == currentID)
            {
                guns.gameObject.SetActive(true);
                if (!local)
                {
                    CurrenGun = guns.gameObject;
                    CurrenGun.GetComponent<bl_NetworkGun>().SetUpType();
                }
                found = true;
            }
            else
            {
                guns.gameObject.SetActive(false);
            }
        }
        if (!found) { Debug.LogWarning("Net gun with id: " + CurNetGun + " is not defined!"); }
    }

    /// <summary>
    /// use this function to set all details for enemy
    /// </summary>
    void Enemy()
    {
        PDM.DamageEnabled = true;
        DrawName.enabled = RoomMenu.SpectatorMode;
#if UMM
      if (UpperState == "Firing")
        {
            MiniMapItem.ShowItem();
        }
        else
        {
            MiniMapItem.HideItem();
        }
#endif
    }

    /// <summary>
    /// use this function to set all details for teammate
    /// </summary>
    void TeamMate()
    {
        PDM.DamageEnabled = FrienlyFire;
        DrawName.enabled = true;
        m_CController.enabled = false;

        if (!SendInfo)
        {
            SendInfo = true;
            this.GetComponentInChildren<bl_BodyPartManager>().IgnorePlayerCollider();
        }

#if UMM
   MiniMapItem.ShowItem();
#endif
    }

    /// <summary>
    ///
    /// </summary>
    public void SetNetworkWeapon(GunType weaponType)
    {
        m_PlayerAnimation.SetNetworkWeapon(weaponType);
    }

    /// <summary>
    /// public method to send the RPC shot synchronization
    /// </summary>
    public void IsFire(string m_type, float t_spread, Vector3 pos, Quaternion rot)
    {
        photonView.RPC("FireSync", PhotonTargets.Others, new object[] { m_type, t_spread, pos, rot });
    }

    /// <summary>
    /// public method to send the RPC shot synchronization
    /// </summary>
    public void IsFireGrenade(float t_spread, Vector3 pos, Quaternion rot, Vector3 angular)
    {
        photonView.RPC("FireGrenadeRpc", PhotonTargets.Others, new object[] { t_spread, pos, rot, angular });
    }

    public Transform NetGunsRoot { get { if (!bl_GameData.Instance.DropGunOnDeath) { CurrentTPVGun(true); } return NetworkGuns[0].transform.parent; } }

    /// <summary>
    /// Synchronize the shot with the current remote weapon
    /// send the information necessary so that fire
    /// impact in the same direction as the local
    /// </summary>
    [PunRPC]
    void FireSync(string m_type, float m_spread, Vector3 pos, Quaternion rot)
    {
        if (CurrenGun)
        {
            if (m_type == GunType.Machinegun.ToString())
            {
                CurrenGun.GetComponent<bl_NetworkGun>().Fire(m_spread, pos, rot);
            }
            else if (m_type == GunType.Shotgun.ToString())
            {
                CurrenGun.GetComponent<bl_NetworkGun>().Fire(m_spread, pos, rot);//if you need add your custom fire shotgun in networkgun
            }
            else if (m_type == GunType.Sniper.ToString())
            {
                CurrenGun.GetComponent<bl_NetworkGun>().Fire(m_spread, pos, rot);//if you need add your custom fire sniper in networkgun
            }
            else if (m_type == GunType.Burst.ToString())
            {
                CurrenGun.GetComponent<bl_NetworkGun>().Fire(m_spread, pos, rot);//if you need add your custom fire burst in networkgun
            }
            else if (m_type == GunType.Knife.ToString())
            {
                CurrenGun.GetComponent<bl_NetworkGun>().KnifeFire();//if you need add your custom fire launcher in networkgun
            }
        }
    }

    [PunRPC]
    void FireGrenadeRpc(float m_spread, Vector3 pos, Quaternion rot,Vector3 angular)
    {
        CurrenGun.GetComponent<bl_NetworkGun>().GrenadeFire(m_spread, pos, rot, angular);
    }

    /// <summary>
    ///
    /// </summary>
    public void SetActiveGrenade(bool active)
    {
        photonView.RPC("SyncOffAmmoGrenade", PhotonTargets.Others, active);
    }

    [PunRPC]
    void SyncOffAmmoGrenade(bool active)
    {
        if (CurrenGun == null)
        {
            Debug.LogError("Grenade is not active on TPS Player");
            return;
        }
        CurrenGun.GetComponent<bl_NetworkGun>().DesactiveGrenade(active, InvicibleMat);
    }

    /// <summary>
    ///
    /// </summary>
    void GetTeamRemote()
    {
        if (RemoteTeam == Team.Recon.ToString())
        {
            Settings.m_Team = Team.Recon;
        }
        else if (RemoteTeam == Team.Delta.ToString())
        {
            Settings.m_Team = Team.Delta;
        }
        else
        {
            Settings.m_Team = Team.All;
        }
    }

#if CUSTOMIZER
    [PunRPC]
    void SyncCustomizer(string info, string p)
    {
        if (CurrenGun)
        {
            if (p == this.gameObject.name)//is mine
            {
                this.CurrenGun.GetComponent<bl_NetworkGun>().ReadCustomizer(info);
            }
        }
        else
        {
            StartCoroutine(WaitForGetGUN(info, p));
        }
    }

    IEnumerator WaitForGetGUN(string info, string p)
    {
        yield return new WaitForSeconds(2);
        this.SyncCustomizer(info, p);
    }
#endif

    /// <summary>
    ///
    /// </summary>
    void UpdatePosition()
    {
        if (m_PositionModel.SynchronizeEnabled == false || m_ReceivedNetworkUpdate == false)
        {
            return;
        }

        transform.localPosition = m_PositionControl.UpdatePosition(transform.localPosition);
    }
    /// <summary>
    ///
    /// </summary>
    void UpdateRotation()
    {
        if (m_RotationModel.SynchronizeEnabled == false || m_ReceivedNetworkUpdate == false)
        {
            return;
        }

        transform.localRotation = m_RotationControl.GetRotation(transform.localRotation);
    }
    /// <summary>
    ///
    /// </summary>
    void UpdateScale()
    {
        if (m_ScaleModel.SynchronizeEnabled == false || m_ReceivedNetworkUpdate == false)
        {
            return;
        }

        transform.localScale = m_ScaleControl.GetScale(transform.localScale);
    }
    /// <summary>
    ///
    /// </summary>
    void DoDrawEstimatedPositionError()
    {
        Vector3 targetPosition = m_PositionControl.GetNetworkPosition();

        Debug.DrawLine(targetPosition, transform.position, Color.red, 2f);
        Debug.DrawLine(transform.position, transform.position + Vector3.up, Color.green, 2f);
        Debug.DrawLine(targetPosition, targetPosition + Vector3.up, Color.red, 2f);
    }
    /// <summary>
    /// These values are synchronized to the remote objects if the interpolation mode
    /// or the extrapolation mode SynchronizeValues is used. Your movement script should pass on
    /// the current speed (in units/second) and turning speed (in angles/second) so the remote
    /// object can use them to predict the objects movement.
    /// </summary>
    /// <param name="speed">The current movement vector of the object in units/second.</param>
    /// <param name="turnSpeed">The current turn speed of the object in angles/second.</param>
    public void SetSynchronizedValues(Vector3 speed, float turnSpeed)
    {
        m_PositionControl.SetSynchronizedValues(speed, turnSpeed);
    }
}
Assets/MFPS/Scripts/Misc/Network/bl_PlayerSync.cs(62,10): error CS0246: The type or namespace name `DrawName' could not be found. Are you missing an assembly reference?

tecnicamente está faltando algum script ou uma linha foi apagada que geralmente fica em cima do nome da class: exemplo:
Código:
using UnityEngine;
using System.Collections;[size=14][/size]using System.Collections.Generic;[size=14][/size]namespace DrawName {[size=14][/size][RequireComponent(typeof(PhotonView))]public class bl_PlayerSync : bl_MonoBehaviour[size=14][/size]{}
}



avatar
fecirineu
ProgramadorMaster

Masculino PONTOS : 1299
REPUTAÇÃO : 131
Áreas de atuação : Programação C#,VB,VBNET,MySQL,HTML,CSS,PHP.

Respeito as regras :

Ver perfil do usuário http://gamesbr.cf/

Voltar ao Topo Ir em baixo

Voltar ao Topo

- Tópicos similares

 
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum