本文整理汇总了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);
}
示例2: NetLightCampfire
void NetLightCampfire(NetworkViewID nvid, bool state) {
if (nvid == networkView.viewID) {
Flame.SetActive(state);
Coals.SetActive(state);
SFX.SetActive(state);
}
}
示例3: Player
public Player(NetworkPlayer _NetClient, NetworkViewID _NetViewID, PlayerInputDevice _LocalPlayerInput)
{
m_NetClient = _NetClient;
m_NetViewID = _NetViewID;
m_LocalPlayerInput = _LocalPlayerInput;
m_PlayerInstance = null;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
}
示例8: InstantiateBaseOnClient
private void InstantiateBaseOnClient(NetworkViewID baseID)
{
gameBase = Instantiate(basePrefabClient, transform.position, transform.rotation) as Transform;
gameBase.networkView.viewID = baseID;
SetTeamInfoOnClient();
}
示例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);
}
示例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);
}
示例11: ChangePlayerState
void ChangePlayerState(NetworkViewID viewID)
{
if(networkView.viewID == viewID) {
this.transform.position = data.respawnPosition;
data.stats.currentHealth = data.stats.maxHealth;
}
}
示例12: SetPlayerTeam
public static void SetPlayerTeam(NetworkViewID playerID, int layer)
{
if (StopSend())
return;
Channel.networkView.RPC("SetPlayerTeamRPC", RPCMode.Others, playerID, layer);
}
示例13: SendChatMessage
void SendChatMessage(string msg, NetworkViewID player)
{
string sender = playerData.GetPlayerData(player).playerName;
msg = sender + ": " + msg;
chatBox.Add(msg);
scrollPos.y = float.MaxValue;
}
示例14: TryEnterVessel
void TryEnterVessel(NetworkViewID playerViewID)
{
if (!rider && !playerViewID.GetGameObject().GetComponent<VesselController>())
{
networkView.RPC("CommitEnterVessel", RPCMode.All, playerViewID);
}
}
示例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;
}