本文整理汇总了C#中PlayerManager类的典型用法代码示例。如果您正苦于以下问题:C# PlayerManager类的具体用法?C# PlayerManager怎么用?C# PlayerManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlayerManager类属于命名空间,在下文中一共展示了PlayerManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Awake
// called when object instantiated
void Awake() {
layerMask = ~(1 << LayerMask.NameToLayer("Player"));
camera = Camera.main.transform;
aim = GetComponent<PlayerAimBehaviour>();
manager = GetComponent<PlayerManager>();
}
示例2: setUniverse
// Called in Bridge.cs
public void setUniverse(int num)
{
Debug.Log("Universe Sent " + num);
universeNum = num;
// Get the origin of the set Universe
Vector3 origin = GameObject.Find("Universe" + num + "/Managers/OriginManager").GetComponent<Universe>().origin;
Debug.Log(num + "Universe " + origin);
// Set camPos to bgPos + 1000 to z
Vector3 camPos = new Vector3(origin.x, origin.y, origin.z + 0.1f);
Debug.Log("camera positons " + camPos);
Camera = (Transform)Instantiate(camPrefab, camPos, new Quaternion(0, 0, 0, 0));
Camera.name = "Camera " + num;
// It is the first time this function has been called
if (characterNum == 99)
{
characterNum = universeNum;
Log.Note("Activate initial");
playerMovement = GameObject.Find("Character" + num).GetComponent<PlayerMovement>();
playerMovement.activateCharacter(num, num);
playerManager = GameObject.Find("Character" + num).GetComponent<PlayerManager>();
playerManager.activateCharacter(num);
FiringHandler fireHandler = GameObject.Find("Character" + num).GetComponent<FiringHandler>();
fireHandler.activateCharacter(num);
}
playerManager.universeNumber = num;
}
示例3: Start
void Start()
{
if (!player)
{
player = GameObject.Find("Player").GetComponent<PlayerManager>();
}
}
示例4: Start
// Use this for initialization
void Start()
{
playerManager = GameObject.Find("PlayerManager").GetComponent<PlayerManager>();
activeController = playerManager.GetActivePlayer().GetComponent<PlayerController>();
controllerName = activeController.GetControllerName();
}
示例5: Awake
// Use this for initialization
void Awake()
{
Debug.Assert(SaveGameEventSubscription == null && AutoSaveGameEventSubscription == null);
SaveGameEventSubscription= MessageHub.Subscribe<SaveGameEvent>(SaveGame);
AutoSaveGameEventSubscription = MessageHub.Subscribe<AutoSaveGameEvent>(AutoSaveGame);
mapData = new CollectedMapData();
space = GameObject.Find("Space").GetComponent<Space>();
if (space == null)
{
throw new MissingComponentException("Unable to find Space. The big bang doesn't have enough space to happen. The 'Space' game object also needs to be added to the level and have the space script attached.");
}
airTrafficControl = GameObject.Find("AirTrafficControl").GetComponent<AirTrafficControl>();
if (space == null)
{
throw new MissingComponentException("Unable to find AirTrafficControl. There can't be any troops flying around without an global AirTrafficControl GameObject that has an AirTrafficControl Script attached.");
}
gameState = GameObject.Find("2D_MainCam").GetComponent<GameState>();
if (gameState == null)
{
throw new MissingComponentException("Unable to find GameState. The 'GameState' script needs to be attached to the same Gameobject as the BigBang.");
}
playerManager = GameObject.Find("PlayerManagement").GetComponent<PlayerManager>();
if (playerManager == null)
{
throw new MissingComponentException("Unable to find playerManager.");
}
}
示例6: Awake
void Awake()
{
canvas = GetComponent<Canvas> ();
listView = GetComponentInChildren<ListView> ();
roomTimeManager = GameObject.FindGameObjectWithTag ("RoomTimeManager").GetComponent<RoomTimeManager> ();
playerManager = GameObject.FindGameObjectWithTag ("PlayerManager").GetComponent<PlayerManager> ();
}
示例7: TakeDamage
public void TakeDamage(int amount, PlayerManager from) {
if (!isServer || !m_IsAlive)
return;
if (m_CurrentShield > 0) {
m_CurrentShield -= amount;
amount = (m_CurrentShield > 0) ? 0 : Mathf.Abs (m_CurrentShield);
}
m_CurrentHealth -= amount;
if(m_CurrentHealth <= 0){
from.GetKills++;
GameManager.s_Instance.RpcUpdateStatus ();
m_CurrentHealth = m_BaseHealth;
RpcSetPlayerctive (false);
switch (GameManager.m_MatchMode) {
case 0:
StartCoroutine(SetRespawn());
break;
case 1:
break;
}
RpcExplode ();
}
}
示例8: Awake
// Use this for initialization
void Awake () {
Player = GameObject.Find ("Player");
PlayerInventory = Player.transform.FindChild ("Inventory").GetComponent<Inventory> ();
CharacterContener = Player.transform.FindChild ("Equipement").gameObject;
PlayerHealth = Player.GetComponent<PlayerManager> ();
}
示例9: Initialize
/// <summary>
/// Gets all necessary references.
/// </summary>
public void Initialize()
{
photonView = this.GetComponent<PhotonView>();
myPlayer = this.GetComponent<PlayerManager>();
isMine = photonView.isMine;
}
示例10: IndicatorManager
public IndicatorManager(PlayerManager playerManager, ContentManager content)
{
foreach (Player player in playerManager.Players)
{
nameDrawers.AddFirst(new NameDrawer(player, content));
Texture2D barTexture = content.Load<Texture2D>("Scene/Game/stockbar1p");
Texture2D stockTexture = content.Load<Texture2D>("Scene/Game/stock1p");
if (stockDrawers.Count == 0)
{
barTexture = content.Load<Texture2D>("Scene/Game/stockbar1p");
stockTexture = content.Load<Texture2D>("Scene/Game/stock1p");
}
if (stockDrawers.Count == 1)
{
barTexture = content.Load<Texture2D>("Scene/Game/stockbar2p");
stockTexture = content.Load<Texture2D>("Scene/Game/stock2p");
}
if (stockDrawers.Count == 2)
{
barTexture = content.Load<Texture2D>("Scene/Game/stockbar3p");
stockTexture = content.Load<Texture2D>("Scene/Game/stock3p");
}
if (stockDrawers.Count == 3)
{
barTexture = content.Load<Texture2D>("Scene/Game/stockbar4p");
stockTexture = content.Load<Texture2D>("Scene/Game/stock4p");
}
stockDrawers.AddFirst(new StockDrawer(player, stockDrawers.Count, barTexture, stockTexture));
}
timer = new Timer(content);
}
示例11: Start
// Use this for initialization
void Start()
{
cm = GameObject.Find ("Configuration").GetComponent <ConfigManager>();// GetComponent<ConfigManager> ();
pm = GameObject.Find("Player").GetComponent<PlayerManager>();
pufferSlider.maxValue = (float)Double.Parse(cm.Load ("MaxPufferCharge"));;
breathSlider.maxValue = (float)Double.Parse(cm.Load ("MaxBreath"));
}
示例12: Start
public Animator anim; // The animator component from the player.
public void Start()
{
playerManager = GetComponent<PlayerManager>();
playerController = GetComponent<PlayerController>();
playerAttack = GetComponent<PlayerAttack>();
anim = GetComponent<Animator>();
}
示例13: Start
void Start()
{
manager = GameObject.Find("PlayerManager").GetComponent<PlayerManager>();
shooter = gameObject.GetComponent<myShooter>();
shooter.SetShooitngInfo(shooting_way, shooting_amount, shooting_repeat, shooting_period, shooting_delay, shooting_angle);
SetBullet();
}
示例14: Awake
private float m_timer; //(秒)
#endregion Fields
#region Methods
//初期化===================================================================
void Awake()
{
base.m_doNotPause = true;
//PlayerManager取得----------------------------------------------------
m_PlyMgr = GameObject.FindObjectOfType<PlayerManager>();
}
示例15: PlayerManager
public PlayerManager()
{
//DontDestroyOnLoad(this);
singleton = this;
playerDict = new Dictionary<int, Player>();
connectionDict = new Dictionary<int, NetworkConnection>();
}