void Awake()
 {
     shootPlayer = GameObject.FindObjectOfType <ShooterPlayer>();
     ActivateUI(shootBtn, false);
     ActivateUI(slidersUI, false);
     ActivateUI(retryBtn, false);
 }
Exemple #2
0
    private void CreaeteShooterPlayer(Gamepad pad)
    {
        GameObject    shooter       = Instantiate(ShooterPlayer);
        ShooterPlayer shooterPlayer = shooter.GetComponent <ShooterPlayer>();

        shooterPlayer.gamepad   = pad;
        shooterPlayer.playingUI = PlayingUIs[currentPlayer];
        shooterPlayer.playingUI.Starting();
    }
Exemple #3
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Ball")
        {
            player.isColliderWork = false;
            if (other.GetComponent <Rigidbody>().velocity.magnitude >= BallVelocity)
            {
                ShooterPlayer splayer = player.GetComponent <ShooterPlayer>();
                if (null != splayer)
                {
                    splayer.AddCatchCount();
                }
            }

            Destroy(other.gameObject);
            player.CatchBall();

            Invoke("ColliderWork", 0.5f);
        }
    }
    // Use this for initialization
    void Start()
    {
        shooting              = false;
        currentEnergy         = maxEnergy;
        overHeat              = false;
        initialEnergyBarWidth = energyBar.rectTransform.rect.width;
        if (!INSTANCE)
        {
            INSTANCE = this;
        }

        if (maxlifes == 0)
        {
            lifes = 3;
        }
        else
        {
            lifes = maxlifes;
        }
        left = (VolumetricLineBehavior)Instantiate(VolumetricLineBehavior, GlassesManager.transform, false);
        left.SetLinePropertiesAtStart = true;
        left.StartPos = 1.5f * Vector3.left;
        left.EndPos   = Vector3.forward * 150;
        right         = (VolumetricLineBehavior)Instantiate(VolumetricLineBehavior, GlassesManager.transform, false);
        right.SetLinePropertiesAtStart = true;
        right.StartPos = 1.5f * Vector3.right;
        right.EndPos   = Vector3.forward * 150;


        left.LineWidth  = 1;
        right.LineWidth = 1;
        left.LineColor  = Color.red;
        right.LineColor = Color.red;
        left.gameObject.SetActive(false);
        right.gameObject.SetActive(false);
    }