void ChangeLightOn() { mLightIsOn = true; stuffImDoing.Property(LightValue(), 100, mLightCurve, timeOn); stuffImDoing.Sync(); stuffImDoing.Call(ChangeLightOff); stuffImDoing.Sync(); }
// 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 CheckAButton() { mLightIsOn = false; if (Input.GetButtonUp("A" + mControllerNumber) && mStunTime <= 0.0f && !GetComponent <GrueLogic>()) { ChangeLightOn(); return; } stuffImDoing.Call(CheckAButton); stuffImDoing.Sync(); }
// self queuing message void InputUpdate() { var fadeToNextLevel = Input.anyKey; if (fadeToNextLevel) { FadeToNextLevel(); } else // continue to check for update { FadeSequence.Sync(); FadeSequence.Call(InputUpdate); } }
// Use this for initialization void Start() { if (PathToFollow != null && PathToFollow.points.Length > 1) { movementSeq = action.Sequence(); audioSeq = action.Sequence(); transform.position = PathToFollow.PointAlongPath(PathToFollow.LengthAlongPathToPoint(currentPointNumber)); movementSeq.Call(WaitForInput); } else { if (PathToFollow != null) { Debug.Log("ExComicController has a path which has " + PathToFollow.points.Length + " points which is invalid."); } else { Debug.Log("EXComicController has no path to follow"); } } PlayAudio(); }
// 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); }
void QueueSideEffects(CharacterDialog.Dialog dialog) { for (int i = 0; i < dialog.sideEffects.Length; ++i) { dialogSequence.Sync(); dialogSequence.Call(SendCustomDialogEvent, dialog.sideEffects[i]); } }
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); } }
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 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); }
// Use this for initialization void Start() { if (Paths.Length > 0) { seq = action.Sequence(); seq.Call(WaitForInput); currentPath = Paths[0].GetComponent <FFPath>(); } }
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(); }
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; } }
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); }
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); }
// 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); }
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); } }
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 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 activate(ActivateEnemiesEvent e) { if (!active) { if (seq == null) // first activate { seq = action.Sequence(); seq.Call(Stage1); } else seq.Resume(); active = true; } }
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); }
// 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); }
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); }
// 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); }
void activate(ActivateEnemiesEvent e) { if (!active) { if (seq == null) // first activate { seq = action.Sequence(); seq.Call(Stage1); } else { seq.Resume(); } active = true; } }
void Awake() { bool localNetObject = FFSystem.RegisterNetGameObject(gameObject, "Player"); // Make Sequences MoveSeq = action.Sequence(); // Update Sequence // Input Events only if object was created by local source if (localNetObject) { FFMessage<FFLocalEvents.UpdateEvent>.Connect(OnUpdateEvent); PositionUpdateSeq = action.Sequence(); PositionUpdateSeq.Call(UpdatePositionCall); } FFMessageBoard<ExPlayerPositionUpdate>.Connect(OnPlayerPositionUpdate, gameObject); FFMessageBoard<ExPlayerMoveAction>.Connect(OnPlayerMoveAction, gameObject); FFMessageBoard<ExPlayerFireAction>.Connect(OnPlayerFireAction, gameObject); }
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); }