using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class MouseFire : MonoBehaviour { private SpriteRenderer BtnSpriteR; public Sprite[] BtnSprites; public GameObject goMainCamera; // Use this for initialization void Start () { BtnSpriteR = this.gameObject.GetComponent(); } // Update is called once per frame void Update () { } void OnMouseDown() { Debug.Log("OnMouseDown"); BtnSpriteR.sprite = BtnSprites[1]; SpawnBullets sb = goMainCamera.GetComponent (); sb.bShock=true; } void OnMouseUp() { Debug.Log("OnMouseUp"); BtnSpriteR.sprite = BtnSprites[0]; SpawnBullets sb = goMainCamera.GetComponent (); sb.bShock=false; } }