Skip to content

Commit

Permalink
first stab at scripted intro camera fly-in, using unity 3.x animation…
Browse files Browse the repository at this point in the history
… curves
  • Loading branch information
tyson-kubota committed May 2, 2013
1 parent b602d47 commit ec6a4be
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
27 changes: 27 additions & 0 deletions CameraTween.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#pragma strict

var pathName : String = "WormLoop";
var crawlTime : int = 15;
var Loop : boolean = false;
var cameraMove : boolean = false;
var cameraLookTarget : GameObject;

function Start () {
if (cameraMove == true) {
iTween.MoveTo(gameObject,
iTween.Hash("path",iTweenPath.GetPath(pathName),
"orienttopath", false,
"looktarget", cameraLookTarget.transform,
"axis","x",
"looktime", 3.0,
"lookahead", 0.05f,
"time", crawlTime,
"easetype", "easeInOutSine"));
}
}

function Update () {

}

//"easetype", iTween.EaseType.easeInOutSine causes strange flip at end of loop.
20 changes: 20 additions & 0 deletions IntroSequence.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma strict

var PlayerObject : GameObject;
var introCamera : GameObject;
var mainCamera : GameObject;

var UIscriptName : GameObject;
var UIscriptComponent : fallingUITest;

function Start () {
UIscriptComponent = UIscriptName.GetComponent(fallingUITest);
UIscriptComponent.HideGUI();

}

function EndIntro () {
PlayerObject.active = true;
introCamera.active = false;
mainCamera.active = true;
}

0 comments on commit ec6a4be

Please sign in to comment.