本文整理汇总了C#中World.getPlayer方法的典型用法代码示例。如果您正苦于以下问题:C# World.getPlayer方法的具体用法?C# World.getPlayer怎么用?C# World.getPlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类World
的用法示例。
在下文中一共展示了World.getPlayer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: update
public override void update(float dt, World w)
{
base.update(dt,w);
if (Mathf.Abs(w.getPlayer().position.x - this.position.x) < 10f && Mathf.Abs(w.getPlayer().position.y - this.position.y) < 10f) {
}
}
示例2: update
public override void update(float dt, World w)
{
//anim.update(dt);
//im.sprite = anim.image;
if (w.virus.position.x - w.getPlayer().position.x > maxDistStop) {
isWaiting = true;
}
if (isWaiting && w.virus.position.x - w.getPlayer().position.x < distRepriseForward) {
isWaiting = false;
}
internalTime += dt;
//Debug.Log(internalTime);
if (internalTime > dropTime) {
if (!isWaiting)
{
dropBille(w);
}
internalTime -= dropTime;
}
anim.update(dt);
im.sprite = anim.image;
im.rectTransform.position = position; //- new Vector3(+40,-40,0) ;
if (!isStatique && ! isWaiting)
{
position += vitesse;
}
//base.update(dt,w);
//position += vitesse * dt;
//base.im.rectTransform.position = position;
//im.rectTransform. = dimension;
// TODO mettre les dims
if (Mathf.Abs(w.getPlayer().position.x - this.position.x) < (base.dimension.x + w.getPlayer().dimension.x)/2f && Mathf.Abs(w.getPlayer().position.y - this.position.y) < (base.dimension.y + w.getPlayer().dimension.y)/2f) {
w.hasWin = true;
//Sce
}
}
示例3: Start
void Start()
{
//mainScene.gameObject.active = true;
Debug.Log("b");
mainGameIsRunning = false;
isInMenu = true;
//w = new World(null, null, null);
BG_sound.PlayOneShot(BG_sound.clip, 0.6f);
/************************************************/
liste_plateformes = listePlateformes.transform.GetComponentsInChildren<PlateformeScript>();
liste_plateformes2 = listePlateformes2.transform.GetComponentsInChildren<PlateformeScript>();
liste_plateformes3 = listePlateformes3.transform.GetComponentsInChildren<PlateformeScript>();
liste_plateformesShack = listePlateformesSchack.transform.GetComponentsInChildren<PlateformeScript>();
liste_plateformesMvt = listePlateformesMvt.transform.GetComponentsInChildren<PlateformeScript>();
ground = groundI.transform.GetComponentsInChildren<PlateformeScript>();
Fishs = Fish.transform.GetComponentsInChildren<Image>();
joueur = new Personnage(new Vector3(imageJoueur.transform.position.x, imageJoueur.transform.position.y, 0),
new Vector3(imageJoueur.rectTransform.rect.width, imageJoueur.rectTransform.rect.height, 0), new Vector3(0, 0, 0),
Resources.Load<Sprite>("DSC02576"), imageJoueur, joueurAnim, imageJoueurF, imageJoueurTr,
new Vector3(imageJoueur.transform.position.x, imageJoueur.transform.position.y, 0),
jumpSound,fallUnderMapSound,hitWallSound,boostSound
);
virusOb = new Virus(new Vector3(virus.transform.position.x, virus.transform.position.y, 0),
new Vector3(12*scale, 0*scale, 0), new Vector3(virus.rectTransform.rect.width, virus.rectTransform.rect.height, 0),
Resources.Load<Sprite>("DSC02576"), virus, 0.8f, bille, AnimVirus,billeAnim, pickupSound);
/*Image b = Instantiate(bille);
b.transform.SetParent(billeParent.transform);
billesLi.Add(new Biles(new Vector3(300, 300, 0), new Vector3(0, 0, 0), new Vector3(10, 10, 0), Resources.Load<Sprite>("DSC02576"), b,1, billeAnim));
*/
for (int i = 0; i < liste_plateformes.Length; ++i)
{
liste_plateformes[i].plateform.anim = platAnim;
ptemp.Add(liste_plateformes[i].plateform);
}
for (int i = 0; i < liste_plateformes2.Length; ++i)
{
liste_plateformes2[i].plateform.anim = platAnim2;
ptemp.Add(liste_plateformes2[i].plateform);
}
for (int i = 0; i < liste_plateformes3.Length; ++i)
{
liste_plateformes3[i].plateform.anim = platAnim3;
ptemp.Add(liste_plateformes3[i].plateform);
}
for (int i = 0; i < ground.Length; ++i)
{
ground[i].plateform.anim = platAnimGr;
ptemp.Add(ground[i].plateform);
}
for (int i = 0; i < liste_plateformesShack.Length; ++i)
{
liste_plateformesShack[i].plateform.anim = platAnimSch;
liste_plateformesShack[i].plateform.isSchaky = true;
ptemp.Add(liste_plateformesShack[i].plateform);
}
for (int i = 0; i < liste_plateformesMvt.Length; ++i)
{
liste_plateformesMvt[i].plateform.anim = platAnimSch;
liste_plateformesMvt[i].plateform.isSchaky = true;
//liste_plateformesMvt[i].plateform.amplitudeY = 100;
//liste_plateformesMvt[i].plateform.periodeX = 3;
ptemp.Add(liste_plateformesMvt[i].plateform);
}
w = new World(joueur, ptemp, virusOb, billesLi, bille, billeParent);
/************************************************/
//mainScene.gameObject.SetActive(false);
//mainMenu.gameObject.SetActive(true);
scenePosBegin = mainScene.rectTransform.position;
lastPosCam = w.getPlayer().position;
CreatGameSceneDefault();
}
示例4: update
public override void update(float dt, World w)
{
base.update(dt, w);
timer += dt;
if (timer > maxTime) {
isActive = false;
position = new Vector3(-1000, 0, 0);
}
if (isActive && Mathf.Abs(w.getPlayer().position.x - this.position.x) < base.dimension.x+ w.getPlayer().dimension.x-10 && Mathf.Abs(w.getPlayer().position.y - this.position.y) < base.dimension.y + w.getPlayer().dimension.y-10)
{
//Debug.Log("getBille");
pickUpAudio.PlayOneShot(pickUpAudio.clip, 0.4f);
isActive = false;
position = new Vector3(-1000, 0, 0);
w.getPlayer().facteurVitesse += value;
}
if (isActive)
{
deplacer(dt);
foreach (Plateform p in w.platforms)
{
collision(p);
}
validerDeplacement();
}
}