public override void OnInteractionEnd(Vector3 position) { speedState = SPEED.START; mixing = false; cycleDone = false; isSpoonMoving = false; AkSoundEngine.PostEvent("Pause_Stir", gameObject); s_angle += v_angle; if (s_angle < 0) { s_angle = 360 + s_angle; } }
public static ModelInput RecreateRealModel(ModelInput origin) { if (origin.type == ModelData.DURATION.TYPE) { return(DURATION.CopyValues(origin)); } if (origin.type == ModelData.APPEAR.TYPE) { return(APPEAR.CopyValues(origin)); } if (origin.type == ModelData.SIZE.TYPE) { return(SIZE.CopyValues(origin)); } if (origin.type == ModelData.SPEED.TYPE) { return(SPEED.CopyValues(origin)); } if (origin.type == ModelData.POSITION.TYPE) { return(POSITION.CopyValues(origin)); } if (origin.type == ModelData.ROTATION.TYPE) { return(ROTATION.CopyValues(origin)); } if (origin.type == ModelData.EVENT.TYPE) { return(EVENT.CopyValues(origin)); } if (origin.type == ModelData.COUNT.TYPE) { return(COUNT.CopyValues(origin)); } if (origin.type == ModelData.SHAPE.TYPE) { return(SHAPE.CopyValues(origin)); } if (origin.type == ModelData.PROJECTILE.TYPE) { return(PROJECTILE.CopyValues(origin)); } return(null); }
public Fade(BaseScreen context, String fadeImagePath, SPEED speedType) : this(context, fadeImagePath) { if (speedType == SPEED.SLOW) { mSpeed = 0.01f; } if (speedType == SPEED.MEDIUM) { mSpeed = 0.02f; } if (speedType == SPEED.FAST) { mSpeed = 0.08f; } if (speedType == SPEED.ULTRAFAST) { mSpeed = 0.12f; } }
private void CompleteCycle(float time) { Debug.Log("Cycle done in " + time + "s"); if (time > maxCycleTime) { Debug.Log("Too slow!"); SCORE += pointsSlowCycle; if (speedState != SPEED.SLOW) { speedState = SPEED.SLOW; guzzlesarus.Play("gza_sadFeedback"); AkSoundEngine.PostEvent("Too_Slow", gameObject); trafficlight.SetAmber(); } } else if (time < minCycleTime) { Debug.Log("Too fast!"); SCORE += pointsFastCycle; if (speedState != SPEED.FAST) { speedState = SPEED.FAST; guzzlesarus.Play("gza_sadFeedback"); AkSoundEngine.PostEvent("Too_Fast", gameObject); trafficlight.SetRed(); } } else { if (speedState != SPEED.NORMAL) { speedState = SPEED.NORMAL; guzzlesarus.Play("gza_happyFeedback"); } SCORE += pointsCorrectCycle; trafficlight.SetGreen(); } if (debugScoreText != null) { debugScoreText.text = "SCORE: " + SCORE; } cyclesCompleted++; stateCyclesCompleted++; if (currentState + 1 < statesList.Length && stateCyclesCompleted >= statesList[currentState].cycles) { stateCyclesCompleted = 0; // The program will not enter here, we are keeping this only while testing the scoring if (currentState + 1 == statesList.Length) { Debug.Log("COMPLETE!"); mixing = false; AkSoundEngine.PostEvent("Stop_Stir", gameObject); prompt.ShowPromptAfter(0.4f, 5, () => { manager.ScreenFadeOut("FryPancake"); }, true); } else { currentState++; spriteRenderer.sprite = statesList[currentState].sprite; } } else if (cyclesCompleted == cyclesToComplete) { Debug.Log("COMPLETE!"); Data data = SaveNLoadTxt.Load(); data.score += SCORE; SaveNLoadTxt.Save(data); mixing = false; AkSoundEngine.PostEvent("Stop_Stir", gameObject); AkSoundEngine.SetRTPCValue("MiniMusic2Finish", 0f, null, 100); AkSoundEngine.PostEvent("StopMiniMusic2", gameObject); feedbackGuzz.Play("GuzzMoveOut"); prompt.ShowPromptAfter(0.8f, 5, () => { manager.ScreenFadeOut("FryPancake"); }, true); } }
public void setFanSpeed(SPEED speed) { writeEC((byte)REG.FAN, (byte)speed); }