コード例 #1
0
 void Awake()
 {
     inPublicRoom = PlayerPrefs.GetInt("isInPublicWorld");
     friendsPreviousAccessories = new Dictionary <int, List <GameObject> >();
     if (!photonView.IsMine)
     {
         otherPlayer = true;
     }
     else
     {
         mainCam = Resources.Load("Main Camera") as GameObject;
         mainCam = Instantiate(mainCam);
         PlayerFollow cameraScript = mainCam.GetComponent <PlayerFollow>();
         cameraScript.SetCameraTarget(transform, inPublicRoom);
         GameObject itemControllerObject = GameObject.FindGameObjectWithTag("ItemPlacementController") as GameObject;
         PV          = transform.GetComponent <PhotonView>();
         username    = PlayerPrefs.GetString("username");
         accessories = PlayerPrefs.GetString("Accessories");
         string tats = PlayerPrefs.GetString("Asdfad");
         previousAccesories = new List <GameObject>();
         // SetCharacterAccessories(accessories, previousAccesories, transform);
         PV.RPC("RPC_ChangeCharacterName", RpcTarget.AllBuffered, username, PV.ViewID);
         PV.RPC("RPC_SetCharacterAccessories", RpcTarget.AllBuffered, accessories, PV.ViewID);
         itemLoader = GameObject.FindGameObjectWithTag("ItemLoader");
         if (inPublicRoom == 1)
         {
             GameObject.FindGameObjectWithTag("Canvas").GetComponent <InputHandler>().SetTarget(this);
             itemLoader.GetComponent <ItemLoaderStore>().SetCamera(mainCam.GetComponent <PlayerFollow>());
         }
         else
         {
             roomID   = PlayerPrefs.GetString("currentRoomID");
             myRoomID = PlayerPrefs.GetString("myRoomID");
             myRoom   = roomID == myRoomID;
             if (myRoom)
             {
                 GameObject itemController = GameObject.FindGameObjectWithTag("ItemPlacementController");
                 itemController.GetComponent <ItemPlacementController>().SetTarget(transform);
                 itemLoader.GetComponent <ItemLoader>().SetCamera(mainCam.GetComponent <PlayerFollow>());
                 CharacterChange charChange = GameObject.FindGameObjectWithTag("CharacterChange").GetComponent <CharacterChange>();
                 charChange.SetTargetCharacter(this);
                 charChange.UpdateAccessories(accessories);
                 GameObject notificationManager = GameObject.FindGameObjectWithTag("NotificationManager");
                 notificationManager.GetComponent <InnerNotifManagerScript>().SetCharacterTarget(transform, username, myRoomID);
             }
         }
     }
 }
コード例 #2
0
 void Start()
 {
     if (!otherPlayer)
     {
         username = PlayerPrefs.GetString("username");
         mainCam  = Resources.Load("Main Camera") as GameObject;
         mainCam  = Instantiate(mainCam);
         PlayerFollow cameraScript = mainCam.GetComponent <PlayerFollow>();
         cameraScript.SetCameraTarget(transform, 0);
     }
     animator       = GetComponent <Animator>();
     joystick       = FindObjectOfType <Joystick>();
     targetRotation = transform.rotation;
     //rBody = GetComponent<Rigidbody>();
     forwardInput        = turnInput = 0;
     characterController = transform.GetComponent <CharacterController>();
 }
コード例 #3
0
 public void SetMainCam(PlayerFollow cam)
 {
     mainCam = cam;
 }
コード例 #4
0
 public void AddCameraToCustomizer(PlayerFollow cam)
 {
     customizer.SetCam(cam);
 }
