示例#1
0
 void Start()
 {
     powerup_meter          = GameObject.FindObjectOfType <PowerupMeter>();
     movement_vector_scaler = INITIAL_MAGNITUDE_SCALER;
     wcl               = GameObject.FindObjectOfType <WallController>();
     photon_view       = GetComponent <PhotonView>();
     breakshot         = GameObject.FindObjectOfType <Breakshot>();
     audio_source      = GetComponent <AudioSource>();
     audio_source.clip = balls_bounce;
 }
示例#2
0
    public void InitializeBreakshot()
    {
        Breakshot preexisting = GameObject.FindObjectOfType <Breakshot>();

        if (preexisting)
        {
            Destroy(preexisting);
        }


        if (PhotonNetwork.connected && PhotonNetwork.isMasterClient)
        {
            GameObject g = PhotonNetwork.Instantiate(breakshot_prefab.name, new Vector3(0, 0, 0), Quaternion.identity, 0) as GameObject;
            g.GetComponent <Breakshot>().IsPracticeArena = PhotonNetwork.playerList.Length < 2;
        }
        else
        {
            GameObject g = Instantiate(breakshot_prefab, new Vector3(0, 0, 0), Quaternion.identity) as GameObject;
            g.GetComponent <Breakshot>().IsPracticeArena = true;
        }
    }
示例#3
0
 void Trigger()
 {
     breakshot = GameObject.FindObjectOfType <Breakshot>();
     //breakshot.Trigger();
     breakshot.RSGHasCompleted();
 }