示例#1
0
    protected override void OnLongPress(Vector2 screenPosition)
    {
        int x, y;

        if (IsoHelper.ScreenPositionToEdge(screenPosition, out x, out y))
        {
            State = SpawnState.Spawn;
        }
    }
示例#2
0
    void SpawnAtScreenPosition(Vector2 pos)
    {
        int x, y;

        IsoHelper.ScreenPositionToEdge(pos, out x, out y);
        x = Mathf.Clamp(x, 0, Constants.EDGE_WIDTH - 1);
        y = Mathf.Clamp(y, 0, Constants.EDGE_HEIGHT - 1);
        BattleManager.Instance.PlayerPlaceSoldierOrSkill(spawnId, x, y);
    }