예제 #1
0
파일: GameManager.cs 프로젝트: Surench/SD
    public void GameOver()
    {
        GameOverPanel.SetActive(true);
        GamePanel.SetActive(false);

        levelManager.LevelFailed();

        if (scoreManager.Score > DataManager.GetBestScore())
        {
            DataManager.SetBestScore(scoreManager.Score);
        }

#if UNITY_IOS
        if (TapticEnabled)
        {
            TapticEngine.TriggerError();
        }
#endif


        GameAnalytics.NewProgressionEvent(GAProgressionStatus.Fail, Application.version, LevelManager.currentLevel);


        scoreManager.ResetScore();
    }
예제 #2
0
    public void ShootPlayer()
    {
        if (GameManager.self.scoreManager.TotalShotsAmount > 0)
        {
            GameObject    obj           = Instantiate(Stickman, transform.position, Quaternion.identity);
            BotController botController = obj.GetComponent <BotController>();
            botControllers.Add(botController);

            GameManager.self.scoreManager.PlayerShooted();

            if (GameManager.self.scoreManager.TotalShotsAmount == 0)
            {
                botController.LastStickman();
            }

#if UNITY_IOS
            if (GameManager.TapticEnabled)
            {
                TapticEngine.TriggerLight();
            }
#endif
        }


        anim.Play(GameManager.self.StringToHashes[49], -1, 0);
    }
예제 #3
0
 void Awake()
 {
     //Set callback method like this to add more functions to listener
     slider.onValueChanged.AddListener(delegate { SliderTaptic(); });
     //Set callback like this if no other functions needed
     scrollRect.onValueChanged.AddListener(delegate { TapticEngine.TriggerSelectionChange(); });
 }
예제 #4
0
파일: AiController.cs 프로젝트: Surench/HED
    public void Triggered(ContactPoint[] contactPoints, Collision collision)
    {
        if (!AIisStanding)
        {
            return;
        }
        AIisStanding = false;


        MaincapsuleCollider.enabled = false;
        DisableKinematic(false);

        if (MovmentC != null)
        {
            StopCoroutine(MovmentC);
        }
        if (RunToBombC != null)
        {
            StopCoroutine(RunToBombC);
        }

        anim.enabled = false;

        selfMaterial.material = GameManager.self.BotMaterial;

        if (collision.gameObject.name.Equals(GameManager.HeadName))
        {
            GameManager.self.scoreManager.AddScore(1);
        }
        else
        {
            GameManager.self.scoreManager.AddScore(1);
        }



#if UNITY_IOS
        if (GameManager.TapticEnabled)
        {
            TapticEngine.TriggerLight();
        }
#endif

        if (piramidaController != null)
        {
            piramidaController.DisableAboveRagdoll();
        }

        HitEffects.SetActive(true);
        HitEffects.transform.position = contactPoints[0].point;

        if (switchParent)
        {
            SwitchTransformParent();
        }
    }
예제 #5
0
    public void CollectDiamond()
    {
        animator.Play("collectDiamond", -1, 0);

        GameManager.self.soundManager.diamondSound();

        GameManager.self.scoreManager.AddDiamond();


#if UNITY_IOS
        if (GameManager.TapticEnabled)
        {
            TapticEngine.TriggerMedium();
        }
#endif
    }
예제 #6
0
파일: AiController.cs 프로젝트: Surench/HED
    public void FallDown()
    {
        if (!AIisStanding)
        {
            return;
        }
        AIisStanding = false;

        MaincapsuleCollider.enabled = false;

        DisableKinematic(false);


        anim.enabled = false;

        AddRandomRotation();

        selfMaterial.material = GameManager.self.BotMaterial;

        GameManager.self.scoreManager.AddScore(1);

#if UNITY_IOS
        if (GameManager.TapticEnabled)
        {
            TapticEngine.TriggerLight();
        }
#endif
        if (piramidaController != null)
        {
            piramidaController.DisableAboveRagdoll();
        }

        if (RunToBombC != null)
        {
            StopCoroutine(RunToBombC);
        }

        if (switchParent)
        {
            SwitchTransformParent();
        }
    }
예제 #7
0
 public void Heavy()
 {
     Debug.Log("Triggered Heavy Haptic");
     TapticEngine.TriggerHeavy();
 }
예제 #8
0
 public void Light()
 {
     Debug.Log("Triggered Light Haptic");
     TapticEngine.TriggerLight();
 }
예제 #9
0
 public void Medium()
 {
     Debug.Log("Triggered Medium Haptic");
     TapticEngine.TriggerMedium();
 }
예제 #10
0
 public void Error()
 {
     Debug.Log("Triggered Error Haptic");
     TapticEngine.TriggerError();
 }
