本文整理汇总了C#中PhotonView类的典型用法代码示例。如果您正苦于以下问题:C# PhotonView类的具体用法?C# PhotonView怎么用?C# PhotonView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PhotonView类属于命名空间,在下文中一共展示了PhotonView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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];
}
}
开发者ID:nmrtkhs,项目名称:teacherHunting,代码行数:30,代码来源:ResultScene.cs
示例2: Awake
void Awake()
{
cannon = (GameObject)Resources.Load("Cannon");
fireSfx = Resources.Load<AudioClip>("CannonFire");
sfx = GetComponent<AudioSource>();
pv = GetComponent<PhotonView>();
}
开发者ID:masterbba,项目名称:Unity3D_Stduy_and_Test,代码行数:7,代码来源:FireCannon.cs
示例3: Start
void Start()
{
m_CharacterController = GetComponent<CharacterController>();
m_Animator = GetComponent<Animator>();
m_PhotonView = GetComponent<PhotonView>();
m_TransformView = GetComponent<PhotonTransformView>();
}
开发者ID:yuvadius,项目名称:need4bit,代码行数:7,代码来源:RPGMovement.cs
示例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> ();
}
开发者ID:hompoth,项目名称:FlingWhale,代码行数:31,代码来源:InGame.cs
示例5: Awake
void Awake()
{
logger = Logger.GetInstance();
jobsData = Jobs.GetInstance();
ressources = Ressources.GetInstance();
pView = GameObject.FindWithTag("Attackers").GetComponent<PhotonView>();
}
开发者ID:LeSphax,项目名称:Famine,代码行数:7,代码来源:RaidManager.cs
示例6: Start
void Start()
{
photonView = gameObject.GetComponent<PhotonView>();
playerHealth = GetComponent<Health>().health;
anim = GetComponent<Animator>();
}
开发者ID:Darkchicken,项目名称:SeniorProjectRPG,代码行数:7,代码来源:NetworkEnemyScript.cs
示例7: Start
// Use this for initialization
void Start()
{
if (photonView == null)
photonView = GetComponent<PhotonView>();
sendFrame = 60 / PhotonNetwork.sendRate;
}
开发者ID:KenReaGameDev,项目名称:Apparent-Horizon,代码行数:8,代码来源:PositionPredict.cs
示例8: Start
void Start () {
pView = GetComponent<PhotonView>();
rc = GetComponent<RocketControl>();
if(pView.isMine)
Respawn();
}
开发者ID:Blueteak,项目名称:SWEngFinal,代码行数:7,代码来源:RocketHealth.cs
示例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;
}
开发者ID:DanHarasymiw,项目名称:COSC4087-Gladiator-Scripts,代码行数:8,代码来源:PlayerLabel.cs
示例10: Awake
void Awake()
{
playerAudio = transform.parent.GetComponent<PlayerAudio>();
jetpackParticles = transform.FindChild("Particle Emitter").GetComponent<ParticleSystem>();
playerAnimPhotonView = GetComponent<PhotonView>();
}
开发者ID:NoManAlone,项目名称:No-Man-Alone-Vertical-Slice---Scripts,代码行数:7,代码来源:JetpackBehaviours.cs
示例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");
}
}
}
开发者ID:MiloBuwalda,项目名称:wizard,代码行数:25,代码来源:SpellCollision.cs
示例12: Start
/// <summary>
/// Gets all necessary references.
/// </summary>
void Start()
{
photonView = this.GetComponent<PhotonView>();
myTower = this.GetComponent<TowerManager>();
isMine = photonView.isMine;
}
开发者ID:dearzhangle,项目名称:UNION-OpenSource-MOBA,代码行数:10,代码来源:TowerNetworkLayer.cs
示例13: Start
/// <summary>
/// Gets all necessary references.
/// </summary>
void Start()
{
photonView = this.GetComponent<PhotonView>();
myBullet = this.GetComponent<Bullet>();
isMine = photonView.isMine;
}
开发者ID:dearzhangle,项目名称:UNION-OpenSource-MOBA,代码行数:10,代码来源:BulletNetworkLayer.cs
示例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;
}
开发者ID:micha224,项目名称:Jan_1GAM,代码行数:7,代码来源:RandomMatchmaker.cs
示例15: Awake
void Awake ()
{
pv = GetComponent<PhotonView>();
CreateTank();
PhotonNetwork.isMessageQueueRunning = true;
GetConnectPlayerCount();
}
开发者ID:masterbba,项目名称:Unity3D_Stduy_and_Test,代码行数:7,代码来源:GameMgr.cs
示例16: Start
void Start()
{
photonView = GetComponent<PhotonView> ();
NAMEPLATE = gameObject.GetComponent<TextMesh>();
playerName = GetComponentInParent<PlayerStatus> ().playerName;
photonView.RPC ("setName", PhotonTargets.All, playerName);
}
开发者ID:tunderix,项目名称:LittleFishers,代码行数:7,代码来源:namePlate.cs
示例17: Start
// Use this for initialization
void Start ()
{
bmr = FindObjectOfType<BulletManager>();
pv = GetComponent<PhotonView>();
baseCD = BulletCD;
//canShoot = GetComponent<RocketControl>().canMove;
}
开发者ID:Blueteak,项目名称:SWEngFinal,代码行数:8,代码来源:RocketShoot.cs
示例18: Start
void Start()
{
base.Start();
nav = this.GetComponent<NavMeshAgent>();
anim = this.GetComponent<Animator>();
photonView = this.GetComponent<PhotonView>();
myPlayerCam = NetworkManager.myChampionGO.transform.FindChild("Main Camera").camera;
healthBar = prox.gameObject.transform.FindChild ("Progress Bar").gameObject.GetComponent<UISlider>();
maxHealth = 50;
health = maxHealth;
attackDamage = Random.Range(5f, 10f);
nav.speed = movementSpeed;
nav.destination = destination;
// Minion team text indicator
GetComponentInChildren<TextMesh>().text = team.ToString();
GetComponentInChildren<TextMesh>().color = (team == 0) ? Color.red : Color.blue;
//Final destination for any minion is the base of the opponent team
finalDestination = (team == 0) ? new Vector3(128, 14, 128) : new Vector3(-128, 14, -128);
if (team == 0) {
transform.FindChild("Indic").transform.renderer.material.color = Color.red;
} else {
transform.FindChild("Indic").transform.renderer.material.color = Color.blue;
}
}
开发者ID:andeart,项目名称:VersionControlPoints,代码行数:29,代码来源:Minion.cs
示例19: Awake
void Awake()
{
jobs = Jobs.GetInstance();
enemiesData = Jobs.GetEnemies();
logger = Logger.GetInstance();
pView = GameObject.FindWithTag("Raiders").GetComponent<PhotonView>();
}
开发者ID:LeSphax,项目名称:Famine,代码行数:7,代码来源:CombatUpdater.cs
示例20: Awake
void Awake()
{
anim = GetComponent<Animator>();
photonView = GetComponent<PhotonView>();
navMeshSpeed = GetComponent<NavMeshAgent>().speed;
}
开发者ID:Darkchicken,项目名称:SeniorProjectRPG,代码行数:7,代码来源:Health.cs
注:本文中的PhotonView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论