public void StopFade(AzumiEventType Event_Type, Component Sender, object Param = null)
        {
            StopAllCoroutines();
            Color color = myImage.color;

            color.a       = MaxOpacity;
            myImage.color = color;
        }
Esempio n. 2
0
 void OnEnterLevel(AzumiEventType azumiEventType, Component Sender, object Param = null)
 {
     if (musicEnabled)
     {
         AudioEventManager.PostEvent(AudioEventType.MainThemeFadeOut, this);
         AudioEventManager.PostEvent(AudioEventType.LevelThemeHardStart, this);
         AudioEventManager.PostEvent(AudioEventType.LossThemeFadeOut, this);
     }
 }
Esempio n. 3
0
        public void OnResetTimer(AzumiEventType Event_Type, Component Sender, object Param = null)
        {
            StopAllCoroutines();
            Color color = myImage.color;

            color.a            = 0;
            myImage.color      = color;
            fadeAlreadyStarted = false;
        }
Esempio n. 4
0
        public void OnExitLevelEarly(AzumiEventType azumiEventType, Component Sender, object Param = null)
        {
            Dictionary <string, object> paramList = AddStandardParameters(new Dictionary <string, object>());

            paramList.Add("Level", UnityEngine.SceneManagement.SceneManager.GetActiveScene().name);
            paramList.Add("Time", timerDict[AnalyticsEventType.StartLevel].GetElapsedTime());
            Analytics.CustomEvent("Exit", paramList);
            //print("Analytics OnExitLevelEarly:" + Analytics.CustomEvent("Exit", paramList));
            //OutputParams(azumiEventType.ToString(), paramList);
        }
 public void StartFade(AzumiEventType Event_Type, Component Sender, object Param = null)
 {
     if (Sender == myWall && notExpiredAlready)
     {
         notExpiredAlready = false;
         fadeParticles.Play();
         emission.enabled = true;
         StartCoroutine("FadeOut");
     }
 }
Esempio n. 6
0
 public void OnGameShift(AzumiEventType Event_Type, Component Sender, object Param = null)
 {
     //print("ArrowSpriteRenderer " +  ArrowSpriteRenderer );
     if (!flickering)
     {
         flickering = true;
     }
     SetMarkerRotation((Vector3)Param);
     CalculateFlickerInterval();
 }
Esempio n. 7
0
 public void StartFade(AzumiEventType Event_Type, Component Sender, object Param = null)
 {
     if (fadeDirection == FadeDirection.FadeIn)
     {
         StartCoroutine("FadeIn");
     }
     else
     {
         StartCoroutine("FadeOut");
     }
 }
Esempio n. 8
0
        public void onLevelPaused(AzumiEventType azumiEventType, Component Sender, object Param = null)
        {
            numberOfTimesPaused++;
            Dictionary <string, object> paramList = AddStandardParameters(new Dictionary <string, object>());

            paramList.Add("Level", UnityEngine.SceneManagement.SceneManager.GetActiveScene().name);
            paramList.Add("Time", timerDict[AnalyticsEventType.StartLevel].GetElapsedTime());
            paramList.Add("timesPaused", numberOfTimesPaused);
            Analytics.CustomEvent("Pause", paramList);
            //print("Analytics onLevelPaused:" + Analytics.CustomEvent("Pause", paramList));
            // OutputParams(azumiEventType.ToString(), paramList);
        }
Esempio n. 9
0
        void OnCoinPickup(AzumiEventType Event_Type, Component Sender, object Param = null)
        {
            if (Sender == collectible)
            {
                Collider2D currentCollider  = (Collider2D)Param;
                Vector3    currentDirection = currentCollider.attachedRigidbody.velocity.normalized;

                angleAxis = Vector3.Cross(currentDirection, Vector3.forward).normalized;

                StartPickupEffect();
            }
        }
Esempio n. 10
0
        public void OnSaveSettings(AzumiEventType azumiEventType, Component Sender, object Param = null)
        {
            Dictionary <string, object> paramList = AddStandardParameters(new Dictionary <string, object>());

            paramList.Add("NewMusic", SoundManager.MusicVolume);
            paramList.Add("NewFx", SoundManager.SoundFXVolume);
            paramList.Add("OldMusic", SoundManager.FormerMusicVolume);
            paramList.Add("OldFx", SoundManager.FormerSoundFXVolume);
            Analytics.CustomEvent("Settings", paramList);
            //print("Analytics OnSavedSettings:" + Analytics.CustomEvent("Settings", paramList));
            //OutputParams(azumiEventType.ToString(), paramList);
        }
Esempio n. 11
0
 public void OnLockLevel(AzumiEventType Event_Type, Component Sender, object Param = null)
 {
     if (!LevelManager.GetPlayerLevelStatus(chapterNumber, levelNumber))
     {
         lockIcon.Show();
         highScoreText.enabled = false;
         button.interactable   = false;
         whitePanel.SetActiveStatus(button.interactable);
         for (int i = 0; i < stars.Length; i++)
         {
             stars[i].Hide();
         }
     }
 }
