5/06/2010

Resources for Team Engine

IsPlaying syntax

animation.IsPlaying("wallcrumble");
http://unity3d.com/support/documentation/ScriptReference/Rigidbody.html


MovieTexture.IsPlaying("friends");


Resources

Twitter-room
http://forum.unity3d.com/viewtopic.php?t=41934&highlight=twitter

Drunk-effect
http://www.pixelplacement.com/iTween/


Short script for timer

yield WaitForSeconds(10.0);
Application.LoadLevel("SceneName");



Script for timer before warping back to apartment

var startTime = 30.0;
var minutes : int = 0;
var seconds : int = 20;
var fraction : int = 0;
var timeLeft = startTime;

function Update () {

//The time left for player to complete level
timeLeft = startTime - Time.time;
//Don't let the time left go below zero
timeLeft = Mathf.Max (0, timeLeft);
//Format the time nicely
guiText.text = FormatTime (timeLeft);
// Loads the level with index 0
if (timeLeft <= 1.0) {
Application.LoadLevel (0);
}
}

//Format time like this
//12(minutes):34(seconds).5(fraction)

function FormatTime (time) {
var intTime : int = time;
var minutes : int = intTime / 60;
var seconds : int = intTime % 60;
var fraction : int = time * 10;
fraction = fraction % 10;

//Build string with format
//12(minutes):34(seconds).5(fraction)

timeText = minutes.ToString () + ":";
timeText = timeText + seconds.ToString ();
timeText += "." + fraction.ToString ();
return timeText;
}


Tutorials 1
http://www.unifycommunity.com/wiki/index.php?title=Tips

Tutorials 2
http://www.unifycommunity.com/wiki/index.php?title=Tutorials

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.