當前位置: 首頁>>代碼示例>>C#>>正文


C# UnityEngine.NetworkViewID類代碼示例

本文整理匯總了C#中UnityEngine.NetworkViewID的典型用法代碼示例。如果您正苦於以下問題:C# NetworkViewID類的具體用法?C# NetworkViewID怎麽用?C# NetworkViewID使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NetworkViewID類屬於UnityEngine命名空間,在下文中一共展示了NetworkViewID類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的UnityEngine.NetworkViewID類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。