Beispiel #1
0
 void Start()
 {
     _vbX   = -95.0f;
     _vbY   = -10.0f;
     _vbZ   = -600.0f;
     _vBall = new Vector3(_vbX, _vbY, _vbZ);
     _myTransform.transform.position = _vBall;
     _myTransform.particleSystem.Play();
     L1s = (Level1_Sound)CameraSound.GetComponent("Level1_Sound");
 }
 void OnMouseDown()
 {
     if (battleBegin == true && shoot == true && this.gameObject.transform.renderer.enabled == true)         //если сражение началось и разрешен выстрел
     //звук выстрела.
     {
         Level1_Sound L1s = (Level1_Sound)CameraSound.GetComponent("Level1_Sound");
         L1s.Fire();
         //--------------
         targetForBall = this.gameObject.tag;
         selectTarget  = this.gameObject;
         whoShoots     = "User";             //выстрел пользователя
         this.gameObject.transform.renderer.enabled = false;
         shoot = false;
     }
 }