예제 #1
0
        private void extractArgs(object[] args)
        {
            if (args == null)
                return;

            mouseDataType = (EditorMouseDataType)args[0];
            mouseData = (InfoMap)args[1];
            isHovered = (bool)args[2];
            hoverLocationX = (int)args[3];
            hoverLocationY = (int)args[4];
        }
예제 #2
0
        public void SetData(EditorMouseDataType dataType, object data, GameObject preview = null)
        {
            DataType = dataType;
            Data = data;

            if (preview != null)
            {
                if (previewRoot == null)
                    previewRoot = new GameObject("MousePreviewRoot");

                preview.transform.SetParent(previewRoot.transform, false);
                if (lastOverMapcell != null)
                    preview.transform.position = lastOverMapcell.Position;

                this.preview = preview;
            }

            EventManager.Instance.FireEvent(EditorEvent.MOUSE_SET_DATA);
        }
예제 #3
0
        public void SetData(EditorMouseDataType dataType, object data, string previewPath)
        {
            GameObject preview = null;
            if (previewPath != null)
            {
                preview = loader.LoadPrefab(previewPath).Instantiate();
                SpriteRenderer renderer = preview.GetComponent<SpriteRenderer>();
                renderer.color = new Color(1, 1, 1, 0.5f);
            }

            SetData(dataType, data, preview);
        }