Esempio n. 1
0
 private void Start()
 {
     mapElementFactory = MapElementFactory.GetInstance();
     if (mapElementFactory == null)
     {
         Debug.LogError("DesignerManager: mapElementFactory is null!");
     }
 }
Esempio n. 2
0
 public ClipboardManager(
     [Import] Lazy <MapElementFactory> factory,
     [Import] Lazy <SerialisedObjectFormatter> formatter
     )
 {
     _factory            = factory.Value;
     _formatter          = formatter.Value;
     SizeOfClipboardRing = 10;
     Ring = new List <ClipboardEntry>();
 }
Esempio n. 3
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }
Esempio n. 4
0
    // Use this for initialization
    void Start()
    {
#if UNITY_STANDALONE_WIN
        meshRenderer = GetComponent <MeshRenderer>();
#endif
        designerManager = DesignerManager.GetInstance();
        if (designerManager == null)
        {
            Debug.Log("CreateMapElementOnIt: designerManager is null!");
        }
        mapElementFactory = MapElementFactory.GetInstance();
        if (mapElementFactory == null)
        {
            Debug.Log("CreateMapElementOnIt: mapElementFactory is null!");
        }
    }
Esempio n. 5
0
    void Start()
    {
#if UNITY_ANDROID
        saveBtn     = androidSaveBtn;
        savePanel   = androidSavePanel;
        saveName    = androidSaveName;
        scarab3part = androidScarab3part;
        scarab2part = androidScarab2part;

        panel  = androidPanel;
        clear  = androidClear;
        delete = androidDelete;
#else
        saveBtn     = windowsSaveBtn;
        savePanel   = windowsSavePanel;
        saveName    = windowsSaveName;
        scarab3part = windowsScarab3part;
        scarab2part = windowsScarab2part;

        panel  = windowsPanel;
        clear  = windowsClear;
        delete = windowsDelete;
#endif

        deviceCreatedMapFileLocation = Application.persistentDataPath + SharedData.deviceCreatedMapFileLocation;

        mapElementFactory = MapElementFactory.GetInstance();
        if (mapElementFactory == null)
        {
            Debug.LogError("DesignerManager: mapElementFactory is null!");
        }

        startPosition = webCreator.StartPosition;
        objectMap     = new GameObject[webCreator.RowCount, webCreator.ColumnCount];
        actMap        = new MapElement[webCreator.RowCount, webCreator.ColumnCount];
        for (int i = 0; i < actMap.GetLength(0); i++)
        {
            for (int j = 0; j < actMap.GetLength(1); j++)
            {
                actMap[i, j] = MapElement.Edge;
                Vector3    placePosition = new Vector3(startPosition.x + j * SharedData.widhtUnit + SharedData.widhtUnit / 2, 0, startPosition.z - i * SharedData.widhtUnit - SharedData.widhtUnit / 2);
                GameObject edge          = Instantiate(edgeModel.gameObject, placePosition + new Vector3(0, edgeModel.ModelGround, 0), edgeModel.GetQuat(), transform);
                objectMap[i, j] = edge;
            }
        }
    }
Esempio n. 6
0
    void Start()
    {
        meshRenderer = GetComponent <MeshRenderer>();
        Material[] mats = meshRenderer.materials;
        originalColor = new Color[mats.Length];
        for (int i = 0; i < mats.Length; i++)
        {
            originalColor[i] = mats[i].color;
        }

        designerManager = DesignerManager.GetInstance();
        if (designerManager == null)
        {
            Debug.Log("MapElement: DesignerManager is null!");
        }
        mapElementFactory = MapElementFactory.GetInstance();
        if (mapElementFactory == null)
        {
            Debug.Log("MapElement: mapElementFactory is null!");
        }
    }
Esempio n. 7
0
 public VmfBspSourceProvider([Import] Lazy <SerialisedObjectFormatter> formatter, [Import] Lazy <MapElementFactory> factory, [Import] Lazy <SquareGridFactory> squareGridFactory)
 {
     _formatter         = formatter.Value;
     _factory           = factory.Value;
     _squareGridFactory = squareGridFactory.Value;
 }
 public NativeBspSourceProvider([Import] Lazy <SerialisedObjectFormatter> formatter, [Import] Lazy <MapElementFactory> factory)
 {
     _formatter = formatter.Value;
     _factory   = factory.Value;
 }