Пример #1
0
 // Use this for initialization
 void Awake()
 {
     bulletList = new List <Bullet>();
     if (SpicySpriteManager.Instance != null)
     {
         Debug.LogError("2 or more SpicySpriteManager instances were found!");
     }
     SpicySpriteManager.Instance = this;
     StartCoroutine(CleanupSprites());
 }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            SpicySpriteManager.AddBullet(muzzle.position, muzzle.rotation);

            audioSource.Play();
        }

        else if (Input.GetKeyDown(KeyCode.Q))
        {
            GameObject shot = Instantiate(bulletTimePrefab, muzzle.position, muzzle.rotation);
        }
    }