// 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); }
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); }
public void LoadVictoryScreen(float delay) { fadeScreenSeq.Delay(delay); fadeScreenSeq.Sync(); Seq_FadeScreenMasksToColor(Color.white); fadeScreenSeq.Call(LoadLevelOfName, "VictoryScreen"); }
// 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); } } }
void SetCursorDelayed(Sprite sprite, Color color, float delay = 0.5f) { cursorDelaySprite = sprite; cursorDelayColor = color; cursorDelaySeq.ClearSequence(); cursorDelaySeq.Delay(delay); cursorDelaySeq.Sync(); cursorDelaySeq.Call(SetCursorDelayedSeq); }
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); }
// 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); }
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); }
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 FadeToNextLevel() { FadeSequence.Sync(); FadeSequence.Property( ffSpriteColor, new Color(ffSpriteColor.Val.r, ffSpriteColor.Val.g, ffSpriteColor.Val.b, 1.0f), FFEase.E_SmoothStartEnd, FadeTime); FadeSequence.Sync(); FadeSequence.Delay(PostFadeTime); FadeSequence.Sync(); FadeSequence.Call(LoadTransitionLevel); }
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 UpdateDialog() { for (int i = 0; i < gameDialog.Count; ++i) { if (DialogConditionsTrue(gameDialog[i])) { Debug.Log("Dialog " + i); QueueDialog(gameDialog[i]); QueueSideEffects(gameDialog[i]); gameDialog.RemoveAt(i); } } updateDialogSeq.Delay(0.25f); updateDialogSeq.Sync(); updateDialogSeq.Call(UpdateDialog); }
void RunAnimation() { var set = AnimationSets[SetIndex]; var anim = set[animationIndex]; animSeq.Call(PlayAnim); animSeq.Delay(anim.length + Time.deltaTime); animSeq.Sync(); ++animationIndex; if (animationIndex < set.Length) { animSeq.Call(RunAnimation); } else { animationIndex = 0; ++SetIndex; } }
void ChangeLightOn() { if (!mFlareDropper) { mLightIsOn = true; } if (mFlareDropper) { GameObject flareInst = Instantiate <GameObject>(mFlarePrefab, transform.position + transform.forward * -2, Quaternion.identity); stuffImDoing.Delay(timeOn); } else { stuffImDoing.Property(LightValue(), 100, mLightCurve, timeOn); } stuffImDoing.Sync(); stuffImDoing.Call(ChangeLightOff); stuffImDoing.Sync(); }