Esempio n. 12
0
        public void OnGamePress(AzumiEventType Event_Type, Component Sender, object Param = null)
        {
            //print ("ArrowPivot == " +;
            if (InputManager.MainDirectionSelected)
            {
                ArrowSpriteRenderer.sprite = MainSprite;
            }
            else
            {
                ArrowSpriteRenderer.sprite = AltSprite;
            }
            startLocation = Camera.main.ViewportToWorldPoint(FixCoordinates((Vector3)Param));

            transform.position = startLocation;
        }
Esempio n. 13
0
        public void onLevelLost(AzumiEventType azumiEventType, Component Sender, object Param = null)
        {
            ScoreManager scoreManager             = GameObject.Find("ScoreManager").GetComponent <ScoreManager>();
            FPSDisplay   fpsDisplay               = GameObject.Find("SceneScripts").GetComponent <FPSDisplay>();
            Dictionary <string, object> paramList = AddStandardParameters(new Dictionary <string, object>());

            paramList.Add("Level", UnityEngine.SceneManagement.SceneManager.GetActiveScene().name);
            paramList.Add("NumPlays", LevelManager.Instance.GetTimesLevelPlayed());
            paramList.Add("Time", timerDict[AnalyticsEventType.StartLevel].GetElapsedTime());
            paramList.Add("result", scoreManager.GetReasonForLoss());
            paramList.Add("Coins", scoreManager.CoinsEarned);
            paramList.Add("fps", fpsDisplay.GetAverageFPS());
            Analytics.CustomEvent("Loss", paramList);
            // print("Analytics onLevelLost:" + Analytics.CustomEvent("Loss", paramList));
            //OutputParams(azumiEventType.ToString(), paramList);
        }
Esempio n. 14
0
        public void onEnterLevel(AzumiEventType azumiEventType, Component Sender, object Param = null)
        {
            //reset pause count for new level
            numberOfTimesPaused = 0;
            AddNewTimerObject(AnalyticsEventType.StartLevel);
            Dictionary <string, object> paramList = AddStandardParameters(new Dictionary <string, object>());

            paramList.Add("Level", UnityEngine.SceneManagement.SceneManager.GetActiveScene().name);
            paramList.Add("NumPlaysThisSession", LevelManager.Instance.GetTimesLevelPlayed());
            paramList.Add("Wins", LevelManager.Instance.GetWins());
            paramList.Add("Losses", LevelManager.Instance.GetLosses());

            Analytics.CustomEvent("StartLevel", paramList);
            // print("Analytics onEnterLevel:" + Analytics.CustomEvent("StartLevel", paramList));
            // OutputParams(azumiEventType.ToString(), paramList);
        }
Esempio n. 15
0
        public void OnPlayerActionEvent(AzumiEventType Event_Type, Component Sender, object Param = null)
        {
            if (sceneManager.GetCurrentState() == SceneState.Playing)
            {

                if (swipesRemaining > 0)
                {
                    swipesRemaining--;
                    doSwipesUpdate();
                }
                else
                {
                    EventManager.PostEvent(AzumiEventType.OutOfBounces, this);
                }
            }

        }
Esempio n. 16
0
        public void OnHitDoorEvent(AzumiEventType Event_Type, Component Sender, object Param = null)
        {

            if (!exitedDoorSafely)
            {
                exitedDoorSafely = true;

                if (NumberOfStars > 0)
                {

                    EventManager.PostEvent(AzumiEventType.LevelWon, this);
                }
                else
                {
                    EventManager.PostEvent(AzumiEventType.LevelLost, this);
                }
            }
        }
Esempio n. 17
0
        //-----------------------------------------------------------
        /// <summary>
        /// Function to add specified listener-object to array of listeners
        /// </summary>
        /// <param name="AzumiEventType">Event to Listen for</param>
        /// <param name="Listener">Object to listen for event</param>
        /// <remarks>
        /// This is an instance method. that is somewhat redundant with the static method ListenForEvent
        /// </remarks>
        public void AddListener(AzumiEventType azumiEventType, OnEvent Listener)
        {
            //List of listeners for this event
            List <OnEvent> ListenList = null;

            //New item to be added. Check for existing event type key. If one exists, add to list
            if (Listeners.TryGetValue(azumiEventType, out ListenList))
            {
                //List exists, so add new item
                ListenList.Add(Listener);
                return;
            }

            //Otherwise create new list as dictionary key
            ListenList = new List <OnEvent>();
            ListenList.Add(Listener);
            Listeners.Add(azumiEventType, ListenList); //Add to internal listeners list
        }
