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:
Erro ao compilar para IOS
[Devlog] Lost in the world 14/11
[Duvida] Bug ao usar Vector3.Lerp Objeto é teleportado na lata
Jogo 2D unity - trocar sprite ao apertar botão
sombras para jogos mobile
Unity - Deslizar Para Rotacionar o 'Personagem'
Discord para desenvolvimento de jogos
Bug/Erro da unity?
[TUTORIAL] Controle 3ª pessoa com animações mecânicas (root motion)
rotação no exio z
[TUTORIAL] Banco de dados || MySQL
(UNITY) Erro ao compilar a Build Android
Unity + MySQL
Erro de Prefab quando realiza o Build de um projeto 3D
Em busca de um modelador 3D para plataforma educacional (Já ganhamos apoio de faculdades)
[TUTORIAL] Unity 5 - Sistema Completo de PORTAS E CHAVES
Drop Shadows
[RESOLVIDO]Como aplicar textura alpha na unity
Unity 3D - Desenhos Com Física(Download Projeto)
Como mudar o CONTROLLER do ANIMATOR
Como criar um poligono dinamicamente?
erro no unity
movimento de uma nave
Instantiate
Problema ao rotacionar valores negativos.
Calcular hora ?
Novo estilo de estourar blocos, baixe meu jogo pessoal ... conto com a ajuda de vocês!!!
Jogo que fiz para uma Jam da minha faculdade FATEC Ourinhos.
Não consigo o Android SDK!!
[RESOLVIDO] Como faço para depois de determinado tempo acontecer algo?
CRASH AO ENTRAR NA CENA UNITY
estou procurando um bom tutorial de IA Basica
Erro ao colocar script no botão
Novo jogo em desenvolvimento, 13º andar
Text Dinâmico no botão
Sistema Pdv, Mercado, Padaria, Conveniência, Lojas Em Geral - C# VISUAL STUDIO
[TUTORIAL] - Script de lanterna pra seu jogo de terror e outros...
[RESOLVIDO] Unity - Reproduzir Videos Do Blender No Unity
Ordem de fases
[RESOLVIDO] Tenho algum erro de simbolo no script do carro o que poderia ser?
[RESOLVIDO] Dúvida. Detectar colisões nas instâncias
erro na minha IA
[TUTORIAL] While, como funciona?
Mostrar a contagem em 10K e 100M
[TUTORIAL] AI Enemy 2.0 + animações ( Jogos de terror )
Cores nos materiais sem criar material
Poderia modelar um personagem cartoon para meu projeto
Como coloco modo de criação de personagem?
[Ajuda] Assets
RayCasting + Disparo Um Bom Tipo De Video Aula.
Ajuda de Blender para Unity
Procuro Equipe Para Criação de Jogo [PAGO]
[____TÓPICO LIVRE____] FALE O QUE QUISER (Parte 2)
[RESOLVIDO] erro WaterBaseEditor.cs não encontra o caminho do WaterBase
[TUTORIAL] Criar Analógico Virtual UI Para Mobile.
[TUTORIAL] Acessar nomes de arquivos diretamente da pasta
Objeto dentro do player nao ta rotacioando
[TUTORIAL] MENU PRINCIPAL - UNITY 5 (5.3 ou superior) (Com UI)
Array de prefabs
screenshot
instancia item aleatorio em varias posicoes
[TUTORIAL] Mira que fica se movendo (ocilando,tremendo,etc)
Getcomponent de C# para java
Curso barato de C#
Unity - Modelo 3D em Menu 2D
[RESOLVIDO] Camera Estilo Showroom
A um mês com unity bugado sem resposta
[GameJam] Competição organizada pela BitCodeStudios
Pegar strings de "duas em duas"
criar um piano no unity
Movimentação
Instanciar objeto onde cricar com mouse ou touch
Dúvida Sistema de Energia para jogo android
[RESOLVIDO] Inimigo patrulhando constantemente estilo mario
BUG UNITY 3D ROSA A SCENE E GAME
Dúvida. Colliders no Unity3D
Pq a grama do Unity é tao pesada?
Alguem cria uma conta na playstore pra mim? :(
Capture Panorama?
Artistas 3D e Programadores Unity3D (Remunerado)
Input Get Key
SCHULTZ Jogo de terror
(Erro) IndexOutOfRangeException:Array index is out of range
EU QUERIA COLOCAR ANUNCIOS NO MEU JOGO NA MUDANÇA DE CENAS MAS NÃO ACHO UM JEITO
Unity - Duvida Sobre a JDK Que Vocês Usam
[RESOLVIDO] Adicionar Botoes em controle mobile
admob recompensa
Unity - Duvida Sobre Atualizar
Unity Admob GDPR (como implementar ?)
Timer para mudar de câmera
The Pyramid Demo Atualizado
[____ENQUETE____] Eleições para presidente 2018 (2º turno)
Mudando cor do texto...
como dminuir o lag no meu unity 5
[JOGO MOBILE] Defeat the Illuminatis
Como chamar animação sem passar por outro parâmetros?
[TUTORIAL] Unity 5 - Botão contínuo usando UI (Manter pressionado)
unity - erro ao buildar
Meus ints não aparecem no Inspector, serializable não funciona
Hoje à(s) 11:28 am
Hoje à(s) 11:23 am
Hoje à(s) 9:31 am
Hoje à(s) 5:23 am
Hoje à(s) 1:23 am
Ontem à(s) 11:15 pm
Ontem à(s) 4:59 pm
Ontem à(s) 4:47 pm
Ontem à(s) 3:23 pm
Ontem à(s) 2:13 pm
Qua Nov 14, 2018 5:47 pm
Qua Nov 14, 2018 5:44 pm
Qua Nov 14, 2018 5:41 pm
Qua Nov 14, 2018 5:14 pm
Qua Nov 14, 2018 4:30 pm
Qua Nov 14, 2018 3:35 pm
Qua Nov 14, 2018 2:45 pm
Qua Nov 14, 2018 1:25 pm
Qua Nov 14, 2018 10:45 am
Ter Nov 13, 2018 11:25 pm
Ter Nov 13, 2018 11:23 pm
Ter Nov 13, 2018 11:18 pm
Ter Nov 13, 2018 10:55 pm
Ter Nov 13, 2018 6:21 pm
Ter Nov 13, 2018 5:55 pm
Ter Nov 13, 2018 1:30 pm
Ter Nov 13, 2018 11:33 am
Seg Nov 12, 2018 9:52 pm
Seg Nov 12, 2018 3:57 pm
Seg Nov 12, 2018 3:24 pm
Seg Nov 12, 2018 8:13 am
Seg Nov 12, 2018 8:11 am
Dom Nov 11, 2018 6:56 pm
Dom Nov 11, 2018 2:41 pm
Dom Nov 11, 2018 8:12 am
Dom Nov 11, 2018 7:57 am
Sab Nov 10, 2018 8:54 pm
Sab Nov 10, 2018 5:11 pm
Sab Nov 10, 2018 2:52 pm
Sab Nov 10, 2018 2:13 pm
Sab Nov 10, 2018 12:39 am
Sab Nov 10, 2018 12:28 am
Sex Nov 09, 2018 3:56 pm
Qui Nov 08, 2018 11:28 pm
Qui Nov 08, 2018 11:25 pm
Qui Nov 08, 2018 10:01 pm
Qui Nov 08, 2018 7:47 pm
Qui Nov 08, 2018 12:36 pm
Qui Nov 08, 2018 12:31 pm
Qui Nov 08, 2018 12:28 pm
Qui Nov 08, 2018 12:53 am
Qua Nov 07, 2018 5:52 pm
Qua Nov 07, 2018 4:04 pm
Qua Nov 07, 2018 12:49 pm
Ter Nov 06, 2018 2:05 pm
Ter Nov 06, 2018 12:30 pm
Ter Nov 06, 2018 11:32 am
Ter Nov 06, 2018 1:10 am
Seg Nov 05, 2018 6:57 pm
Seg Nov 05, 2018 3:36 pm
Seg Nov 05, 2018 12:44 am
Dom Nov 04, 2018 5:32 pm
Dom Nov 04, 2018 5:31 pm
Dom Nov 04, 2018 5:30 pm
Dom Nov 04, 2018 1:05 am
Sab Nov 03, 2018 1:36 pm
Sex Nov 02, 2018 11:38 pm
Sex Nov 02, 2018 10:55 pm
Sex Nov 02, 2018 8:16 pm
Sex Nov 02, 2018 7:50 pm
Sex Nov 02, 2018 7:41 pm
Sex Nov 02, 2018 7:27 pm
Sex Nov 02, 2018 6:36 pm
Sex Nov 02, 2018 3:27 pm
Sex Nov 02, 2018 3:35 am
Sex Nov 02, 2018 3:24 am
Qui Nov 01, 2018 3:56 pm
Qui Nov 01, 2018 3:52 pm
Qui Nov 01, 2018 1:18 pm
Qui Nov 01, 2018 7:57 am
Qui Nov 01, 2018 2:26 am
Qui Nov 01, 2018 2:05 am
Qua Out 31, 2018 9:20 pm
Qua Out 31, 2018 6:09 pm
Qua Out 31, 2018 7:17 am
Ter Out 30, 2018 11:34 pm
Ter Out 30, 2018 9:34 pm
Ter Out 30, 2018 5:29 pm
Ter Out 30, 2018 8:12 am
Ter Out 30, 2018 8:05 am
Seg Out 29, 2018 2:21 pm
Seg Out 29, 2018 12:03 am
Dom Out 28, 2018 5:33 pm
Dom Out 28, 2018 11:58 am
Dom Out 28, 2018 11:57 am
Sab Out 27, 2018 11:29 am
Sab Out 27, 2018 11:22 am
Sex Out 26, 2018 8:31 pm
Sex Out 26, 2018 6:21 pm
eduardonog30
Mateus2583
DuViDoSo
Regis garcia
MarceloYBP
NKKF
JohnRambo
Zack2
francieljesus
theus.mors
sabbath
sabbath
sabbath
McbDJ
rZwr
Fabricio Alves
NKKF
TioUV
JohnRambo
MarcosSchultz
MarcosSchultz
MarceloYBP
theus.mors
juniorhotes
Weslley
Callyde Jr
hamerom
luansantos
francisco barroso
Vitor Paulino
dstaroski
dstaroski
SuperGamer
Patrick
dstaroski
dstaroski
SuperGamer
Magnatah
francisco barroso
Samuelostgamer
GattiMene
MarceloYBP
SuperGamer
Tegh
francisco barroso
NKKF
GameLACK
dstaroski
dstaroski
dstaroski
jack2117
Mathss
JohnRambo
Daniel Dória
JohnRambo
gurgelg752
francisco barroso
MarcosSchultz
Nalfam
dstaroski
MarcosSchultz
dstaroski
dstaroski
dstaroski
Magnatah
Teio
Callyde Jr
hetrodo
NKKF
CarlosDT94
MarcosSchultz
MarcosSchultz
Magnatah
MrMattD
MarcosSchultz
MarcosSchultz
francisco barroso
francisco barroso
Callyde Jr
Dom3000
MarcosSchultz
MarcosSchultz
francisco barroso
MATHEUS1233
dstaroski
francisco barroso
theus.mors
Magnatah
dstaroski
dstaroski
dstaroski
MarcosSchultz
mafipt
dstaroski
dstaroski
Weslley
Weslley
Magnatah
MarcosSchultz

[RESOLVIDO] Alguem pode me ajudar? tenho esse erro aqui em um script

Ir em baixo

Resolvido [RESOLVIDO] Alguem pode me ajudar? tenho esse erro aqui em um script

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 : 447
REPUTAÇÃO : 2
Respeito as regras :

Ver perfil do usuário

Voltar ao Topo Ir em baixo

Resolvido Re: [RESOLVIDO] Alguem pode me ajudar? tenho esse erro aqui em um script

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 : 2035
REPUTAÇÃO : 408
Idade : 14
Á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

Resolvido Re: [RESOLVIDO] Alguem pode me ajudar? tenho esse erro aqui em um script

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 : 1351
REPUTAÇÃO : 132
Á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

Resolvido Re: [RESOLVIDO] Alguem pode me ajudar? tenho esse erro aqui em um script

Mensagem por Samuelostgamer em Qui Out 11, 2018 2:32 pm

@fecirineu escreveu:
@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]{}
}


simplesmente era um erro da versao do photon pun mas obrigado pela atenção




Samuelostgamer
Iniciante
Iniciante

PONTOS : 447
REPUTAÇÃO : 2
Respeito as regras :

Ver perfil do usuário

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