• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# UnityEngine.NetworkViewID类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UnityEngine.NetworkViewID的典型用法代码示例。如果您正苦于以下问题:C# NetworkViewID类的具体用法?C# NetworkViewID怎么用?C# NetworkViewID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NetworkViewID类属于UnityEngine命名空间,在下文中一共展示了NetworkViewID类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Attacked

    void Attacked(NetworkViewID id, NetworkViewID target, Vector3 hit)
    {
        GameObject attacker = NetworkView.Find(id).gameObject;
        GameObject other = NetworkView.Find(target).gameObject;
        LineRenderer line = attacker.GetComponent<LineRenderer>();

        line.enabled = true;
        line.SetPosition(1, hit);
        line.material.SetColor("_Color", Color.red);
        timer = 0;

        Collider[] effected = Physics.OverlapSphere(hit, explosionRad);

        if (Network.isServer)
        {
            for (int i = 0; i < effected.Length; i++)
            {
                //effected[i].gameObject.rigidbody.AddExplosionForce(explosionForce, hit, explosionRad);
            }
        }

        GameObject.Instantiate(explosionPrefab, hit, Quaternion.identity);

        if (id != target && other.networkView.isMine)
            other.GetComponent<CombatScript>().AlterHealth(-1);
    }
开发者ID:Ckeds,项目名称:PortfolioWorks,代码行数:26,代码来源:AttackerScript.cs


示例2: NetLightCampfire

	void NetLightCampfire(NetworkViewID nvid, bool state) {
		if (nvid == networkView.viewID) {
			Flame.SetActive(state);
			Coals.SetActive(state);
			SFX.SetActive(state);
		}
	}
开发者ID:polecatqcon,项目名称:TheReturn,代码行数:7,代码来源:Campfire.cs


示例3: Player

 public Player(NetworkPlayer _NetClient, NetworkViewID _NetViewID, PlayerInputDevice _LocalPlayerInput)
 {
     m_NetClient = _NetClient;
     m_NetViewID = _NetViewID;
     m_LocalPlayerInput = _LocalPlayerInput;
     m_PlayerInstance = null;
 }
开发者ID:mhoulier,项目名称:unity3d_template,代码行数:7,代码来源:PlayerManager.cs


示例4: changeColor

 public void changeColor(Vector3 colorVector, NetworkViewID ID1, NetworkViewID ID2, NetworkViewID ID3)
 {
     Color color=new Color(colorVector.x,colorVector.y,colorVector.z);
     NetworkView.Find(ID1).renderer.material.color=color;
     NetworkView.Find(ID2).renderer.material.color=color;
     NetworkView.Find(ID3).renderer.material.color=color;
 }
开发者ID:T3H40,项目名称:Worldofwartanks,代码行数:7,代码来源:Tank.cs


示例5: InstantiateTowerBulletOnClient

 private void InstantiateTowerBulletOnClient(NetworkViewID bulletID)
 {
     TowerReloaderClient reloader = tower.GetComponent<TowerReloaderClient>();
     reloader.bullet = Instantiate(
         reloader.bulletPrefabClient, reloader.spawner.position, reloader.spawner.rotation) as Transform;
     reloader.bullet.networkView.viewID = bulletID;
 }
开发者ID:Burzok,项目名称:GodlyCubes,代码行数:7,代码来源:SpawnTowerClient.cs


示例6: OnPickUp

 public void OnPickUp(NetworkViewID owner, NetworkViewID parentId)
 {
     stoneRigidbody.isKinematic = true;
     gameObject.layer = 11;
     ParentToPlayerTransform(parentId);
     transform.localPosition = new Vector3(-0.35f,-0.35f,-1.0f);
 }
开发者ID:kitun,项目名称:Stoned,代码行数:7,代码来源:Stone.cs


