Пример #1
0
 void InfectNpc(NonPlayerCharacter npc)
 {
     // Let the npc know it will be controlled by this player from now on
     npc.photonView.RequestOwnership();
     // Store spawner for eventual transfer back to parasite
     CharacterSpawner.SetCharacter(npc);
     npc.SetName(characterName, false);
     // Set isInfected to true/update sprite on new authority's client
     npc.Infect(input);
     // Update client's camera and render settings to reflect new character
     npc.SetCameraFollow(false);
     npc.SetRenderLayer();
     UiManager.Instance.ActivateControls(CharacterType.NPC);
     UiManager.Instance.minimap.SetTarget(npc.transform);
     npc.gameObject.AddComponent <AudioListener>();
 }