Пример #1
0
 private void DropCalled(DropColor color, int length)
 {
     if (length == 8) //short drop should not be followed by intro
     {
         AkSoundEngine.SetState("GrooveType", "Flow");
     }
     else if (length == 16) //this is the medium drop, every other medium drop should be followed by intro
     {
         if (!mediumDropCounter)
         {
             mediumDropCounter = true;
             AkSoundEngine.SetState("GrooveType", "Flow");
         }
         else
         {
             AkSoundEngine.SetState("GrooveType", "Intro");
             mediumDropCounter = false;
         }
     }
     else if (length == 32) //this is the long drop, should always be followed by intro
     {
         AkSoundEngine.SetState("GrooveType", "Intro");
         mediumDropCounter = false;
     }
 }
Пример #2
0
    void DropColorChange(DropColor givenColor, int dropLength)
    {
        IncrementMinMaxIntensity();
        switch (givenColor)
        {
        case DropColor.Purple:
            StartCoroutine(FadeToGivenColor(purpleColor));
            break;

        case DropColor.Blue:
            StartCoroutine(FadeToGivenColor(blueColor));
            break;

        case DropColor.Green:
            StartCoroutine(FadeToGivenColor(greenColor));
            break;

        case DropColor.Yellow:
            StartCoroutine(FadeToGivenColor(yellowColor));
            break;

        case DropColor.Orange:
            StartCoroutine(FadeToGivenColor(orangeColor));
            break;

        case DropColor.Red:
            StartCoroutine(FadeToGivenColor(redColor));
            break;
        }
    }
Пример #3
0
    void ChangeMatColorOnStart()
    {
        DropColor whichColor = StereoRail_AudioManager.Instance.colorOfDrop;
        Color     newColor   = Color.black;

        switch (whichColor)
        {
        case DropColor.Purple:
            newColor = duringPurple;
            break;

        case DropColor.Red:
            newColor = duringRed;
            break;

        case DropColor.Orange:
            newColor = duringOrange;
            break;

        case DropColor.Yellow:
            newColor = duringYellow;
            break;

        case DropColor.Green:
            newColor = duringGreen;
            break;

        case DropColor.Blue:
            newColor = duringBlue;
            break;
        }
        colorRenderer.material.SetColor("_Color", newColor);
        //Debug.Log("Set Color to " + newColor);
    }
Пример #4
0
    void DropColorChange(DropColor givenColor, int dropLength)
    {
        switch (givenColor)
        {
        case DropColor.Purple:
            matGear.colorGradient = purpleGrad;
            break;

        case DropColor.Blue:
            matGear.colorGradient = blueGrad;
            break;

        case DropColor.Green:
            matGear.colorGradient = greenGrad;
            break;

        case DropColor.Yellow:
            matGear.colorGradient = yellowGrad;
            break;

        case DropColor.Orange:
            matGear.colorGradient = orangeGrad;
            break;

        case DropColor.Red:
            matGear.colorGradient = redGrad;
            break;
        }
    }
Пример #5
0
    void ChangeMatColorOnDrop(DropColor dColor, int dropLength)
    {
        Color newColor = Color.black;

        switch (dColor)
        {
        case DropColor.Purple:
            newColor = duringPurple;
            break;

        case DropColor.Red:
            newColor = duringRed;
            break;

        case DropColor.Orange:
            newColor = duringOrange;
            break;

        case DropColor.Yellow:
            newColor = duringYellow;
            break;

        case DropColor.Green:
            newColor = duringGreen;
            break;

        case DropColor.Blue:
            newColor = duringBlue;
            break;
        }
        colorRenderer.material.SetColor("_Color", newColor);
    }
