Пример #1
0
    private void CreateWorldObjectDummies(Coords2 coords, GameObject tile)
    {
        GameObject            worldObjectDummyPrefab = GameManager.instance.GetPrefabs().multitileWorldObjectDummy;
        WorldObjectController controller             = tile.GetComponent <WorldObjectController>();

        if (controller == null)
        {
            return;
        }
        CreateDummies(coords, tile, worldObjectLayer, worldObjectDummyPrefab, controller.GetDummiesToCreate());
    }
Пример #2
0
    //requires object to have worldobjectcontroller
    //should be called when wallobjectcontroller.interact returns false or is not called
    private bool InteractObject(Coords2 coords, Player player)
    {
        GameObject tile = GetWorldObject(coords);

        if (tile == null)
        {
            return(false);
        }

        WorldObjectController controller = tile.GetComponent <WorldObjectController>();

        if (controller == null)
        {
            return(false);
        }

        return(controller.Interact(coords, player));
    }
 public void SetOwner(GameObject newOwner)
 {
     ownerController = newOwner.GetComponent <WorldObjectController>();
 }