示例#1
0
文件: Map.cs 项目: Rezillien/AstroLab
    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
文件: Map.cs 项目: Rezillien/AstroLab
    //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>();
 }