android - Is calling a script in unityscript slow? -



android - Is calling a script in unityscript slow? -

my enemy script linked prefab , beingness instantiated main script.

it kills enemies in random order (i jumping on them , not dying, not want). (what trying accomplish enemy die when jump on head , play death animation. enemy script phone call other script jump <-- linked player script , jump boolean value. processing of jump slow? need help tried everything) works on enemies ideas why? community.

can help me find improve method?

could help me maybe find if players y => amount alter jump var on enemy

just had perfect run, whats wrong working not partly working

if add together audio, doesn't work.

#pragma strict var enemy : gameobject; var speed : float = 1.0; var enemanim : animator; var isdying : boolean = false; private var other : main; var playerhit: boolean = false; function start () { other = gameobject.findwithtag("player").getcomponent("main"); this.transform.position.x = 8.325; this.transform.position.y = -1.3; enemanim = getcomponent(animator); enemanim.setfloat("isdead",0); } function oncollisionenter2d(coll: collision2d) { if(coll.gameobject.comparetag("distroy")){ destroy(enemy.gameobject); } if(coll.gameobject.comparetag("player")){ playerhit=true; } } function update () { if(other.jumped === true && playerhit==true){ *****the jumped need enemanim.setfloat("isdead",1); } } function fixedupdate(){ this.transform.translate(vector3(input.getaxis("horizontal") * speed * time.deltatime, 0, 0)); this.rigidbody2d.velocity = vector2(-5,0); }

if(other.jumped === true && playerhit==true)

is wrong.

it should be:

if(other.jumped == true && playerhit==true)

all 3 languages used unity, c#, unityscript, , boo, compiled same il byte code @ end. however, there cases unityscript has overhead unity things in background. 1 of these wrapping of access members of built-in struct-properties transform.position.

i prefer c#, think better.

android unity3d unityscript unity3d-2dtools

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -