예제 #1
0
 public void RemoveHelm(Helm item)
 {
     if (helm.GetComponent <PhotonView>().ViewID == item.GetComponent <PhotonView>().ViewID)
     {
         int viewID = item.GetComponent <PhotonView>().ViewID;
         GameManager.instance.photonView.RPC("RemoveHelmRPC", RpcTarget.AllViaServer, new object[] { viewID, parentHero });
     }
     else
     {
         Debug.Log("Error hero inventory remove helm");
     }
 }
예제 #2
0
    public void SwitchTo(string station)
    {
        // disable all camera
        LobbyCamera.enabled    = false;
        HelmCamera.enabled     = false;
        TacticalCamera.enabled = false;
        SensorsCamera.enabled  = false;
        SensorsCamera.enabled  = false;

        // inactivate all interfaces
        Lobby.SetActive(false);
        Helm.SetActive(false);
        Tactical.SetActive(false);
        Sensors.SetActive(false);
        Sensors.SetActive(false);

        // activate the appropriate station
        switch (station)
        {
        case "lobby":
            LobbyCamera.enabled = true;
            Lobby.SetActive(true);
            Lobby.GetComponent <Lobby>().Activate();
            break;

        case "helm":
            HelmCamera.enabled = true;
            Helm.SetActive(true);
            Helm.GetComponent <Helm>().Activate();
            break;

        case "tactical":
            TacticalCamera.enabled = true;
            Tactical.SetActive(true);
            Tactical.GetComponent <Tactical>().Activate();
            break;

        case "sensors":
            SensorsCamera.enabled = true;
            Sensors.SetActive(true);
            Sensors.GetComponent <Sensors>().Activate();
            break;

        case "scanners":
            ScannersCamera.enabled = true;
            Scanners.SetActive(true);
            //Scanners.GetComponent<Scanners>().Activate();
            break;
        }
    }
예제 #3
0
    public void AddHelm2(Helm item)
    {
        string id = convertToKey(item.GetComponent <PhotonView>().ViewID);

        helm = item;
        AllTokens.Add(id, (Helm)item);
        if (GameManager.instance.MainHero.TokenName.Equals(parentHero))
        {
            EventManager.TriggerInventoryUIHeroUpdate(this);
        }
        else if (parentHero.Equals(CharChoice.choice.TokenName))
        {
            EventManager.TriggerInventoryUIHeroPeak(this);
        }
    }
예제 #4
0
 public bool AddHelm(Helm item)
 {
     if (helm == null)
     {
         int viewID = item.GetComponent <PhotonView>().ViewID;
         GameManager.instance.photonView.RPC("AddHelmRPC", RpcTarget.AllViaServer, new object[] { viewID, parentHero });
         return(true);
     }
     else
     {
         //Error already a helm
         EventManager.TriggerError(1);
         return(false);
     }
 }