// Use this for initialization void Start() { // Initialize { FadeSequence = action.Sequence(); } // Fade Sequence { FadeSequence.Property( ffSpriteColor, new Color(ffSpriteColor.Val.r, ffSpriteColor.Val.g, ffSpriteColor.Val.b, 0.0f), FFEase.E_SmoothStart, OpenFadeTime); FadeSequence.Sync(); FadeSequence.Delay(PreFadeTime); FadeSequence.Sync(); if (trigger == FadeTrigger.KeyPress) { InputUpdate(); } else { FFMessage <TriggerFade> .Connect(OnTriggerFade); } } }
// Use this for initialization void Start() { seq = action.Sequence(); var spriteRend = GetComponent <SpriteRenderer>(); spriteRend.enabled = true; spriteRend.color = startColor; // Fade in out of black into splashScreen var spriteColorRef = ffSpriteColor; seq.Property(spriteColorRef, spriteColorRef.Val.MakeClear(), FFEase.E_Continuous, fadeInTime); seq.Sync(); // delay for wait time seq.Delay(waitTime); seq.Sync(); // show text var textColorRef = new FFRef <Color>(() => pressAnyKeyText.color, (v) => pressAnyKeyText.color = v); textColorRef.Setter(textColorRef.Val.MakeClear()); seq.Property(textColorRef, textColorRef.Val.MakeOpaque(), FFEase.E_Continuous, 0.45f); // Update Sequence for press any key seq.Sync(); seq.Call(UpdateSeq); }
// move down/up (depends on if AttackWidth is pos/neg) and right/left (depends on if AttackWidth is pos/neg) void Stage1() { Vector3 targetLocation = new Vector3(ffposition.Val.x + AttackWidth, ffposition.Val.y - AttackDepth, ffposition.Val.z); // down and right seq.Property(ffposition, targetLocation, ease, AttackSpeed / 3); seq.Sync(); seq.Call(Stage2); }
void Seq_FadeScreenMasksToColor(Color color) { fadeScreenMaskSprite.gameObject.SetActive(true); fadeScreenMaskImage.gameObject.SetActive(true); fadeScreenSeq.Property(new FFRef <Color>(() => fadeScreenMaskSprite.color, (v) => fadeScreenMaskSprite.color = v), color, FFEase.E_Continuous, fadeTime); fadeScreenSeq.Property(new FFRef <Color>(() => fadeScreenMaskImage.color, (v) => fadeScreenMaskImage.color = v), color, FFEase.E_Continuous, fadeTime); fadeScreenSeq.Sync(); }
void CheckAButton() { mLightIsOn = false; if (Input.GetButtonUp("A" + mControllerNumber) && mStunTime <= 0.0f && !GetComponent <GrueLogic>()) { ChangeLightOn(); return; } stuffImDoing.Call(CheckAButton); stuffImDoing.Sync(); }
// Update is called once per frame void Update() { if (FindObjectOfType <GlobalLightChecker>().GetTotalLightLevel(transform) >= 0.2) { if (!GetComponent <ControllerPlayerController>()) { Destroy(gameObject); } else { //un grueize GetComponent <Collider>().isTrigger = false; mConvertMaybe.ClearSequence(); // change model back to normal Destroy(this); } } if (mStunTime >= 0.0f) { mStunTime -= Time.deltaTime; } if (mStunTime > 0.0f) { myRidigBody.velocity = Vector3.zero; return; } if (GameMath.DistanceBetween(this, mTarget) < mStunRange) { mConvertMaybe.Delay(mMaxStunTime); mConvertMaybe.Sync(); mConvertMaybe.Call(StunFinish); mConvertMaybe.Sync(); this.mStunTime = mMaxStunTime; mTarget.GetComponent <ControllerPlayerController>().mStunTime = mMaxStunTime; } Vector3 movementVector = GameMath.UnitVectorBetween(this, mTarget); movementVector *= accelerationSpeed * Time.deltaTime; myRidigBody.AddForce(movementVector); if (myRidigBody.velocity.magnitude >= maxSpeed) { myRidigBody.velocity = myRidigBody.velocity.normalized * maxSpeed; } transform.rotation = Quaternion.AngleAxis( Mathf.Atan2(myRidigBody.velocity.x * -1, myRidigBody.velocity.z) * 180 / Mathf.PI , Vector3.down); }
// self queuing message void InputUpdate() { var fadeToNextLevel = Input.anyKey; if (fadeToNextLevel) { FadeToNextLevel(); } else // continue to check for update { FadeSequence.Sync(); FadeSequence.Call(InputUpdate); } }
void StartSeq() { var rot10Clockwise = Quaternion.AngleAxis(10.0f, Vector3.forward); var rot10CounterClockwise = Quaternion.AngleAxis(-10.0f, Vector3.forward); seq.Property(ffrotation, ffrotation.Val * rot10Clockwise, FFEase.E_SmoothStartEnd, time); seq.Sync(); seq.Property(ffrotation, ffrotation.Val * rot10CounterClockwise, FFEase.E_SmoothStartEnd, time); seq.Sync(); seq.Property(ffrotation, ffrotation.Val * rot10CounterClockwise, FFEase.E_SmoothStartEnd, time); seq.Sync(); seq.Property(ffrotation, ffrotation.Val * rot10Clockwise, FFEase.E_SmoothStartEnd, time); seq.Sync(); seq.Call(StartSeq); }
void Report() { Debug.Log("Reported!"); seq1.Delay(1.0f); seq1.Sync(); seq1.Call(Report); }
// Use this for initialization void Start() { seq = action.Sequence(); seq.Property(ffposition, Vector3.zero, FFEase.E_Continuous, 1.0f); seq.Property(ffposition, Vector3.zero, FFEase.E_Continuous, 1.0f); seq.Delay(2.0f); seq.Sync(); seq.Property(ffrotation, Quaternion.identity, curve, 1.0f); seq.Delay(0.5f); seq.Sync(); seq.Property(ffscale, Vector3.one * 2.0f, FFEase.E_Continuous, 1.0f); seq.Sync(); seq.Call(DestroyMe); }
private void FireSequenceCall() { const float callTime = 3.0f; moveSequence.Property(ffposition, ffposition + (new Vector3(0, 1, 0) * BulletSpeed * callTime), FFEase.E_Continuous, callTime); moveSequence.Sync(); moveSequence.Call(FireSequenceCall); }
// Update is called once per frame void UpdateSeq() { if (Input.anyKey) { // Load selected Level var spriteColorRef = ffSpriteColor; seq.Property(spriteColorRef, spriteColorRef.Val.MakeOpaque(), FFEase.E_Continuous, fadeOutTime); seq.Sync(); seq.Call(LoadSelectedLevel); } else { // continue updating seq.Sync(); seq.Call(UpdateSeq); } }
void QueueSideEffects(CharacterDialog.Dialog dialog) { for (int i = 0; i < dialog.sideEffects.Length; ++i) { dialogSequence.Sync(); dialogSequence.Call(SendCustomDialogEvent, dialog.sideEffects[i]); } }
void SpawnFunction() { mMyActionList.Delay(Random.Range(mMinSpawnPeriod, mMaxSpawnPeriod)); mMyActionList.Sync(); for (int unitsToSpawn = Random.Range(mMinWaveNumber, mMaxWaveNumber); unitsToSpawn > 0; --unitsToSpawn) { GameObject newLing = Instantiate(mGruelingPrefab, transform.position, transform.rotation); newLing.GetComponent <GrueLogic>().mStunTime = 10.0f; StartCoroutine("SendOutGrueling", newLing); //newLing.GetComponent<Rigidbody>().velocity = new Vector3(Random.Range(-mMaxGoSpeedX, mMaxGoSpeedX), 0, Random.Range(-mMaxGoSpeedY, mMaxGoSpeedY)); } mMyActionList.Call(SpawnFunction); mMyActionList.Sync(); }
void Fade() { var sprite = GetComponent <SpriteRenderer>(); var spriteColorRef = new FFRef <Color>(() => sprite.color, (v) => { sprite.color = v; }); fadeSeq.Property(spriteColorRef, spriteColorRef.Val.MakeClear(), FFEase.E_SmoothStart, fadeTime); fadeSeq.Sync(); fadeSeq.Call(DestroyMe); }
void Pickup(Vector3 posToFlyTo) { var sprite = GetComponent <SpriteRenderer>(); pickupSeq.Property(ffposition, posToFlyTo, FFEase.E_Continuous, pickupTime); pickupSeq.Property(ffscale, Vector3.zero, FFEase.E_Continuous, pickupTime); pickupSeq.Sync(); pickupSeq.Call(DestroyMe); }
private void MoveSequenceCall(object moveDirection) { Vector3 moveDir = (Vector3)moveDirection; const float callTime = 3.0f; MoveSeq.Property(ffposition, ffposition + (moveDir * PlayerSpeed * callTime), FFEase.E_Continuous, callTime); MoveSeq.Sync(); MoveSeq.Call(MoveSequenceCall, moveDir); }
void SetCursorDelayed(Sprite sprite, Color color, float delay = 0.5f) { cursorDelaySprite = sprite; cursorDelayColor = color; cursorDelaySeq.ClearSequence(); cursorDelaySeq.Delay(delay); cursorDelaySeq.Sync(); cursorDelaySeq.Call(SetCursorDelayedSeq); }
// Use this for initialization void Start() { myRidigBody = GetComponent <Rigidbody>(); if (!mFlareDropper) { transform.Find("Light").GetComponent <Light>().intensity = startingIntc; } stuffImDoing = action.Sequence(); stuffImDoing.Call(CheckAButton); stuffImDoing.Sync(); }
// Move forward state void MoveForward() { float lengthToNextPoint = PathToFollow.LengthAlongPathToPoint(currentPointNumber); if (distAlongPath >= lengthToNextPoint) // reached next point { transform.position = PathToFollow.PointAlongPath(lengthToNextPoint); // goto point movementSeq.Call(WaitForInput); // waitForInput return; } else // keep moving along path { transform.position = PathToFollow.PointAlongPath(distAlongPath); } distAlongPath += Time.deltaTime * ComicCameraSpeed; movementSeq.Sync(); movementSeq.Call(MoveForward); }
private void UpdatePositionCall() { ExPlayerPositionUpdate e; e.position = transform.position; e.time = FFSystem.time; FFMessageBoard <ExPlayerPositionUpdate> .SendToNet(e, gameObject, false); PositionUpdateSeq.Delay(0.6f); PositionUpdateSeq.Sync(); PositionUpdateSeq.Call(UpdatePositionCall); }
public void SayThing(FFAction.ActionSequence dialogSeq, string text, float time) { Debug.Log("Say Thing"); TextItem item = new TextItem(); item.dialogSeq = dialogSeq; item.text = text; item.time = time; dialogSeq.Sync(); dialogSeq.Call(Say, item); }
private void OnClickLeaveServer() { ChangeLevelStateEvent CLSE; CLSE.newState = LevelState.In_Menu; FFMessage <ChangeLevelStateEvent> .SendToLocal(CLSE); // 1.0 seconds to make sure everything is finished in the ChangelevelState event // before we close down networking DisconnectSequence.Delay(0.5); DisconnectSequence.Sync(); DisconnectSequence.Call(DestroyClientAndServer); }
// shoot at gameobject target with a delay between attacks of // AtackSpeed. void Stage1() { var targetToShoot = GameObject.Find(target); if (targetToShoot != null) { ShootAt(targetToShoot); } seq.Delay(AttackSpeed); seq.Sync(); seq.Call(Stage1); }
public void FireBullet(double time, FFVector3 position) { // Fire transform.position = position; moveSequence = action.Sequence(); moveSequence.TimeWarpFrom(time); FireSequenceCall(); // Death deathSequence = action.Sequence(); deathSequence.Delay(TimeToLive); deathSequence.Sync(); deathSequence.Call(DestroyBullet); }
public void FireBullet(double time, FFVector3 position) { // Fire transform.position = position; moveSequence = action.Sequence(); moveSequence.TimeWarpFrom(time); FireSequenceCall(); // Death deathSequence = action.Sequence(); deathSequence.Delay(TimeToLive); deathSequence.Sync(); deathSequence.Call(DestroyBullet); }
void PlayAudio() { // Play Audio Clip if (currentPointNumber < pathPointAudioClip.Length && pathPointAudioClip[currentPointNumber].clip != null) { if (pathPointAudioClip[currentPointNumber].delay != 0.0f) { audioSeq.Delay(pathPointAudioClip[currentPointNumber].delay); audioSeq.Sync(); } audioSeq.Call(PlayAudioClipAtPointIndex); } }
void MoveForward() { if (distAlongPath >= currentPath.PathLength) // reached end of path { transform.position = currentPath.PointAlongPath(currentPath.PathLength); // goto end ++currentPathNumber; if (currentPathNumber < Paths.Length) { currentPath = Paths[currentPathNumber].GetComponent <FFPath>(); } seq.Call(WaitForInput); // waitForInput return; } else { transform.position = currentPath.PointAlongPath(distAlongPath); } distAlongPath += Time.deltaTime * ComicCameraSpeed; seq.Sync(); seq.Call(MoveForward); }
// move down and right void Stage1() { float seedx = Random.Range(-1.0f, 1.0f); float seedy = Random.Range(-1.0f, 1.0f); Vector3 randVec3 = new Vector3( (seedx + PercentHorizonal) * randomVariance, (seedy + PercentVirtical) * randomVariance); seq.Property(ffscale, randVec3 * 20, FFEase.E_Continuous, AttackSpeed); seq.Property(ffposition, randVec3 + ffposition.Val, FFEase.E_Continuous, AttackSpeed); seq.Sync(); seq.Call(Stage1); }
void TriggerDeathSequence() { deathSequence = action.Sequence(); // animation,sounds,disable colliders,etc... Collider col; if (col = GetComponent <Collider>()) { col.enabled = false; } deathSequence.Sync(); // finish all of sequence before destroying GameObject deathSequence.Call(gameObject.Destroy); }
public void LoadHWAssignment(int number) { loadSequence.ClearSequence(); fadeImage.gameObject.SetActive(true); // Do fade out on loadSequence when we have a fade image if (fadeImage != null) { loadSequence.Property( new FFRef <Color>(() => fadeImage.color, (v) => fadeImage.color = v), Color.black, FFEase.E_Continuous, fadeTime); } loadSequence.Sync(); loadSequence.Call(LoadLevelByName, "HW" + number); }
void TriggerDeathSequence() { deathSequence = action.Sequence(); // animation,sounds,disable colliders,etc... Collider col; if (col = GetComponent<Collider>()) col.enabled = false; deathSequence.Sync(); // finish all of sequence before destroying GameObject deathSequence.Call(gameObject.Destroy); }