本文整理汇总了C#中PhotonView类的典型用法代码示例。如果您正苦于以下问题:C# PhotonView类的具体用法?C# PhotonView怎么用?C# PhotonView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PhotonView类属于命名空间,在下文中一共展示了PhotonView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResultOn
public void ResultOn()
{
ResultActvie = true;
Ending.SetActive (false);
Canvas.GetComponent<Animator>().SetTrigger("OnResultStart");
AudioManager.Instance.PlayBGM(win ? "resultclearbgm" : "resultfailbgm", 0.5f);
GameObject.Find ("MyResultText").GetComponent<Text> ().text =
(GameManager.instance.CorrectAnswerNum + GameManager.instance.IncorrectAnswerNum).ToString ()
+ "もん中、\n" + GameManager.instance.CorrectAnswerNum.ToString() + "もんせいかい!";
myPv = this.GetComponent<PhotonView>();
memberCorrectAnswerNum = new Dictionary<string, int>();
memberInCorrectAnswerNum = new Dictionary<string, int>();
myPv.RPC ("SetMemberAnswerNum", PhotonTargets.All, GameManager.instance.name, GameManager.instance.CorrectAnswerNum, GameManager.instance.IncorrectAnswerNum);
GameObject.Find("HpGuage").transform.localScale = new Vector3(1, (GameManager.instance.BossHp > GameManager.instance.Score)? (float)(GameManager.instance.BossHp - GameManager.instance.Score) / GameManager.instance.BossHp : 0, 1);
if (win) {
GameObject.Find ("BackGround").GetComponent<Image> ().sprite = backgroundWin;
GameObject.Find ("Title").GetComponent<Image> ().sprite = titleWin;
GameObject.Find ("Enemy").GetComponent<Image> ().sprite = enemyWin[GameManager.instance.SelectLevel];
} else {
GameObject.Find ("BackGround").GetComponent<Image> ().sprite = backgroundLose;
GameObject.Find ("Title").GetComponent<Image> ().sprite = titleLose;
GameObject.Find ("Enemy").GetComponent<Image> ().sprite = enemyLose[GameManager.instance.SelectLevel];
}
}
示例2: Awake
void Awake()
{
cannon = (GameObject)Resources.Load("Cannon");
fireSfx = Resources.Load<AudioClip>("CannonFire");
sfx = GetComponent<AudioSource>();
pv = GetComponent<PhotonView>();
}
示例3: Start
void Start()
{
m_CharacterController = GetComponent<CharacterController>();
m_Animator = GetComponent<Animator>();
m_PhotonView = GetComponent<PhotonView>();
m_TransformView = GetComponent<PhotonTransformView>();
}
示例4: Awake
public void Awake()
{
time = Time.time;
Loaded = false;
mGen = GetComponent<MapGeneration> (); //new MapGeneration();
pFind = GetComponent<AStar> ();
photonView = GetComponent<PhotonView> ();
seed = 0;
if (PhotonNetwork.isMasterClient) {
seed = Random.seed;
for (int i = -4; i <= 4; ++i) {
for(int j = -4; j <= 4; ++j){
mGen.GenerateBlock (i, j, seed, 0, 0);
}
}
mGen.CreateGrid(0, 0);
Loaded = true;
lastX = 0;
lastY = 0;
}
// in case we started this demo with the wrong scene being active, simply load the menu scene
if (!PhotonNetwork.connected)
{
Application.LoadLevel(Menu.SceneNameMenu);
return;
}
// we're in a room. spawn a character for the local player. it gets synced by using PhotonNetwork.Instantiate
playerObject = PhotonNetwork.Instantiate(this.playerPrefab.name, transform.position, Quaternion.identity, 0);
playerController = playerObject.GetComponent<ThirdPersonController> ();
}
示例5: Awake
void Awake()
{
logger = Logger.GetInstance();
jobsData = Jobs.GetInstance();
ressources = Ressources.GetInstance();
pView = GameObject.FindWithTag("Attackers").GetComponent<PhotonView>();
}
示例6: Start
void Start()
{
photonView = gameObject.GetComponent<PhotonView>();
playerHealth = GetComponent<Health>().health;
anim = GetComponent<Animator>();
}
示例7: Start
// Use this for initialization
void Start()
{
if (photonView == null)
photonView = GetComponent<PhotonView>();
sendFrame = 60 / PhotonNetwork.sendRate;
}
示例8: Start
void Start () {
pView = GetComponent<PhotonView>();
rc = GetComponent<RocketControl>();
if(pView.isMine)
Respawn();
}
示例9: Start
// Use this for initialization
void Start()
{
view = GetComponent <PhotonView> (); //get the player's photon view
name = view.owner.name; //set the name to the owner of this object's photon view
textMesh = gameObject.transform.FindChild ("TextMesh").gameObject;
textMesh.GetComponent<TextMesh> ().text = name;
}
示例10: Awake
void Awake()
{
playerAudio = transform.parent.GetComponent<PlayerAudio>();
jetpackParticles = transform.FindChild("Particle Emitter").GetComponent<ParticleSystem>();
playerAnimPhotonView = GetComponent<PhotonView>();
}
示例11: OnTriggerEnter
void OnTriggerEnter(Collider other){
photonView = gameObject.GetComponent<PhotonView> ();
// Debug.Log ("OnTriggerEnter");
if (other.tag == "Spell") {
elementType otherElement = other.GetComponent<SpellCollision>().elementType;
string element = CreateString(elementType, true);
string elementOpposing = CreateString(otherElement, true);
WeAreColliding (element, elementOpposing);
}
if (other.tag == "Shield") {
elementType otherElement = other.GetComponent<ShieldElement>().elementType;
string element = CreateString(elementType, false);
string elementOpposing = CreateString(otherElement, false);
WeAreColliding (element, elementOpposing);
}
if (other.tag == "PlayerCollision" && time + 1f < Time.time) {
// score
if (photonView.isMine) {
GameManager.instance.player.RemoveSpell(id);
Debug.Log("Removed MY SPELL");
}
}
}
示例12: Start
/// <summary>
/// Gets all necessary references.
/// </summary>
void Start()
{
photonView = this.GetComponent<PhotonView>();
myTower = this.GetComponent<TowerManager>();
isMine = photonView.isMine;
}
示例13: Start
/// <summary>
/// Gets all necessary references.
/// </summary>
void Start()
{
photonView = this.GetComponent<PhotonView>();
myBullet = this.GetComponent<Bullet>();
isMine = photonView.isMine;
}
示例14: OnJoinedRoom
void OnJoinedRoom()
{
GameObject monster = PhotonNetwork.Instantiate("monsterprefab", Vector3.zero, Quaternion.identity, 0);
ThirdPersonController controller = monster.GetComponent<ThirdPersonController>();
myMonsterPv = monster.GetComponent<PhotonView>();
controller.enabled = true;
}
示例15: Awake
void Awake ()
{
pv = GetComponent<PhotonView>();
CreateTank();
PhotonNetwork.isMessageQueueRunning = true;
GetConnectPlayerCount();
}