コード例 #5
0
 void Awake()
 {
     inPublicRoom = PlayerPrefs.GetInt("isInPublicWorld");
     friendsPreviousAccessories = new Dictionary <int, List <GameObject> >();
     itemLoader = GameObject.FindGameObjectWithTag("ItemLoader");
     if (!photonView.IsMine)
     {
         otherPlayer = true;
         if (inPublicRoom == 1)
         {
             ChatManager = (GameObject.FindGameObjectWithTag("ChatManager") as GameObject).GetComponent <PublicWorldChatManager>();
         }
     }
     else
     {
         charSetup = PlayerPrefs.GetString("myCharacter");
         SetUpCharacter(charSetup);
         mainCam = Resources.Load("Main Camera") as GameObject;
         mainCam = Instantiate(mainCam);
         PlayerFollow cameraScript = mainCam.GetComponent <PlayerFollow>();
         cameraScript.SetCameraTarget(characterController.transform, inPublicRoom);
         GameObject itemControllerObject = GameObject.FindGameObjectWithTag("ItemPlacementController") as GameObject;
         PV                 = transform.GetComponent <PhotonView>();
         username           = PlayerPrefs.GetString("username");
         previousAccesories = new List <GameObject>();
         PV.RPC("RPC_ChangeCharacterName", RpcTarget.AllBuffered, username, PV.ViewID);
         PV.RPC("RPC_SetCharacterAccessories", RpcTarget.AllBuffered, charSetup, PV.ViewID);
         if (inPublicRoom == 1)
         {
             ChatManager = (GameObject.FindGameObjectWithTag("ChatManager") as GameObject).GetComponent <PublicWorldChatManager>();
             ChatManager.SetMainCharacter(this);
             publicWorldInterestGroup = -1;
             currentlyTalkingTo       = "";
             GameObject.FindGameObjectWithTag("Canvas").GetComponent <InputHandler>().SetTarget(this);
             itemLoader.GetComponent <ItemLoaderStore>().ShareProperties(mainCam.GetComponent <PlayerFollow>(), transform);
             uiManager = itemLoader.GetComponent <ItemLoaderStore>().ReturnUIManager();
             uiManager.GetComponent <UIManagerPublicScript>().AddPlayerToOtherComponents(this);
             uiManager.GetComponent <UIManagerPublicScript>().SetSitDownListeners(SitDown, StandUp);
             SetParticipateInConvoCollider();
             StartCoroutine(ActivateChat());
         }
         else
         {
             roomID   = PlayerPrefs.GetString("currentRoomID");
             myRoomID = PlayerPrefs.GetString("myRoomID");
             myRoom   = roomID == myRoomID;
             itemLoader.GetComponent <ItemLoader>().SetCamera(mainCam.GetComponent <PlayerFollow>());
             uiManager = itemLoader.GetComponent <ItemLoader>().ReturnUIManager();
             uiManager.GetComponent <UIManagerScript>().SetSitDownListeners(SitDown, StandUp);
             uiManager.GetComponent <UIManagerScript>().SetGamingManagerCharacter(this);
             uiManager.GetComponent <UIManagerScript>().AddCameraToCustomizer(mainCam.GetComponent <PlayerFollow>());
             SetParticipateInConvoCollider();
             if (myRoom)
             {
                 GameObject itemController = GameObject.FindGameObjectWithTag("ItemPlacementController");
                 itemController.GetComponent <ItemPlacementController>().SetTarget(transform);
                 CharacterChange charChange = GameObject.FindGameObjectWithTag("CharacterChange").GetComponent <CharacterChange>();
                 charChange.SetTargetCharacter(this);
                 // charChange.UpdateAccessories(accessories);
                 GameObject notificationManager = GameObject.FindGameObjectWithTag("NotificationManager");
                 notificationManager.GetComponent <InnerNotifManagerScript>().SetCharacterTarget(transform, username, myRoomID);
             }
             else
             {
                 GameObject notificationManager = GameObject.FindGameObjectWithTag("NotificationManager");
                 notificationManager.GetComponent <InnerNotifManagerScript>().SetCoinsforUser(username);
             }
         }
     }
 }
コード例 #6
0
ファイル: ItemLoaderStore.cs プロジェクト: cezzzanne/3dspaces
 public void SetCamera(PlayerFollow cam)
 {
     mainCam = cam;
 }
コード例 #7
0
 public void ShareProperties(PlayerFollow cam, Transform character)
 {
     mainCam = cam;
     PhotoManager.ShareProperties(cam, character);
 }
コード例 #8
0
 public void SetCam(PlayerFollow cam)
 {
     gameCam = cam;
     gameCam.SetEditableCharacter(MaleChar.transform); // male and female are in same pos
 }
コード例 #9
0
ファイル: ItemLoader.cs プロジェクト: cezzzanne/spacesscripts
 public void SetCamera(PlayerFollow cam)
 {
     mainCam = cam;
     PhotoManager.GetComponent <PhotoManagerScript>().SetMainCam(cam);
     ItemRemover.GetComponent <ItemRemover>().SetMainCam(cam);
 }
コード例 #10
0
 public void ShareProperties(PlayerFollow cam, Transform character)
 {
     mainCam = cam;
     characterCustomization = character.GetComponent <CharacterCustomization>();
 }