Esempio n. 18
0
 //---------------------------------------------------------
 /// <summary>
 /// Remove a listener for a single type and target
 /// </summary>
 /// <param name="AzumiEventType">Event Type to remove</param>
 /// <param name="Listener">Listening Object to remove</param>
 /// <remarks>
 /// kills only the event for designated listener, leaving others untouched
 /// </remarks>
 public void RemoveListener(AzumiEventType azumiEventType, OnEvent Listener)
 {
     if (Listeners.ContainsKey(azumiEventType))
     {
         List <OnEvent> tempList = new List <OnEvent>();
         for (int i = 0; i < Listeners[azumiEventType].Count; i++)
         {
             if (Listeners[azumiEventType][i] == Listener)
             {
                 //do nothing--this is the listener we want to eliminate
             }
             else
             {
                 //add to new list which will short;y replace the old one
                 tempList.Add(Listeners[azumiEventType][i]);
             }
         }
         Listeners[azumiEventType] = tempList;
     }
 }
Esempio n. 19
0
        //-----------------------------------------------------------

        /// <summary>
        ///  Posts  event to listeners
        /// </summary>
        /// <param name="azumiEventType">Event to invoke of type AzumiEventType</param>
        /// <param name="Sender">Object invoking event of type Component</param>
        /// <param name="Param">Optional argument of type Object</param>
        public void PostNotification(AzumiEventType azumiEventType, Component Sender, object Param = null)
        {
            //Notify all listeners of an event

            //List of listeners for this event only
            List <OnEvent> ListenList = null;

            //If no event entry exists, then exit because there are no listeners to notify
            if (!Listeners.TryGetValue(azumiEventType, out ListenList))
            {
                return;
            }

            //Entry exists. Now notify appropriate listeners
            for (int i = 0; i < ListenList.Count; i++)
            {
                if (!ListenList[i].Equals(null)) //If object is not null, then send message via interfaces
                {
                    ListenList[i](azumiEventType, Sender, Param);
                }
            }
        }
Esempio n. 20
0
        public void OnGameSwipe(AzumiEventType Event_Type, Component Sender, object Param = null)
        {
            Vector3 directionVector = (Vector3)Param;

            if (gamePointerDown && directionVector.magnitude != 0f)
            {
                //print ("OnGameSwipe " + directionVector);
                float   currentMagnitude = Mathf.Clamp(directionVector.magnitude, MinimumMagnitude, MaximumMagnitude);
                float   normalMagnitude  = currentMagnitude / MaximumMagnitude;
                Vector3 normalVector     = directionVector.normalized;

                //print ("vel " + Mathf.Clamp((normalMagnitude * MaximumVelocity), MinimumVelocity, MaximumVelocity));

                myRb.velocity = normalVector * Mathf.Clamp((normalMagnitude * MaximumVelocity), MinimumVelocity, MaximumVelocity);

                /*
                 * myRb.AddForce((Vector3)Param * onTapSpeed );
                 * myRb.velocity =Vector2.ClampMagnitude(myRb.velocity, clampSpeed);
                 * gamePointerDown = false;
                 */
            }
        }
Esempio n. 21
0
 void disableBlurBackGround(AzumiEventType Event_Type, Component Sender, object Param = null)
 {
     myImage.enabled = false;
 }
Esempio n. 22
0
 void DisplayBlurBackgroundEvent(AzumiEventType Event_Type, Component Sender, object Param = null)
 {
     renderCamera.TakeScreenshot(0, 0, Screen.width, Screen.height);
 }
Esempio n. 23
0
 void enableBlurBackGround(AzumiEventType Event_Type, Component Sender, object Param = null)
 {
     GetScreen();
     myImage.enabled = true;
 }
Esempio n. 24
0
 public void OnOutOfTime(AzumiEventType Event_Type, Component Sender, object Param = null)
 {
     ranOutOfTime = true;
     EventManager.PostEvent(AzumiEventType.LevelLost, this);
 }
Esempio n. 25
0
 public void OnOutOfBounces(AzumiEventType Event_Type, Component Sender, object Param = null)
 {
     EventManager.PostEvent(AzumiEventType.LevelLost, this);
 }
Esempio n. 26
0
 void onStartEndGameSequence(AzumiEventType azumiEventType, Component Sender, object Param = null)
 {
     StartCoroutine("Translate");
 }
Esempio n. 27
0
 public void OnResetProgress(AzumiEventType Event_Type, Component Sender, object Param = null)
 {
     SetUpNewPlayerData();
     WritePlayerLevelSettings();
 }
Esempio n. 28
0
        public void OnLevelLost(AzumiEventType Event_Type, Component Sender, object Param = null)
        {
            LevelPlayerData currentLevelData = ChapterPlayerDataList[lastChapterNumber - 1].LevelPlayerDataList[lastLevelNumber - 1];

            currentLevelData.Losses++;
        }
Esempio n. 29
0
 public void OnGameRelease(AzumiEventType Event_Type, Component Sender, object Param = null)
 {
     ArrowSpriteRenderer.enabled = false;
 }
Esempio n. 30
0
 public void Close(AzumiEventType Event_Type, Component Sender, object Param = null)
 {
     myWindowState = WindowState.closed;
     implementCurrentWindowState();
 }