コード例 #1
0
        //************************************************************


        void Start()
        {
            GameObject canvas = GameObject.Find("Canvas");

            buildingEditMenu  = canvas.transform.Find("BuildingEdit").gameObject;
            highwayEditMenu   = canvas.transform.Find("HighwayEdit").gameObject;
            barrierEditMenu   = canvas.transform.Find("BarrierEdit").gameObject;
            ObjectEditMenu    = canvas.transform.Find("3DObjectEdit").gameObject;
            CameraVanEditMenu = canvas.transform.Find("CameraVanEdit").gameObject;
            buildingEdit      = buildingEditMenu.GetComponent <BuildingEdit>();
            highwayEdit       = highwayEditMenu.GetComponent <HighwayEdit>();
            barrierEdit       = barrierEditMenu.GetComponent <BarrierEdit>();
            objectEdit        = ObjectEditMenu.GetComponent <ObjectEdit>();
            cameraVanEdit     = CameraVanEditMenu.GetComponent <CameraVanEdit>();

            translateX = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_TransX").GetComponent <InputField>();
            translateY = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_TransY").GetComponent <InputField>();
            translateZ = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_TransZ").GetComponent <InputField>();

            rotateX = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_RotateX").GetComponent <InputField>();
            rotateY = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_RotateY").GetComponent <InputField>();
            rotateZ = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_RotateZ").GetComponent <InputField>();

            scaleX = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_ScaleX").GetComponent <InputField>();
            scaleY = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_ScaleY").GetComponent <InputField>();
            scaleZ = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_ScaleZ").GetComponent <InputField>();

            currentSelectionID  = "";
            previousSelectionID = "";
        }
コード例 #2
0
    private void OnTriggerStay2D(Collider2D collision)
    {
        try
        {
            ObjectEdit objEdit = collision.GetComponent <Collider2D>().gameObject.GetComponent <ObjectEdit>();

            if (objEdit)
            {
                if (!objEdit.IsActing())
                {
                    if (collision.gameObject.transform.parent.CompareTag("Portal"))
                    {
                        Destroy(objEdit.transform.parent.gameObject);
                    }
                    else
                    {
                        Destroy(objEdit.gameObject);
                    }
                }
            }
        }
        catch (MissingComponentException)
        {
            return;
        }
    }
コード例 #3
0
    public void ChangeSelected(ObjectEdit caller)
    {
        ClearSelected();
        caller.selected = true;
        selected        = caller;

        SetLayerUI();
    }
コード例 #4
0
 public void RemoveObject(ObjectEdit obj)
 {
     objects.Remove(obj);
     if (obj == selected)
     {
         ClearSelected();
     }
 }
コード例 #5
0
    public void ClearSelected()
    {
        foreach (ObjectEdit obj in objects)
        {
            obj.selected = false;
        }
        selected = null;

        SetLayerUI();
    }
コード例 #6
0
ファイル: MainForm.cs プロジェクト: nicengi/MMEdit
 private void UpdateWidget(ObjectEdit edit)
 {
     try
     {
         Control widget = Host.CreateWidget <Control>(edit.ObjectFX)
                          ?? new MessageWidget(string.Format(Resources.Msg_WidgetNotFound, edit.ObjectFX.WidgetID));
         SetWidgetControl(widget);
     }
     catch (Exception e)
     {
         SetWidgetControl(new MessageWidget(e));
     }
 }
コード例 #7
0
ファイル: MainForm.cs プロジェクト: nicengi/MMEdit
        public void ActivateEdit(ObjectEdit edit)
        {
            if (edit == null)
            {
                if (ActiveEdit != null)
                {
                    ActiveEdit.OnStatusChanged(FileStatus.Closed);
                }
                ActiveEdit = null;
                return;
            }

            if (ActiveEdit != null)
            {
                ActiveEdit.StatusChanged -= Edit_FileStatusChanged;
            }
            ActiveEdit = edit;
            ActiveEdit.StatusChanged += Edit_FileStatusChanged;
            ActiveEdit.OnStatusChanged(edit.IsSaved ? FileStatus.Opened : FileStatus.Changed);
        }
コード例 #8
0
    void Awake()
    {
#if UNITY_IOS
        foreach (GameObject obj in mobileGameObjects)
        {
            obj.SetActive(true);
        }
#elif UNITY_WEBGL
        if (ObjectEdit.IsMobile())
        {
            foreach (GameObject obj in mobileGameObjects)
            {
                obj.SetActive(true);
            }
        }
#else
        foreach (GameObject obj in mobileGameObjects)
        {
            obj.SetActive(false);
        }
#endif
    }
コード例 #9
0
 public void AddObject(ObjectEdit obj)
 {
     objects.Add(obj);
 }
コード例 #10
0
    private void AddEditScript(GameObject obj)
    {
        ObjectEdit editScript = obj.AddComponent <ObjectEdit>();

        controller.AddObject(editScript);
    }