Пример #6
0
    void SetDropColor(DropColor dColor, int dropLength)
    {
        switch (dColor)
        {
        case DropColor.Yellow:
            dropColor = changeCam.whenYellow;
            break;

        case DropColor.Red:
            dropColor = changeCam.whenRed;
            break;

        case DropColor.Purple:
            dropColor = changeCam.whenPurple;
            break;

        case DropColor.Blue:
            dropColor = changeCam.whenBlue;
            break;

        case DropColor.Green:
            dropColor = changeCam.whenGreen;
            break;

        case DropColor.Orange:
            dropColor = changeCam.whenOrange;
            break;
        }
    }
    public void ChangeOption(int matInt, DropColor whichColor)
    {
        //Debug.Log("Woah, changing to " + whichColor + " and material: " + optionMat[matInt]);

        optionColor   = whichColor;
        rend.material = optionMat[matInt];
    }
    void DropColorChange(DropColor givenColor, int dropLength)
    {
        switch (givenColor)
        {
        case DropColor.Purple:
            rend.sharedMaterial.SetColor("_Color", purpleColor);
            break;

        case DropColor.Blue:
            rend.sharedMaterial.SetColor("_Color", blueColor);
            break;

        case DropColor.Green:
            rend.sharedMaterial.SetColor("_Color", greenColor);
            break;

        case DropColor.Yellow:
            rend.sharedMaterial.SetColor("_Color", yellowColor);
            break;

        case DropColor.Orange:
            rend.sharedMaterial.SetColor("_Color", orangeColor);
            break;

        case DropColor.Red:
            rend.sharedMaterial.SetColor("_Color", redColor);
            break;
        }
    }
Пример #9
0
    void ChangeBackground(DropColor givenColor, int dropLength)
    {
        switch (givenColor)
        {
        case DropColor.Yellow:
            //cam.backgroundColor = whenYellow;
            StartCoroutine(FadeToGivenColor(whenYellow));
            break;

        case DropColor.Red:
            StartCoroutine(FadeToGivenColor(whenRed));
            break;

        case DropColor.Purple:
            StartCoroutine(FadeToGivenColor(whenPurple));
            break;

        case DropColor.Blue:
            StartCoroutine(FadeToGivenColor(whenBlue));
            break;

        case DropColor.Green:
            StartCoroutine(FadeToGivenColor(whenGreen));
            break;

        case DropColor.Orange:
            StartCoroutine(FadeToGivenColor(whenOrange));
            break;
        }
    }
Пример #10
0
    void DropEventReceived(DropColor dropColor, int dropLength)
    {
        if (songPlaying)
        {
            if (dropLength >= 16)
            {
                dspTriggeredCenter = true;
                dspTriggeredLeft   = true;
                dspTriggeredRight  = true;
            }
            else
            {
                /*
                 * Was thinking of having the pillars disappear if there's no dsp box, decided against it to keep the triggers where they are in peace
                 * deactivateCenter = true;
                 * deactivateLeft = true;
                 * deactivateRight = true;
                 */
            }

            CenterDropSelect.SetActive(false);
            LeftDropSelect.SetActive(false);
            RightDropSelect.SetActive(false);
        }
    }
Пример #11
0
 void BrieflyTurnOnSpawner(DropColor givenDropColor, int dropLength)
 {
     if (givenDropColor == dropColor)
     {
         spawner.enabled = true;
         StartCoroutine(BurstForABit());
     }
 }
Пример #12
0
 public void SetColor(DropColor dropColor, int delay)
 {
     this.dropColor = dropColor;
     this.delay     = delay;
     if (gameObject.activeInHierarchy)
     {
         StartCoroutine("SetColor_CR");
     }
 }
Пример #13
0
 private void SetDSPActivityLogic(DropColor color, int length)
 {
     // ******** This is where you change the activation length, was 16 before **********
     if (length > 8)
     {
         lengthAppropriate = true;
     }
     else
     {
         lengthAppropriate = false;
     }
 }
Пример #14
0
 private void SetStingerActiveLogic(DropColor color, int length)
 {
     // ******** This is where you change the activation length, was 8 before **********
     if (length > 0)
     {
         lengthAppropriate = true;
     }
     else
     {
         lengthAppropriate = false;
     }
 }
Пример #15
0
    //---------------END OF THE BUSINESS------------------

    public void TriggerDrop(DropColor color, int dropLength)
    {
        bool canYouDrop;

        Debug.Log("Recieved request to Trigger the Drop!");
        //gotta check if the timing is right, can't trigger the drop in the middle of groove or another drop
        if (!tutorialPreventingDrop)
        {
            switch (currentState)
            {
            case MusicState.Windup:
            case MusicState.Filler:
                canYouDrop = true;
                //Debug.Log("Drop should be a-ok to proceed!");
                break;

            default:
                canYouDrop = false;
                Debug.Log("The form is preventing you from dropping!");

                break;
            }
        }
        else
        {
            canYouDrop = false;

            Debug.Log("The tutorial is preventing you from dropping!");
        }

        //if you can drop, do it, otherwise you cant
        if (canYouDrop)
        {
            nextDropLength = dropLength;



            colorOfDrop = color;
            nextState   = MusicState.Drop;
            Debug.Log("Drop incoming! Color is: " + color);
            nextStateText.text = "Next State: DROP";

            //and broadcast the reception of the drop gesture
            DropGestureRecieved?.Invoke();
        }
        else
        {
            Debug.Log("You can't drop it yet!");
        }
    }