示例7: ChangePlayerCrystalColor

    void ChangePlayerCrystalColor(int aquiredType, NetworkViewID crystalPlayerID)
    {
        CrystalType crystal = (CrystalType)aquiredType;
        GameObject player = playerList.FindPlayer(ref crystalPlayerID);
        crystalRenderer = player.transform.Find("Animator").Find("Crystals").GetComponent<Renderer>();

        if (crystal == CrystalType.Strength) {
            crystalRenderer.material = crystalMaterials[0];

            gameObject.GetComponent<PlayerData>().color.x = crystalMaterials[0].color.r;
            gameObject.GetComponent<PlayerData>().color.y = crystalMaterials[0].color.g;
            gameObject.GetComponent<PlayerData>().color.z = crystalMaterials[0].color.b;
        }

        if (crystal == CrystalType.Wisdom) {
            crystalRenderer.material = crystalMaterials[1];

            gameObject.GetComponent<PlayerData>().color.x = crystalMaterials[1].color.r;
            gameObject.GetComponent<PlayerData>().color.y = crystalMaterials[1].color.g;
            gameObject.GetComponent<PlayerData>().color.z = crystalMaterials[1].color.b;
        }

        if (crystal == CrystalType.Hardness) {
            crystalRenderer.material = crystalMaterials[2];

            gameObject.GetComponent<PlayerData>().color.x = crystalMaterials[2].color.r;
            gameObject.GetComponent<PlayerData>().color.y = crystalMaterials[2].color.g;
            gameObject.GetComponent<PlayerData>().color.z = crystalMaterials[2].color.b;
        }
    }
开发者ID:Burzok,项目名称:GodlyCubes,代码行数:30,代码来源:CrystalColorClient.cs


示例8: InstantiateBaseOnClient

    private void InstantiateBaseOnClient(NetworkViewID baseID)
    {
        gameBase = Instantiate(basePrefabClient, transform.position, transform.rotation) as Transform;
        gameBase.networkView.viewID = baseID;

        SetTeamInfoOnClient();
    }
开发者ID:Burzok,项目名称:GodlyCubes,代码行数:7,代码来源:SpawnBaseClient.cs


示例9: SpawnPowerLocally

	void SpawnPowerLocally(int type, Vector3 position, float angle, NetworkViewID optionalViewID){
		PowerSpawn requestedSpawn = new PowerSpawn();
		requestedSpawn.type = (PowerType)type;
		requestedSpawn.position = position;
		requestedSpawn.angle = angle;
		SpawnPowerLocally(requestedSpawn, optionalViewID);
	}
开发者ID:RobbSteel,项目名称:Lords-of-Distortion,代码行数:7,代码来源:OfflineArena.cs


示例10: NetworkViewAllocator_ResponseViewID

    void NetworkViewAllocator_ResponseViewID(NetworkViewID _viewID, string _requestID)
    {
        AllocationJob _allocationJob;

        if (! mAllocateRequests.TryGetValue(_requestID, out _allocationJob))
        {
            Debug.Log("The request has been canceled.");
            return;
        }

        var _networkView = _allocationJob.networkView;
        if (_networkView != null)
        {
            mAllocationBuffer[_requestID] = _viewID;
            _networkView.viewID = _viewID;
            if (_allocationJob.callback != null)
                _allocationJob.callback();
        }
        else
        {
            Debug.Log("Network viewID is allocated but target view does not exist anymore.");
        }

        mAllocateRequests.Remove(_requestID);
    }
开发者ID:JamesKim2998,项目名称:snugdc-project-ricochet,代码行数:25,代码来源:NetworkViewAllocator.cs


示例11: ChangePlayerState

 void ChangePlayerState(NetworkViewID viewID)
 {
     if(networkView.viewID == viewID) {
         this.transform.position = data.respawnPosition;
         data.stats.currentHealth = data.stats.maxHealth;
     }
 }
开发者ID:Burzok,项目名称:GodlyCubes,代码行数:7,代码来源:CombatController.cs


示例12: SetPlayerTeam

    public static void SetPlayerTeam(NetworkViewID playerID, int layer)
    {
        if (StopSend())
            return;

        Channel.networkView.RPC("SetPlayerTeamRPC", RPCMode.Others, playerID, layer);
    }
开发者ID:Game-Group,项目名称:dog-fighter,代码行数:7,代码来源:PlayerRPC.cs


示例13: SendChatMessage

 void SendChatMessage(string msg, NetworkViewID player)
 {
     string sender = playerData.GetPlayerData(player).playerName;
     msg = sender + ": " + msg;
     chatBox.Add(msg);
     scrollPos.y = float.MaxValue;
 }
开发者ID:Zatchmeister,项目名称:Dias,代码行数:7,代码来源:ChatRoomScript.cs


示例14: TryEnterVessel

 void TryEnterVessel(NetworkViewID playerViewID)
 {
     if (!rider && !playerViewID.GetGameObject().GetComponent<VesselController>())
     {
         networkView.RPC("CommitEnterVessel", RPCMode.All, playerViewID);
     }
 }
开发者ID:BrendanMulcahy,项目名称:IronStrife,代码行数:7,代码来源:DreamVessel.cs