예제 #11
0
 public void Success()
 {
     Debug.Log("Triggered Success Haptic");
     TapticEngine.TriggerSuccess();
 }
예제 #12
0
 public void ShowPaletteError(int id)
 {
     this.paletterLabel.text = LocalizationService.Instance.GetTextByKey("game_wrongPalette").Replace("1", id.ToString());
     base.Open(this.palette, FMPopupManager.FMPopupPriority.ForceOpen);
     TapticEngine.Trigger(TapticEngine.FeedbackType.Light);
 }
예제 #13
0
 //Methods called by buttons OnClick
 public void Warning()
 {
     Debug.Log("Triggered Warning Haptic");
     TapticEngine.TriggerWarning();
 }
예제 #14
0
 void Start()
 {
     this.GetComponent <Button>().onClick.AddListener(() => TapticEngine.Selection());
 }
예제 #15
0
 void Start()
 {
     this.GetComponent <Button>().onClick.AddListener(() => TapticEngine.Notification(this.NotificationType));
 }
예제 #16
0
 public void ShowHintPickColor()
 {
     base.Open(this.hintSelectColor, FMPopupManager.FMPopupPriority.ForceOpen);
     TapticEngine.Trigger(TapticEngine.FeedbackType.Light);
 }
예제 #17
0
    IEnumerator MovementRoutine()
    {
        Vector3 startPos;
        Vector3 endPos;

        float t;
        float startT;
        float currentMovementSpeed = maximumMinumumSpeed.y;

        charController.Moving();

        bool continueMovement = true;

        ControlEnabled = false;
        yield return(new WaitForSeconds(0.08f));


        GameManager.self.soundManager.fixPitch();

        GameManager.self.scoreManager.ResetRawCounter();

        while (continueMovement)
        {
#if UNITY_IOS
            if (GameManager.TapticEnabled)
            {
                TapticEngine.TriggerLight();
            }
#endif



            ControlEnabled = false;

            StopFollowStair();

            if (!CheckIfGameOverMove())
            {
                startPos      = transform.position;
                StepsCounter += 1;
                endPos        = CalculateNewPos(startPos);

                StairController enteredStairController = GameManager.self.sceneManager.StairEntered(StepsCounter);
                GameManager.self.sceneManager.StairPassed(StepsCounter - 1);
                t      = 0;
                startT = Time.time;

                while (t < 1)
                {
                    yield return(new WaitForFixedUpdate());

                    t = (Time.time - startT) / currentMovementSpeed;

                    transform.position = Vector3.Lerp(startPos, endPos, t);

                    transform.rotation = Quaternion.Lerp(transform.rotation, Quaternion.Euler(enteredStairController.transform.localEulerAngles), t);
                }
                transform.position = Vector3.Lerp(startPos, endPos, 1);



                currentMovementSpeed -= movementAcceleration;
                if (currentMovementSpeed < maximumMinumumSpeed.x)
                {
                    currentMovementSpeed = maximumMinumumSpeed.x;
                }

                StepCompleted(enteredStairController);

                ControlEnabled = true;

                continueMovement = isPointerDown;
            }
            else
            {
                break;
            }
        }
    }
예제 #18
0
 public void ShowWrongColor()
 {
     base.Open(this.wrongColor, FMPopupManager.FMPopupPriority.ForceOpen);
     TapticEngine.Trigger(TapticEngine.FeedbackType.Light);
 }
예제 #19
0
 public void ShowEmptyHints()
 {
     base.Open(this.hintsEmpty, FMPopupManager.FMPopupPriority.Normal);
     TapticEngine.Trigger(TapticEngine.FeedbackType.Light);
 }
예제 #20
0
 public void ShowPicSaved()
 {
     base.Open(this.picSaved, FMPopupManager.FMPopupPriority.Normal);
     TapticEngine.Trigger(TapticEngine.FeedbackType.Light);
 }
예제 #21
0
 public void SelectionChange()
 {
     Debug.Log("Triggered Selection Change Haptic");
     TapticEngine.TriggerSelectionChange();
 }
예제 #22
0
 //Listener
 private void SliderTaptic()
 {
     TapticEngine.TriggerSelectionChange();
     Debug.Log("Slider triggered Selection Change");
 }
예제 #23
0
 void Start()
 {
     this.GetComponent <Button>().onClick.AddListener(() => TapticEngine.Impact(this.ImpactType));
 }
예제 #24
0
 public void ShowHintAlreadyPainted()
 {
     base.Open(this.hintAlreadyPainted, FMPopupManager.FMPopupPriority.ForceOpen);
     TapticEngine.Trigger(TapticEngine.FeedbackType.Light);
 }