Пример #16
0
    void SpawnParticles(DropColor dropColor, int dropLength)
    {
        ParticleSystem.MainModule main = pSystem.main;
        var      psr      = GetComponent <ParticleSystemRenderer>();
        Material trailMat = psr.trailMaterial;

        //Debug.Log(trailMat.GetColor("_EmissionColor"));


        switch (dropColor)
        {
        case DropColor.Red:
            main.startColor = new ParticleSystem.MinMaxGradient(redGradient);
            trailMat.SetColor("_EmissionColor", redColor);
            //trailMat.SetColor("_Color", redColor);
            break;

        case DropColor.Orange:
            main.startColor = new ParticleSystem.MinMaxGradient(orangeGradient);
            trailMat.SetColor("_EmissionColor", orangeColor);
            //trailMat.SetColor("_Color", orangeColor);
            //Debug.Log(trailMat.emmisionColor)
            break;

        case DropColor.Yellow:
            main.startColor = new ParticleSystem.MinMaxGradient(yellowGradient);
            trailMat.SetColor("_EmissionColor", yellowColor);
            //trailMat.SetColor("_Color", yellowColor);
            break;

        case DropColor.Green:
            main.startColor = new ParticleSystem.MinMaxGradient(greenGradient);
            trailMat.SetColor("_EmissionColor", greenColor);
            //trailMat.SetColor("_Color", greenColor);
            break;

        case DropColor.Blue:
            main.startColor = new ParticleSystem.MinMaxGradient(blueGradient);
            trailMat.SetColor("_EmissionColor", blueColor);
            //trailMat.SetColor("_Color", blueColor);
            break;

        case DropColor.Purple:
            main.startColor = new ParticleSystem.MinMaxGradient(purpleGradient);
            trailMat.SetColor("_EmissionColor", purpleColor);
            //trailMat.SetColor("_Color", purpleColor);
            break;
        }
        pSystem.Play();
    }
Пример #17
0
        void load_data()
        {
            ds.Clear();
            SqlConnection con = new SqlConnection(@"Data Source=ANDROID2W4356\MSSQLSERVER2017;Initial Catalog=DB_A45C5E_cars;Integrated Security=True");


            da = new SqlDataAdapter("select * from carstatus", con);
            da.Fill(ds, "carstatus");
            DropCarState.DataSource     = ds.Tables["carstatus"];
            DropCarState.DataTextField  = "status_car_name";
            DropCarState.DataValueField = "status_car_id";
            DropCarState.DataBind();
            da = new SqlDataAdapter("select * from gearboxType", con);
            da.Fill(ds, "gearboxType");
            dropGearBox.DataSource     = ds.Tables["gearboxType"];
            dropGearBox.DataTextField  = "lime_name";
            dropGearBox.DataValueField = "lime_id";
            dropGearBox.DataBind();
            da = new SqlDataAdapter("select * from carcolore", con);
            da.Fill(ds, "carcolore");
            DropColor.DataSource     = ds.Tables["carcolore"];
            DropColor.DataTextField  = "colore_name";
            DropColor.DataValueField = "colore_id";
            DropColor.DataBind();
            da = new SqlDataAdapter("select * from fuelsType", con);
            da.Fill(ds, "fuelsType");
            DropFuelsType.DataSource     = ds.Tables["fuelsType"];
            DropFuelsType.DataTextField  = "Fuel_type_name";
            DropFuelsType.DataValueField = "Fuel_type_id";
            DropFuelsType.DataBind();
            da = new SqlDataAdapter("select * from supplyingtype", con);
            da.Fill(ds, "supplyingtype");
            DropSupply.DataSource     = ds.Tables["supplyingtype"];
            DropSupply.DataTextField  = "Incoming type_name";
            DropSupply.DataValueField = "Incoming type_id";
            DropSupply.DataBind();
            da = new SqlDataAdapter("select * from Cardoor", con);
            da.Fill(ds, "Cardoor");
            DropDoors.DataSource     = ds.Tables["Cardoor"];
            DropDoors.DataTextField  = "Emblems-name";
            DropDoors.DataValueField = "Emblems_id";
            DropDoors.DataBind();
            da = new SqlDataAdapter("select * from cylinderNo", con);
            da.Fill(ds, "cylinderNo");
            DropCylender.DataSource     = ds.Tables["cylinderNo"];
            DropCylender.DataTextField  = "baston_name";
            DropCylender.DataValueField = "baston_id";
            DropCylender.DataBind();
        }
