// Start is called before the first frame update
    void Start()
    {
        m_DrawableLine    = GetComponent <RealtimeDrawableLine>();
        m_DrawableArea    = GetComponent <RealtimeDrawableArea>();
        m_DrawableVolume  = GetComponent <RealtimeDrawableVolume>();
        m_DrawableSphere  = GetComponent <RealtimeDrawableSphere>();
        m_DrawablePolygon = GetComponent <DrawablePolygon>();

        // For introduction
        m_DrawableVolume.AddListener(() => { mIntroductionScript.CheckVolume(m_DrawableVolume.m_LastCreatedShape.transform, RealtimeDrawableVolume.m_SubdivisionScale); },
                                     RealtimeDrawableVolume.ListenerType.PostFinish);


        m_CurrentTool = Tool.None;
        //        m_ToolText = GameObject.Find("ActiveToolText").GetComponent<Text>();

        mIntroductionScript = FindObjectOfType <IntroductionScript>();

        UpdateGridScale();
        GlobalGridScale.AddScaleListener(UpdateGridScale);

        m_Line   = m_Shape.transform.Find("Line").gameObject;
        m_Area   = m_Shape.transform.Find("Area").gameObject;
        m_Volume = m_Shape.transform.Find("Volume").gameObject;
        m_Mesh   = m_Shape.transform.Find("Mesh").gameObject;

        m_PointerController = m_Pointer.GetComponent <PointerController>();

        penInput           = FindObjectOfType <NetworkPenInputController>();
        initialPenPosition = penInput.transform.position;

        deleteTool = FindObjectOfType <DeleteToolOld>();
        initialDeleteToolPosition = deleteTool.transform.position;
    }
Esempio n. 2
0
    void Start()
    {
        m_Parent          = transform.parent.gameObject;
        m_RectTransform   = gameObject.GetComponent <RectTransform>();
        m_BaseScale       = m_RectTransform.localScale;
        m_BaseWidthHeight = m_RectTransform.sizeDelta;

        UpdateSpecific = NOP;

        if (m_Parent.name.Contains("Clone"))
        {
            if (m_Parent.name.Contains("Line"))
            {
                m_ScaleDim      = "y";
                m_FollowCamera  = true;
                scaleMultiplier = .5f;
                m_OriginalImage = transform.Find("Image").gameObject;

                UpdateSpecific = SpecificUpdate;
            }
            else if (m_Parent.name.Contains("Volume"))
            {
                m_VolumeForwardController = m_Parent.GetComponent <VolumeForwardController>();
                m_ScaleDim               = "x";
                m_OriginalImage          = transform.Find("Image (Horz)").gameObject; // TODO: rename
                m_CrossAxisOriginalImage = transform.Find("Image (Vert)").gameObject;
                m_Volume = true;
                AdjustCrossAxisTicks();
                SetInitial();

                UpdateSpecific = SpecificUpdate;
            }
            else if (m_Parent.name.Contains("Mesh"))
            {
                m_MeshCreator            = m_Parent.GetComponent <MeshCreatorController>();
                m_PointerController      = m_Pointer.GetComponent <PointerController>();
                transform.localScale     = Vector3.zero;
                m_ScaleDim               = "";
                m_OriginalImage          = transform.Find("Image (Horz)").gameObject;
                m_CrossAxisOriginalImage = transform.Find("Image (Vert)").gameObject;
                CreateGridForMesh();

                UpdateSpecific = MeshUpdate;
            }
        }
        else if (m_Parent.transform.parent.gameObject.name.Contains("Clone") && m_Parent.transform.parent.gameObject.name.Contains("Area"))
        {
            m_ScaleDim = "x";

            m_Parent                 = m_Parent.transform.parent.gameObject;
            m_OriginalImage          = transform.Find("Image (Horz)").gameObject; // TODO: rename
            m_CrossAxisOriginalImage = transform.Find("Image (Vert)").gameObject;
            UpdateSpecific           = SpecificUpdate;
            AdjustCrossAxisTicks();
        }

        UpdateGridScale();
        GlobalGridScale.AddScaleListener(UpdateGridScale);
    }
    // TODO: there will be 3+ instances of m_SubdivisionScale. how do we get this to 1?
    void Awake()
    {
        UpdateGridScale();
        GlobalGridScale.AddScaleListener(UpdateGridScale);

        AddListener(PostFinish, ListenerType.PostFinish);

        RunOnAwake();
    }
    //public Vector3 _scale;

    void Awake()
    {
        propBlock = new MaterialPropertyBlock();
        _renderer = GetComponent <Renderer>();
        material  = _renderer.material;
        UpdateGridScale();
        GlobalGridScale.AddScaleListener(UpdateGridScale);
        InitializeMaterial();

        _gridOn = GlobalGridScale.Instance.GridOn;
    }
Esempio n. 5
0
    void Start()
    {
        m_Parent          = transform.parent.gameObject;
        m_RectTransform   = gameObject.GetComponent <RectTransform>();
        m_BaseScale       = m_RectTransform.localScale;
        m_BaseWidthHeight = m_RectTransform.sizeDelta;

        m_MeshCreator            = m_Parent.GetComponent <MeshCreatorController>();
        m_PointerController      = m_Pointer.GetComponent <PointerController>();
        transform.localScale     = Vector3.zero;
        m_OriginalImage          = transform.Find("Image (Horz)").gameObject;
        m_CrossAxisOriginalImage = transform.Find("Image (Vert)").gameObject;

        UpdateGridScale();
        GlobalGridScale.AddScaleListener(UpdateGridScale);
    }