Пример #1
0
    void Awake()
    {
        camera     = GameObject.Find("Camera").GetComponent <Animator>();
        player     = GameObject.FindGameObjectWithTag("Player");
        camControl = GameObject.Find("/Camera").GetComponent <T10_CameraController>();
        if (bulletType == BULLETS.SNIPER)
        {
            damageBullet = 3;
        }
        else if (bulletType == BULLETS.GRENADE)
        {
            damageBullet = 0;
            StartCoroutine("ExplodeAfterDelay");
        }
        else if (bulletType == BULLETS.GLACE)
        {
            GetComponent <SpriteRenderer>().color = Color.blue;
        }
        else
        {
            damageBullet = 1;
        }

        Destroy(gameObject, 2);
    }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     rb         = GetComponent <Rigidbody2D>();
     col        = GetComponent <Collider2D>();
     camControl = GameObject.Find("/Camera").GetComponent <T10_CameraController>();
     smiley     = SMILEY.SLIGHTSMILE;
     lastSmiley = smiley;
     WhichSmiley(smiley);
     speed = Speed.Value;
     shieldConsumedUI.SetActive(true);
     shieldUI.SetActive(true);
 }
Пример #3
0
    IEnumerator StartExplode()
    {
        yield return(new WaitForSeconds(0.5f));

        GetComponent <Collider2D>().enabled = true;

        timeSave   = Time.time;
        camControl = GameObject.Find("/Camera").GetComponent <T10_CameraController>();
        camControl.ShakeCamera(shakeDur.Value, shakeAm.Value);
        player   = GameObject.FindGameObjectWithTag("Player");
        isUpdate = true;
        Destroy(gameObject, 2);
    }