Exemple #1
0
    void Start()
    {
        if (photonView.IsMine)
        {
            photonView.RPC("SetPlayerTeam", RpcTarget.OthersBuffered, this.gameObject.layer);
            GameObject.FindObjectOfType <VictoryPointsManager>().gameObject.layer = this.gameObject.layer; //TODO Remove this bullshit ASAP

            player_camera = Camera.main;
            if (gameObject.layer == LayerMask.NameToLayer("TeamRed"))
            {
                player_camera.transform.Rotate(-65, 0, 0);
                player_camera.transform.Rotate(0, 180, 0);
                player_camera.transform.Rotate(65, 0, 0);

                camera_offset.z = Mathf.Abs(camera_offset.z);
            }
            cc_manager = GetComponent <CrowdControlManager>();

            player_panel = PhotonNetwork.Instantiate("PlayerPanel", Vector3.zero, Quaternion.identity, 0);
            player_panel.GetPhotonView().Owner.TagObject = this.gameObject;
            player_panel_script = player_panel.GetComponent <PlayerPanel>();

            element_changer = PhotonNetwork.Instantiate("ElementChangePanel", Vector3.zero, Quaternion.identity, 0);
            element_changer.GetPhotonView().Owner.TagObject = this.gameObject;
            element_changer_script = element_changer.GetComponent <UIElementChanger>();

            p_controller = GetComponent <PlayerController>();

            bottled_fire     = transform.GetComponent <FirePlayer>();
            bottled_earth    = transform.GetComponent <EarthPlayer>();
            bottled_water    = transform.GetComponent <WaterPlayer>();
            bottled_ice      = transform.GetComponent <IcePlayer>();
            bottled_plant    = transform.GetComponent <PlantPlayer>();
            bottled_air      = transform.GetComponent <AirPlayer>();
            bottled_electric = transform.GetComponent <ElectricPlayer>();

            SetPlayerStatsByElement(PlayerElementBottled.Non_Element);
        }
    }
Exemple #2
0
 // Update is called once per frame
 void Update()
 {
     fireP = GameObject.FindGameObjectWithTag("Player").GetComponent <FirePlayer> ();
 }