Пример #1
0
    void Start()
    {
        _uiManager        = FindObjectOfType <UIManager>();
        shakingCamera     = FindObjectOfType <ProCamera2DShake>();
        transisiCamera    = FindObjectOfType <ProCamera2DTransitionsFX>();
        DamageTextManager = FindObjectOfType <UltimateTextDamageManager>();

        for (int i = 0; i < hitTrigger.Length; i++)
        {
            _hitTrigger.Push(hitTrigger[i]);
        }
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        shaker     = GetComponent <ProCamera2DShake>();
        duration   = 2.0f;
        strength   = new Vector2(2, 2);
        vibrato    = 10;
        randomness = 0.1f;

        initialAngle = -1;
        rotation     = default(Vector3);
        smoothness   = 0.1f;
    }
Пример #3
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (shaker == null)
     {
         shaker = ProCamera2D.Instance.GetComponent <ProCamera2DShake>();
     }
     if (collision.relativeVelocity.magnitude > velocityShakeThreshold)
     {
         AudioSource.PlayClipAtPoint(impactSingle, transform.position);
         AudioSource.PlayClipAtPoint(impactAudios.GetRandom(), transform.position);
         StartCoroutine(ImpactCoroutine(collision.relativeVelocity));
     }
 }
Пример #4
0
 private void Awake()
 {
     ProCamera2D      = GetComponent <ProCamera2D>();
     ProCamera2DShake = GetComponent <ProCamera2DShake>();
 }
Пример #5
0
 private void OnValidate()
 {
     NumericBoundaries = GetComponent <ProCamera2DNumericBoundaries>();
     prcShake          = GetComponent <ProCamera2DShake>();
     procam            = GetComponent <ProCamera2D>();
 }