예제 #1
0
    // Update is called once per frame
    void Update()
    {
        float rawScale = ControlScale.CurrentScaleValue;

        this.currentHue = ControlScale.Rescale(rawScale, this.minHue, this.maxHue);

        this.theMaterial.color = ColorUtility.HSVToRGB(this.currentHue, this.saturation, this.lightness);
        this.theMaterial.SetColor("_EmissionColor", ColorUtility.HSVToRGB(this.currentHue, 1.0f, 0.5f));
    }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        float rawScale = ControlScale.CurrentScaleValue;

        this.currentHue     = ControlScale.Rescale(rawScale, this.minHue, this.maxHue);
        this.theLight.color = ColorUtility.HSVToRGB(this.currentHue, this.saturation, this.lightness);

        this.currentIntensity   = ControlScale.Rescale(rawScale, this.minIntensity, this.maxIntensity);
        this.theLight.intensity = this.currentIntensity;
    }
예제 #3
0
    // Update is called once per frame
    void Update()
    {
        Vector3 newScale = theTransform.localScale;

        float rawScale   = ControlScale.CurrentScaleValue;
        float finalScale = ControlScale.Rescale(rawScale, this.minScale, this.maxScale);

        newScale.Set(finalScale, finalScale, finalScale);
        this.theTransform.localScale = newScale;
    }
예제 #4
0
    // Update is called once per frame
    void Update()
    {
        float rawScale = ControlScale.CurrentScaleValue;

        this.currentScoreIncrement      = ControlScale.Rescale(rawScale, this.minScoreIncrement, this.maxScoreIncrement);
        this.currentKillBonusMultiplier = ControlScale.Rescale(rawScale, this.minKillBonusMultiplier, maxKillBonusMultiplier);


        // Add to the score, just for staying alive
        GameplayController.IncrementScore((int)this.currentScoreIncrement);
    }
예제 #5
0
    // Update is called once per frame
    void Update()
    {
        if (!GameplayController.IsGameOver())
        {
            float rawScale      = ControlScale.CurrentScaleValue;
            float rotationSpeed = ControlScale.Rescale(rawScale, this.minRotateSpeed, this.maxRotateSpeed);

            Vector3 newRot = this.theTransform.eulerAngles;
            newRot.Set(0.0f, newRot.y + rotationSpeed * Time.deltaTime, 0.0f);
            this.theTransform.eulerAngles = newRot;
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (GameplayController.IsGameOver())
        {
            float rawScale        = ControlScale.CurrentScaleValue;
            float speedMultiplier = ControlScale.Rescale(rawScale, 1.0f, 4.0f);

            Vector3 newPosition = this.theTransform.position;
            newPosition = newPosition + this.transform.right * (this.driftSpeed * speedMultiplier * Time.deltaTime);
            this.theTransform.position = newPosition;

            Vector3 newRotation = this.theTransform.rotation.eulerAngles;
            newRotation = newRotation + this.randomDriftRotation * (this.driftSpeed * 2.0f * Time.deltaTime);
            this.theTransform.eulerAngles = newRotation;
        }
    }
예제 #7
0
 void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.tag.Equals("Core"))
     {
         ControlScale.ShrinkForTime();
         GameplayController.DecrementLives();
         GameObject.Instantiate(this.coreCrashParticles, this.transform.position, this.transform.rotation);
         GameObject.Instantiate(this.soundPlayForAttackingCore);
         Destroy(this.gameObject);
     }
     else if (other.gameObject.tag.Equals("Arm"))
     {
         GameplayController.IncrementScore(this.pointWorth);
         GameObject.Instantiate(this.armCrashParticles, this.transform.position, other.gameObject.transform.rotation);
         GameObject.Instantiate(this.soundPlayForDying);
         Destroy(this.gameObject);
     }
 }
예제 #8
0
 private void ShowGameOver()
 {
     if (!this.isGameOver)
     {
         this.isGameOver = true;
         ControlScale.DisableTheControls();
         this.exitBtnImage.color = new Color(0.9f, 0.9f, 0.9f, 0.4235f);
         this.scoreText.color    = new Color(1f, 1f, 1f, 1f);
         this.gameOverPanel.SetActive(true);
         if (this.score > this.highscore)
         {
             this.highscoreTextObj.SetActive(true);
             this.SaveHighscore();
         }
         else
         {
             this.highscoreTextObj.SetActive(false);
         }
     }
 }
예제 #9
0
 void OnDestroy()
 {
     ControlScale.singetonInstance = null;
 }
예제 #10
0
    //
    // Methods
    //

    void Awake()
    {
        ControlScale.singetonInstance = this;
    }