Пример #18
0
 void TurnToysOn(DropColor dColor, int dLength)
 {
     if (boxes != null)
     {
         foreach (GameObject box in boxes)
         {
             StingerTrigger stingerBoxScript = box.GetComponent <StingerTrigger>();
             if (stingerBoxScript != null)
             {
                 stingerBoxScript.enabled = true;
             }
             box.SetActive(true);
         }
     }
 }
Пример #19
0
 void TurnToysOn(DropColor dColor, int dLength)
 {
     if (dLength >= 16)
     {
         if (boxes != null)
         {
             foreach (GameObject box in boxes)
             {
                 DSPBox dspBoxScript = box.GetComponent <DSPBox>();
                 if (dspBoxScript != null)
                 {
                     dspBoxScript.dspEnabled = true;
                 }
             }
         }
     }
 }
Пример #20
0
    /*
     * [System.Obsolete("No longer supported, as TriggerDropEvent listeners should be used instead")]
     * public void DropMeasure(int dropMeasure, int dropLength, DropColor colorOfDrop, AnimationParcels animationParcels){
     *  if (dropMeasure == 1){
     *      //ChooseADropAndPlay();
     *      if (colorOfDrop == DropColor.Red)
     *      {
     *          AkSoundEngine.SetState("DropColor", "Red");
     *      }
     *      if (colorOfDrop == DropColor.Green)
     *      {
     *          AkSoundEngine.SetState("DropColor", "Green");
     *      }
     *      if (colorOfDrop == DropColor.Blue)
     *      {
     *          AkSoundEngine.SetState("DropColor", "Blue");
     *          animationParcels.BlueDropStart(dropLength);
     *      }
     *      if (colorOfDrop == DropColor.Yellow)
     *      {
     *          AkSoundEngine.SetState("DropColor", "Yellow");
     *      }
     *      if (colorOfDrop == DropColor.Purple)
     *      {
     *          AkSoundEngine.SetState("DropColor", "Purple");
     *      }
     *      AkSoundEngine.PostEvent("DropPlay", this.gameObject);
     *
     *
     *  }
     * }
     */

    private void InitiateDrop(DropColor color, int length)
    {
        //Debug.Log("Initiating the Drop!");
        //ChooseADropAndPlay();
        switch (color)
        {
        case DropColor.Red:
            AkSoundEngine.SetState("DropColor", "Red");
            break;

        case DropColor.Green:
            AkSoundEngine.SetState("DropColor", "Green");
            break;

        case DropColor.Blue:
            AkSoundEngine.SetState("DropColor", "Blue");
            break;

        case DropColor.Orange:
            AkSoundEngine.SetState("DropColor", "Orange");
            break;

        case DropColor.Yellow:
            AkSoundEngine.SetState("DropColor", "Yellow");
            break;

        case DropColor.Purple:
            AkSoundEngine.SetState("DropColor", "Purple");

            // TODO: Move animation parcels to some animation manager object or animation event system
            //animationParcels.BlueDropStart(dropLength);
            break;
        }

        AkSoundEngine.PostEvent("DropPlay", gameObject);
        //Debug.Log("Playing the " + color + " drop!");

        dropCounter = 0;
        dropLength  = length;
        Debug.Log("This drop should last for " + dropLength + " measures!");
        NewMeasureEvent += OnNewMeasure;
    }
