Пример #1
0
    public void TogglePlayMode()
    {
        isPlayMode = !isPlayMode;

        buttonText.text = isPlayMode ? "Exit Play Mode" : "Play";
        mainCamera.SetActive(!isPlayMode);
        firstPersonController.SetActive(isPlayMode);

        GameController.IsPlayMode = isPlayMode;

        if (isPlayMode)
        {
            gizmoController.Hide();
        }
        else
        {
            firstPersonController.transform.position = initialPosition;
            firstPersonController.transform.rotation = initialRotation;
        }
    }
Пример #2
0
    void Start()
    {
        if (!GetComponent <Renderer>())
        {
            return;
        }

        NormalColor  = GetComponent <Renderer>().material.color;
        HilightColor = new Color(NormalColor.r * 1.2f, NormalColor.g * 1.2f, NormalColor.b * 1.2f, 1.0f);
        GC           = GameObject.Find("GizmoAdvancedCS").GetComponent <GizmoControllerCS>();

        if (GC == null)
        {
            Debug.LogError(this + " Unable To Find Gizmo Advanced Controller. Please be sure one is in the scene.");
        }
        else
        {
            GC.Hide();
        }
    }    //Start
Пример #3
0
    void Update()
    {
        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.D))
        {
            if (GizmoController.SelectedObject == this.transform)
            {
                InteractableObject clone = PhotonNetwork.Instantiate(gameObject.name.Replace("(Clone)", "").Trim(), transform.position, transform.rotation, 0).GetComponent <InteractableObject>();
                clone.transform.localScale = transform.localScale;
                clone.IsDuplicate          = true;
            }
        }

        if (Input.GetKeyDown(KeyCode.Delete))
        {
            if (GizmoController.SelectedObject == this.transform)
            {
                GizmoController.Hide();
                PhotonNetwork.Destroy(gameObject);
            }
        }
    }