コード例 #1
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Return))
     {
         cameraShake.LittleShake();
     }
     if (Input.GetKeyDown(KeyCode.Space))
     {
         cameraShake.BigShake();
     }
 }
コード例 #2
0
    void CheckForAsteroids()
    {
        RaycastHit2D hit = Physics2D.Raycast(transform.position, Vector2.right, 100, enemyLayer);

        if (hit)
        {
            cameraShake.BigShake();
            Destroy(hit.transform.gameObject);
            state.amounts["worldHealth"]--;
        }
    }
コード例 #3
0
    public IEnumerator TriggerFX()
    {
        yield return(new WaitForSeconds(attacks[i].triggerImpactFXDelay));

        GameObject g = Instantiate(attacks[i].HitFX, transformFX);

        g.GetComponent <DestroyFX>().destroyFX = true;
        if (moveDirection == false)
        {
            g.transform.position = attacks[i].ImpactPositionRight.transform.position;
        }
        if (moveDirection == true)
        {
            g.transform.position = attacks[i].ImpactPositionLeft.transform.position;
        }
        StartCoroutine(cameraS.BigShake());
    }
コード例 #4
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Return))
     {
         CameraShake.LittleShake();
     }
     else if (Input.GetKeyDown(KeyCode.Space))
     {
         CameraShake.BigShake();
     }
     else
     {
         // CameraShake adds to the current pose of the camera.
         // Therefore, we have to maintain its "base pose" for the example.
         _cameraTransform.position = _basePosition;
         _cameraTransform.rotation = _baseRotation;
     }
 }
コード例 #5
0
    IEnumerator QuickPause()
    {
        state.TogglePause(true);
        yield return(new WaitForSeconds(0.035f));

        state.TogglePause(false);
        moveObeject.PushBack();
        if (health <= 0)
        {
            Destroy();
            cameraShake.BigShake();
        }
        else
        {
            cameraShake.SmallShake();
            animator.Play("hit");
        }
    }