Пример #21
0
    public static DropColor AddColors(DropColor color1, DropColor color2)
    {
        int colorIndex1 = (int)color1.type;
        int colorIndex2 = (int)color2.type;

        int diff = colorIndex2 - colorIndex1;

        if (diff > 6)
        {
            diff -= 12;
        }
        if (diff < -6)
        {
            diff += 12;
        }
        int newColorIndex = (colorIndex1 + diff / 2);

        newColorIndex = (12 + newColorIndex) % 12;
//        bool muddy = (Mathf.Abs(diff) == 6);
//        if (color1.muddy||color2.muddy) muddy = true;

        return(new DropColor((DropType)newColorIndex, false));
    }
Пример #22
0
 void StartFadeToDropIntensity(DropColor dColor, int dropLength)
 {
     StartCoroutine(FadeUpToDropIntensity());
 }
    /*
     * private IGestureType GetGestureType()
     * {
     *
     *   // TODO: Raycast out in the direction of the gesture from the controller, check the velocity, and
     *   // if a valid IGestureType is found on the target, return it; otherwise, return an EmptyGesture
     *
     *
     *  IGestureType returnGesture = null;
     *
     *  if (leftHand.Velocity.magnitude >= minimumVelocity)
     *  {
     *      velocity = leftHand.Velocity;
     *      //ray = new Ray(leftHand.HandPosition, velocity);
     *      //returnGesture = RetrieveGesture();
     *  }
     *
     *  if (returnGesture == null || returnGesture.Equals(EmptyGesture))
     *  {
     *      if (rightHand.Velocity.magnitude >= minimumVelocity)
     *      {
     *          velocity = rightHand.Velocity;
     *          //ray = new Ray(rightHand.HandPosition, velocity);
     *          //returnGesture = RetrieveGesture();
     *      }
     *      else
     *      {
     *          returnGesture = EmptyGesture;
     *      }
     *  }
     *
     *  return returnGesture;
     * }
     */
    /*
     * private IGestureType RetrieveGesture()
     * {
     *  if (Physics.Raycast(ray, out hit, maxDistance) && hit.transform.gameObject.CompareTag(GestureTriggerTag))
     *  {
     *      //Debug.Log("Hit object " + hit.transform.gameObject.name + " with raycast at velocity vector: " + velocity + " magnitude was: " + velocity.magnitude);
     *
     *      ComponentGesture targetGesture = hit.transform.gameObject.GetComponent<ComponentGesture>();
     *      if (targetGesture == null)
     *      {
     *          throw new System.Exception("Expected IGestureType script not found on object " + hit.transform.gameObject.name);
     *      }
     *      if (targetGesture.GesturesEnabled && targetGesture.MeetsTriggerSpeed(velocity))
     *      {
     *          //Debug.Log("Accepted by target gesture " + targetGesture.GetType().ToString() + " with velocity: " + velocity + " and the magnitude was: " + velocity.magnitude);
     *
     *          //since this is only currently being used for windups, I'm adding logic to make it only draw at relevant times.
     *          /*
     *          if (acceptNewRender && renderRelevant && !inMiddleOfDrop)
     *          {
     *              gestureVectorRenderer.enabled = true;
     *              acceptNewRender = false;
     *              gestureVectorRenderer.SetPosition(0, ray.origin);
     *              gestureVectorRenderer.SetPosition(1, hit.point);
     *              //StartCoroutine(DeleteRayAfterPause());
     *          }
     *          return targetGesture;
     *
     *      }
     *  }
     *
     *
     *  return EmptyGesture;
     * }
     */

    /*
     * IEnumerator DeleteRayAfterPause()
     * {
     *  yield return new WaitForSeconds(0.2f);
     *  acceptNewRender = true;
     *  yield return new WaitForSeconds(0.3f);
     *  gestureVectorRenderer.enabled = false;
     * }
     *
     * void AllowLineDrawing(SongName songName)
     * {
     *  if (songName == SongName.PaperclipSwarm)
     *  {
     *      renderRelevant = true;
     *  }
     * }
     * void DisallowLineDrawing()
     * {
     *  renderRelevant = false;
     *  StereoRail_AudioManager.NewMeasureEvent -= AreWeInDrop;
     *
     * }
     */

    void DropActiveMeasuring(DropColor dropColor, int integer)
    {
        StereoRail_AudioManager.NewMeasureEvent += AreWeInDrop;
    }
Пример #24
0
 void GrandEntrance(DropColor dColor, int dLength)
 {
     anim.Play("StingerEntranceGrowth");
 }