예제 #1
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);
    }
예제 #2
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();
        }
    }
예제 #3
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();
        }
    }
예제 #4
0
 public void Light()
 {
     Debug.Log("Triggered Light Haptic");
     TapticEngine.TriggerLight();
 }
예제 #5
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;
            }
        }
    }