示例15: CharacterSpawner_RequestSpawn

 void CharacterSpawner_RequestSpawn(NetworkViewID _viewID, string _player, int _characterID, Vector3 _position)
 {
     //		Debug.Log("Spawn character network.");
     var _character = SpawnLocal(Global.Player()[_player], _characterID, _position);
     _character.networkView.enabled = true;
     _character.networkView.viewID = _viewID;
 }
开发者ID:JamesKim2998,项目名称:snugdc-project-ricochet,代码行数:7,代码来源:CharacterSpawner.cs


示例16: addAllComponents

    void addAllComponents(GameObject obj, NetworkViewID viewID, Vector3 coliderSize, Vector3 coliderCenter, AudioClip clip)
    {
        BoxCollider colider = obj.AddComponent<BoxCollider>();
        colider.size = coliderSize;
        colider.center = coliderCenter;

        AudioSource audio = obj.AddComponent<AudioSource>();
        audio.loop = true;

        audio.clip = clip;//clip;
        audio.enabled = false;

        UserManagementObjectController controller = obj.AddComponent<UserManagementObjectController> ();
        controller.accessGrantedName = "player2";
        //RPC Methode unten vielleicht
        //this.networkView.RPC("setAccessGrantedPlayer", RPCMode.Server, 0);
        controller.setAccessGrantedPlayer ();

        NetworkView net = obj.AddComponent<NetworkView> ();
        net.observed = controller;

        net.viewID = viewID;

        Rigidbody rigid = obj.AddComponent<Rigidbody> ();
        rigid.useGravity = false;
        rigid.isKinematic = true;

        AnimationScript anime = obj.AddComponent<AnimationScript> ();
        anime.currentGameObj = obj;
        anime.enabled = false;

        obj.AddComponent<MeshRenderer> ();
    }
开发者ID:usharingan,项目名称:VRUE_Projekt,代码行数:33,代码来源:SpawnInstrumentController.cs


示例17: controlSelectedObjects

    public override bool controlSelectedObjects(bool select, NetworkViewID viewID, NetworkMessageInfo info)
    {
        if (isObjectAccessGranted(info.sender))
        {
            if (base.controlSelectedObjects(select,viewID,info))
            {
                /* ------------------ VRUE Tasks START   -------------------
                 *	- set the current NetworkPlayer to the player calling the RPC-method or
                 *	the default NetworkPlayer depending on "select"
                ----------------------------------------------------------------- */

                //return true;//replace me

                if (select)
                {
                    currentAccessPlayer = info.sender;
                }
                else
                {
                    currentAccessPlayer = defaultAccessPlayer;
                }
                return true;

                // ------------------ VRUE Tasks END ----------------------------

            }
        }
        return false;
    }
开发者ID:floschu,项目名称:VRUE_Projekt,代码行数:29,代码来源:ExclusiveAccessObjectController.cs


示例18: OnSetposition

	public void OnSetposition(Vector3 pos, NetworkViewID id){
		if(id==Player.GetComponent<NetworkView>().viewID){
			Player.GetComponent<NavMeshAgent>().SetDestination(pos);
			Debug.Log("receved pos message");
		}
			
	}
开发者ID:dingxiaowei,项目名称:UnityNetWorkView,代码行数:7,代码来源:netPlayerController.cs


示例19: RPCAddNetworkView

 public void RPCAddNetworkView(NetworkViewID id)
 {        
     NetworkView nw = this.gameObject.AddComponent<NetworkView>();
     nw.group = (int)Group.RPCAssignID;
     nw.observed = null;
     nw.stateSynchronization = NetworkStateSynchronization.ReliableDeltaCompressed;
     nw.viewID = id;
 }
开发者ID:ConnectDeveloper01,项目名称:dorumon,代码行数:8,代码来源:CarController.cs


示例20: SetCube

 private void SetCube(NetworkViewID id, float amountRed, float amountBlue)
 {
     GameObject cube = NetworkView.Find(id).gameObject;
     PG_Cube cubeScript = cube.GetComponent<PG_Cube>();
     cubeScript.amountRed = amountRed;
     cubeScript.amountBlue = amountBlue;
     cubeScript.SetColor(null);
 }
开发者ID:bdjnk,项目名称:Paint-the-Town,代码行数:8,代码来源:PlayerSetup.cs



注:本文中的UnityEngine.NetworkViewID类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UnityEngine.Object类代码示例发布时间:2022-05-26
下一篇:
C# UnityEngine.NetworkPlayer类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap