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:
Marcas e nomes de carros verdadeiros
[Duvida] Script de mover objeto usando o RigidBody
Character Bug - Android Unity3d
PlayerPrefs??
bloco de notas
Firewall bloqueando conexões lan do meu game
Cores nos materiais sem criar material
Animação com mão fechada
Erro com Post Processing e com canvas
Modelo importado para Unity com os Pés tortos .
[TUTORIAL] Acessar nomes de arquivos diretamente da pasta
Quero fazer um jogo plataforma 2.5d em curva (como Kirby 64), mas não sei.
[TUTORIAL] Criando um simples Multiplayer [UNITY 5]
Reproduzir animação com tecla?
[TUTORIAL] Mirar em jogo de fps igual COD, Battlefield e outros
[TUTORIAL] Ciclo de dia e noite com sync no multiplayer
[TUTORIAL] Salvar dados com playerprefs facilmente.
editor de imagem para perfil
Rotacionar player no eixo Y da camera
erro com carregamento de dados
facebook login
Quando o inimigo ataca todos os inimigos ativam a animação
[TUTORIAL] Como desenhar no Unity.
Objeto ter a mesma rotação que outro em apenas um eixo
Sistema De Marchas para Veiculos
[RESOLVIDO] Pegar o meu ping/latencia (Unet)
Alguém pode me dizer como usar as texturas,Normal map,Occlusion...
Começar em Game Design / Design
Material rosa no HDRender Pipeline como resolvo isso
Instanciate objeto lado a lado
[Duvida] movimentação de nave
[RESOLVIDO] Usando o SetActive para reativar um GameObject, ajuda!
Flamehead MMORPG Indie
erro de java
[TUTORIAL] Desenvolvendo um jogo de quebra-cabeças
[RESOLVIDO] Grafico quadriculado?
duvida com asset store
[TUTORIAL] Assinando um Apk e dicas de instalação e configurações
Como fazer um sistema para conectar objetos?
[RESOLVIDO] Unity sem som
Erro ao tentar compilar para Android
Como iniciar uma animação atraves de um clique em um objeto?
Error ao Gerar a KeyStore do Apk Android
Participe da Game Jam - Jaaj do canal Amdré Young!
[JOGO MOBILE] Defeat the Illuminatis
Alguém sabe como posso aplicar a movimentação agachado?!
Script de Spawn Aleatório
Sugestão para o Fórum - "Área Avançada"
(NavMesh) Objeto "Deslizando"
[____APOIE O FÓRUM E O CANAL E GANHE RECOMPENSAS____]
Alguém conhece algum bom tutorial para aprender Algoritmo genético em C# ?
Mudar cor de area
tela branca ao iniciar videoplayer
COMO FAÇO O SISTEMA DE CHUVA ESTILO ETS2 COM GOTAS NO PARA BRISA?
COMO FAZER SISTEMA DE BHOP ESTILO CS ? (BUNNY HOP)
A Arma mudar de posição de acordo coma movimentação
[PEDIDO] Rig Simples para esse modelo.
[TUTORIAL] Acionar a vibração do dispositivo
[TUTORIAL] CONFIGURANDO O UNITY PARA COMPILAR PARA ANDROID
Animação no movimento do mouse
[___COMO UTILIZAR O FÓRUM___] Principais botões e suas funções
[RESOLVIDO] Colisor
[TUTORIAL] Unity 5 - Wheel Collider, veículos, suspensão realista.
[RESOLVIDO] Como faço um limitador de tiros por distância?
[RESOLVIDO] Mudar a proporção
[RESOLVIDO] Vuforia bug
Objetos (itens) pegos na cena anterior não são destruídos quando volta para ela
Codigo em Python para colocar Imagens em POT (Power Of Two) e .exe
[RESOLVIDO] Error depois de copilar para Android?
[JOGO ANDROID] PLANET DEFENSE
Sistema de IAP Paypal ou parecido
[RESOLVIDO] JOGO SAINDO (ANDROID)
{Equipe} Programador que tenha interesse de participar de uma JAM.
Como fazer Sistema Dia e Noite Segui o sistema de Hora
fazer script pegar arquivo de som, porem o som sera colocado apos a build...
[RESOLVIDO] Mover Plataforma
Formação de Equipe ( Favela Killer)
[TUTORIAL] Escolher a quantos FPS (fixos) o seu jogo deverá rodar.
[Devlog] Lost in the world (1.2_beta)
AJUDA COM SCRIPT DE SISTEMA QTE
Tilesets de Floresta em Pixel Art
[RESOLVIDO] Sistema de login
(UNITY 3D) Mesh Splitter - Como separar uma Mesh em multiplos Game Objects?
Como fazer um sistema de compra de itens?
[JOGO] Tetris em Unity - Para tutorial
Modulo Xbox One
[RESOLVIDO] Pegar e Jogar armas no chão (estilo CS 1.6)
[RESOLVIDO] Como apagar parte da grama do terreno para fazer uma calçada?
[RESOLVIDO] Erro ao Copilar: Bug no personagem.
[Opinião] 2d ou 3d?
Como é feito esse efeito?
Teaser 2 do meu jogo
Shader com efeito de dissolução
[TUTORIAL] Geração de Mesh procedural (estilo Minecraft)
[RESOLVIDO] Erro no Baú
Problema ao mudar sprite entre objetos por conta do uso de joystick
Unity 3d TELA PRETA
[Duvida] Como chamar uma void criada por mim, apenas em determinados momentos.
Corcle (Mobile) - Um jogo simples com um nome estranho.
Hoje à(s) 12:16 am
Ontem à(s) 11:21 pm
Ontem à(s) 10:32 pm
Ontem à(s) 7:59 pm
Ontem à(s) 7:42 pm
Ontem à(s) 7:31 pm
Ontem à(s) 7:11 pm
Ontem à(s) 3:17 pm
Ontem à(s) 7:31 am
Ontem à(s) 1:22 am
Ter Jan 22, 2019 10:33 pm
Ter Jan 22, 2019 6:25 pm
Ter Jan 22, 2019 6:05 pm
Ter Jan 22, 2019 6:02 pm
Ter Jan 22, 2019 12:02 pm
Ter Jan 22, 2019 11:58 am
Ter Jan 22, 2019 5:48 am
Seg Jan 21, 2019 12:04 pm
Seg Jan 21, 2019 11:57 am
Seg Jan 21, 2019 10:51 am
Seg Jan 21, 2019 10:46 am
Dom Jan 20, 2019 6:32 pm
Dom Jan 20, 2019 5:33 pm
Dom Jan 20, 2019 1:46 pm
Dom Jan 20, 2019 4:26 am
Sab Jan 19, 2019 4:48 pm
Sab Jan 19, 2019 8:26 am
Sab Jan 19, 2019 3:45 am
Qui Jan 17, 2019 9:23 pm
Qui Jan 17, 2019 7:10 pm
Qui Jan 17, 2019 2:24 am
Qui Jan 17, 2019 1:48 am
Qui Jan 17, 2019 1:28 am
Qua Jan 16, 2019 6:28 pm
Qua Jan 16, 2019 11:35 am
Ter Jan 15, 2019 10:57 pm
Ter Jan 15, 2019 9:51 pm
Ter Jan 15, 2019 8:20 pm
Ter Jan 15, 2019 5:22 pm
Ter Jan 15, 2019 4:09 pm
Ter Jan 15, 2019 3:50 pm
Ter Jan 15, 2019 2:06 pm
Ter Jan 15, 2019 1:50 pm
Ter Jan 15, 2019 12:26 pm
Ter Jan 15, 2019 10:49 am
Ter Jan 15, 2019 3:27 am
Ter Jan 15, 2019 3:23 am
Ter Jan 15, 2019 3:19 am
Ter Jan 15, 2019 3:15 am
Ter Jan 15, 2019 3:13 am
Ter Jan 15, 2019 3:06 am
Ter Jan 15, 2019 3:04 am
Ter Jan 15, 2019 2:58 am
Ter Jan 15, 2019 2:47 am
Ter Jan 15, 2019 2:39 am
Seg Jan 14, 2019 6:58 pm
Seg Jan 14, 2019 5:54 pm
Seg Jan 14, 2019 2:20 pm
Seg Jan 14, 2019 7:28 am
Dom Jan 13, 2019 6:19 pm
Dom Jan 13, 2019 9:52 am
Sab Jan 12, 2019 8:10 pm
Sab Jan 12, 2019 4:08 pm
Sab Jan 12, 2019 2:41 pm
Sex Jan 11, 2019 10:28 pm
Sex Jan 11, 2019 8:41 pm
Sex Jan 11, 2019 8:31 pm
Sex Jan 11, 2019 12:11 pm
Sex Jan 11, 2019 7:33 am
Sex Jan 11, 2019 2:18 am
Qui Jan 10, 2019 1:04 pm
Qui Jan 10, 2019 12:58 pm
Qui Jan 10, 2019 12:50 pm
Qui Jan 10, 2019 9:23 am
Qua Jan 09, 2019 9:33 pm
Qua Jan 09, 2019 2:47 am
Qua Jan 09, 2019 12:17 am
Qua Jan 09, 2019 12:02 am
Ter Jan 08, 2019 10:24 pm
Ter Jan 08, 2019 5:00 pm
Ter Jan 08, 2019 3:51 pm
Seg Jan 07, 2019 10:42 pm
Seg Jan 07, 2019 10:26 am
Seg Jan 07, 2019 12:43 am
Dom Jan 06, 2019 5:16 pm
Dom Jan 06, 2019 2:22 pm
Sex Jan 04, 2019 3:15 pm
Sex Jan 04, 2019 2:29 pm
Sex Jan 04, 2019 2:25 pm
Sex Jan 04, 2019 12:38 pm
Qui Jan 03, 2019 12:35 am
Qua Jan 02, 2019 9:46 pm
Qua Jan 02, 2019 8:56 pm
Qua Jan 02, 2019 6:48 pm
Qua Jan 02, 2019 5:32 pm
Qua Jan 02, 2019 2:34 pm
Qua Jan 02, 2019 11:17 am
Seg Dez 31, 2018 6:23 pm
Seg Dez 31, 2018 5:53 pm
MRX
DuViDoSo
Frits
Nalfam
richerd
AnderGames
NKKF
Zack2
Zack2
artplayer
DuViDoSo
RGMBrasil
mafipt
heitor
dstaroski
dstaroski
rafaelllsd
Zack2
francisco barroso
Zack2
Zack2
Phph09
vitorhugo
Daniel Pires da Silva
Madness
luiz12345
glauco
Joshuaaaa
MarcosSchultz
MayLeone
MarcosSchultz
bielTuvel
Skurb
zZAndersonZz
MayLeone
heitor
MarcosSchultz
rafaelllsd
henriquegames501
Daniel Dória
dstaroski
dstaroski
Duarte
NKKF
dstaroski
MarcosSchultz
MarcosSchultz
MarcosSchultz
MarcosSchultz
MarcosSchultz
MarcosSchultz
MarcosSchultz
MarcosSchultz
MarcosSchultz
MarcosSchultz
dstaroski
BRGC
Callyde Jr
Callyde Jr
TecnoGames
dstaroski
MayLeone
NKKF
bielTuvel
Priste_Hell
Callyde Jr
Wanderli
Andeton
Callyde Jr
MateusPignatti
Callyde Jr
NoobZ
AladoAlan
francisco barroso
luiz12345
speedluk
zeca urubu
Rafal
NKKF
Diego Felix
ismarspn
Zack2
Dom3000
henriquegames501
conceptfac
guimaraf
lhm
EricKBMS
5pntozero
Daniel Dória
Madness
Patrick
AnderGames
kalango studios games
EricKBMS
francisco barroso
dstaroski
MayLeone
PauloFR

[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 : 522
REPUTAÇÃO : 4
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.
NKKF
NKKF
ProgramadorMaster

Masculino PONTOS : 2182
REPUTAÇÃO : 429
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]{}
}



fecirineu
fecirineu
ProgramadorMaster

Masculino PONTOS : 1424
REPUTAÇÃO : 133
Á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 : 522
REPUTAÇÃO : 4
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