コード例 #1
0
ファイル: VRAR_Tile.cs プロジェクト: mserier/vrar
 public void removeDumbObject(BaseTileObject tileObject)
 {
     locationList.Remove(tileObject.getObjectID());
     scaleList.Remove(tileObject.getObjectID());
     rotationList.Remove(tileObject.getObjectID());
     dumbObjectsList.Remove(tileObject);
     setDirty();
 }
コード例 #2
0
ファイル: TileObjectEditor.cs プロジェクト: mserier/vrar
    //Add a tileobject to the gridview and in the world
    public void AddTileObject(BaseTileObject tileObject)
    {
        if (tileObject != null)
        {
            //Debug.Log("Adding a tileobject current size = " + indexTracker.Count + " and added id is " + tileObject.getObjectID());
            string key = standartKeyName + tileObject.getObjectID();
            //Debug.Log("Added a new key: " + key);
            int id = tileObject.getObjectID();
            Debug.Log("Trying to get id: " + id);
            foreach (KeyValuePair <string, BaseTileObject> a in objectTracker)
            {
                Debug.Log("Key: " + a.Key);
            }


            if (!objectTracker.ContainsKey(key))
            {
                //print("Did not exists");
                objectTracker.Add(key, tileObject);
                indexTracker.Add(key, id);
                InstantiateObject(tileObject, id);
                //InstantiateObject(tileObject.getPrefab().gameObject, id);

                print("1 :" + selectedTile);
                print("2 :" + selectedTile.tileGameObject);
                print("3 :" + tileObjects);
                selectedTile.AddPosition(id, selectedTile.tileGameObject.position);
                selectedTile.AddScale(id, new Vector3(1, 1, 1));
                selectedTile.AddRotation(id, new Quaternion());
                TileRenderer.instance.updateTile(selectedTile);


                //TODO should be handled better
                tileObjects.Clear();

                foreach (KeyValuePair <string, BaseTileObject> entry in objectTracker)
                {
                    tileObjects.Add(entry.Value);
                }

                selectedTile.UpdateList(tileObjects, GetElevation(), GetWalkable(), terrain);
            }
            else
            {
                print("Already exists");
            }
        }
        else
        {
            throw new System.Exception("Null tile object");
        }
    }
コード例 #3
0
ファイル: VRAR_Tile.cs プロジェクト: mserier/vrar
    public void addDumbObject(BaseTileObject tileObject, Vector3 position, Quaternion rotation, Vector3 scale)
    {
        AddPosition(tileObject.getObjectID(), position);
        AddRotation(tileObject.getObjectID(), rotation);
        AddScale(tileObject.getObjectID(), scale);

        //Debug.Log("Adding new object with id : " + tileObject.getObjectID());
        //if (!tileObject.getInteractable())
        {
            dumbObjectsList.Add(tileObject);
        }
        //else
        {
            //Debug.LogError("Someone tried to set a interactable object as a dumb object of the tile :" + this);
        }
        setDirty();
    }
コード例 #4
0
ファイル: VRAR_Level.cs プロジェクト: mserier/vrar
 public void setInteractableObject(BaseTileObject tileObject)
 {
     if (tileObject.getInteractable())
     {
         interactableObject = tileObject;
     }
     else
     {
         Debug.LogError("Someone tried to set a non interactable object as the interactable object (" + tileObject.getObjectID() + ") of the tile :" + this);
     }
 }
コード例 #5
0
    public void setInteractableObject(BaseTileObject tileObject)
    {
        //Debug.Log("THis created a bugged tile so disabling it for now");
        return;

        if (tileObject.getInteractable())
        {
            interactableObject = tileObject;
        }
        else
        {
            Debug.LogError("Someone tried to set a non interactable object as the interactable object (" + tileObject.getObjectID() + ") of the tile :" + this);
        }
    }