Example #1
0
    public void SwitchOnOthersCone()
    {
        GameObject[] objs = GameObject.FindGameObjectsWithTag("remoteavatar");

        foreach (GameObject obj in objs)
        {
            RemoteVisualCone rvc = obj.GetComponentInChildren <RemoteVisualCone>();
            if (rvc != null)
            {
                if (!rvc.visible)
                {
                    rvc.SwitchVis();
                }
            }
        }


        ///this is just for recording purposes
        GameObject objc = GameObject.FindGameObjectWithTag("owncone");

        if (objc != null)
        {
            cone c = objc.GetComponent <cone>();
            if (!c.otherVisible)
            {
                c.SwitchOthersVis();
            }
        }
    }
Example #2
0
        private void button20_Click(object sender, EventArgs e)
        {
            cone   l = new cone();
            double p;

            p             = l.Cone(Convert.ToInt32(textBox1.Text), Convert.ToInt32(textBox1.Text));
            textBox1.Text = Convert.ToString(p);
        }
Example #3
0
    public void toggleOwnCone()
    {
        GameObject obj = GameObject.FindGameObjectWithTag("owncone");

        if (obj != null)
        {
            cone c = obj.GetComponent <cone>();
            c.SwitchVis();
        }
    }
Example #4
0
    //OBSERVER
    //local Observer
    void ObserverInstantiation()
    {
        Debug.Log("[PUN] instantiate Local Observer");

        //instantiate the local avatar
        localObserver = Instantiate(Resources.Load("ObserverCamera")) as GameObject;
        photonView    = localObserver.GetComponent <PhotonView>();

        //enable observer camera
        localObserver.tag = "MainCamera";


        if (PhotonNetwork.AllocateViewID(photonView))
        {
            RaiseEventOptions raiseEventOptions = new RaiseEventOptions
            {
                CachingOption = EventCaching.AddToRoomCache,
                Receivers     = ReceiverGroup.Others
            };

            PhotonNetwork.RaiseEvent(MasterManager.GameSettings.InstantiateObserverEventCode, photonView.ViewID, raiseEventOptions, SendOptions.SendReliable);

            Debug.Log("[PUN] Local Observer instantiated");

            //enablePhotonVoice()
            StartCoroutine(PhotonVoiceInstantiationForLocalObserver());
        }
        else
        {
            Debug.LogError("[PUN] Failed instantiate Local Observer, Failed to allocate a ViewId.");

            Destroy(localObserver);
        }

        //destroy the player controller
        Destroy(GameObject.Find("OVRPlayerController"));

        //destroy the player cone
        GameObject octagon = GameObject.Find("cone");

        if (octagon != null)
        {
            cone c = octagon.GetComponent <cone>();
            c.disabled = true;
        }

        //destroy UiHelpers
        DestroyImmediate(GameObject.Find("UIHelpersModified"));

        //enable observer recorder
        avatarRecorder.enabled = true;

        //create a folder for saving the data
        DataFolderCreation();
    }
Example #5
0
    public void SwitchOffOwnCone()
    {
        GameObject obj = GameObject.FindGameObjectWithTag("owncone");

        if (obj != null)
        {
            cone c = obj.GetComponent <cone>();
            if (c.visible)
            {
                c.SwitchVis();
            }
        }
    }